linux – 为什么strace使用ENOENT返回代码返回这么多execve调用?

前端之家收集整理的这篇文章主要介绍了linux – 为什么strace使用ENOENT返回代码返回这么多execve调用?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想使用strace来查看当我执行`hadoop fs -ls’时发生了什么,所以我运行了命令:

strace -f -e trace = execve hadoop fs -ls / stg导致了很多这样的输出

[pid 187050] execve("/opt/sas/app/platform/lsf/8.0/linux2.6-glibc2.3-x86_64/etc/setsid",["setsid","bash","-c","echo $$"],[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/opt/sas/app/platform/lsf/8.0/linux2.6-glibc2.3-x86_64/bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/opt/dca/bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/usr/local/greenplum-cc-web/./bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/usr/lib64/qt-3.3/bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/usr/local/bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/bin/setsid",[/* 78 vars */]) = -1 ENOENT (No such file or directory)
[pid 187050] execve("/usr/bin/setsid",[/* 78 vars */]) = 0

为什么会有这么多-1 ENOENT(没有这样的文件或目录)结果?

解决方法

它试图通过调用$PATH-order中的每个潜在位置来运行程序,而无需预知程序的位置.这是完全正常的,因为像许多软件商店中的安全最佳实践那样执行stat()然后execve()这样的事情被认为是竞争条件.
原文链接:https://www.f2er.com/linux/398467.html

猜你在找的Linux相关文章