加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 如何运行valgrind到一个具有超级用户位的进程?

发布时间:2020-12-13 19:18:03 所属栏目:Linux 来源:网络整理
导读:我按如下方式运行valgrind: – /usr/local / bin / valgrind“process_name” 在执行之后它给我跟随错误 ==21731====21731== Warning: Can't execute setuid/setgid executable: ==21731== Possible workaround: remove --trace-children=yes,if in effect=
我按如下方式运行valgrind: –

/usr/local / bin / valgrind“process_name”

在执行之后它给我跟随错误

==21731==
==21731== Warning: Can't execute setuid/setgid executable: 
==21731== Possible workaround: remove --trace-children=yes,if in effect
==21731==
valgrind: "process name": Permission denied

我的valgrind许可如下: –
-r-sr-xr-x /usr/local / bin / valgrind

我的流程许可如下: –
-r-sr-xr-x“process_name”

平台:Linux VMLINUX3 2.6.9-78.0.22.ELsmp(RHEL)

Valgrind版本:valgrind-3.5.0

任何有关这方面的帮助将不胜感激

解决方法

对于开发FUSE文件系统的人来说,这是一个永久性的问题. This link may help(在单个答案中合并太多了).解决方法包括及时更换fusermount,以及(取决于)valgrind的一些其他选项,以防止它跟踪儿童.

事实上,如果你在valgrind下运行我的FS,你得到这个输出(是的,有足够的人有这个问题,我实际上在启动时检测到valgrind并显示链接):

root@tower:~ # valgrind xsfs /xs
==9479== Memcheck,a memory error detector.
==9479== Copyright (C) 2002-2008,and GNU GPL'd,by Julian Seward et al.
==9479== Using LibVEX rev 1884,a library for dynamic binary translation.
==9479== Copyright (C) 2004-2008,by OpenWorks LLP.
==9479== Using valgrind-3.4.1,a dynamic binary instrumentation framework.
==9479== Copyright (C) 2000-2008,by Julian Seward et al.
==9479== For more details,rerun with: -v
==9479==
******** Valgrind has been detected by xsfs
******** If you have difficulties getting xsfs to work under Valgrind,******** see the following thread:
******** http://www.nabble.com/valgrind-and-fuse-file-systems-td13112112.html
******** Sleeping for 5 seconds so this doesn't fly by ....

最简单的方法是在以root身份运行的一次性VM中进行所有调试,您可以放弃setuid位,然后完成它.确保您测试代码没有任何泄漏或违规,它很容易测试任何不使用保险丝的链接库代码.把你的构建从’valgrind-clean’移开并注意你已经在文档中完成了.

然后,从valgrind / valgrind.h中取出一些内容来检测它,并显示一条短消息,指出那些未来仍然运行它的人.解决它的黑客需要根合作,坦率地说,在沙箱中也更容易完成.

在setuid位开启的情况下拒绝在valgrind下运行也很容易,如果他们真的想要这样做,就会显示一个有用的信息让人们关闭它.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读