{"id":410,"date":"2013-06-23T08:12:52","date_gmt":"2013-06-23T08:12:52","guid":{"rendered":"https:\/\/shan.info\/new\/strace%e5%91%bd%e4%bb%a4\/"},"modified":"2013-06-23T08:12:52","modified_gmt":"2013-06-23T08:12:52","slug":"strace%e5%91%bd%e4%bb%a4","status":"publish","type":"post","link":"https:\/\/shan.info\/new\/strace%e5%91%bd%e4%bb%a4\/","title":{"rendered":"strace\u547d\u4ee4"},"content":{"rendered":"<pre class=\"brush:bash\">root@ubuntu:\/usr# strace cat \/dev\/null \r\nexecve(\"\/bin\/cat\", [\"cat\", \"\/dev\/null\"], [\/* 22 vars *\/]) = 0\r\nbrk(0)                                  = 0xab1000\r\naccess(\"\/etc\/ld.so.nohwcap\", F_OK)      = -1 ENOENT (No such file or directory)\r\nmmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f29379a7000\r\naccess(\"\/etc\/ld.so.preload\", R_OK)      = -1 ENOENT (No such file or directory)\r\n...\r\nbrk(0) = 0xab1000\r\nbrk(0xad2000) = 0xad2000\r\nfstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0\r\nopen(\"\/dev\/null\", O_RDONLY) = 3\r\nfstat(3, {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0\r\nread(3, \"\", 32768) = 0\r\nclose(3) = 0\r\nclose(1) = 0\r\nclose(2) = 0\r\nexit_group(0) = ?\r\n<\/pre>\n<p>&#8212;<\/p>\n<p><span style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\">\u6bcf\u4e00\u884c\u90fd\u662f\u4e00\u6761\u7cfb\u7edf\u8c03\u7528\uff0c\u7b49\u53f7\u5de6\u8fb9\u662f\u7cfb\u7edf\u8c03\u7528\u7684\u51fd\u6570\u540d\u53ca\u5176\u53c2\u6570\uff0c\u53f3\u8fb9\u662f\u8be5\u8c03\u7528\u7684\u8fd4\u56de\u503c\u3002<\/span><br style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\" \/><span style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\">strace \u663e\u793a\u8fd9\u4e9b\u8c03\u7528\u7684\u53c2\u6570\u5e76\u8fd4\u56de\u7b26\u53f7\u5f62\u5f0f\u7684\u503c\u3002strace \u4ece\u5185\u6838\u63a5\u6536\u4fe1\u606f\uff0c\u800c\u4e14\u4e0d\u9700\u8981\u4ee5\u4efb\u4f55\u7279\u6b8a\u7684\u65b9\u5f0f\u6765\u6784\u5efa\u5185\u6838\u3002<\/span><\/p>\n<p><span style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\">&#8212;<\/span><\/p>\n<p><span style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\">&nbsp;<\/span><\/p>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New'; line-height: 18px;\">-c \u7edf\u8ba1\u6bcf\u4e00\u7cfb\u7edf\u8c03\u7528\u7684\u6240\u6267\u884c\u7684\u65f6\u95f4,\u6b21\u6570\u548c\u51fa\u9519\u7684\u6b21\u6570\u7b49. <br \/>-d \u8f93\u51fastrace\u5173\u4e8e\u6807\u51c6\u9519\u8bef\u7684\u8c03\u8bd5\u4fe1\u606f. <br \/>-f \u8ddf\u8e2a\u7531fork\u8c03\u7528\u6240\u4ea7\u751f\u7684\u5b50\u8fdb\u7a0b. <br \/>-ff \u5982\u679c\u63d0\u4f9b-o filename,\u5219\u6240\u6709\u8fdb\u7a0b\u7684\u8ddf\u8e2a\u7ed3\u679c\u8f93\u51fa\u5230\u76f8\u5e94\u7684filename.pid\u4e2d,pid\u662f\u5404\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7. <br \/>-F \u5c1d\u8bd5\u8ddf\u8e2avfork\u8c03\u7528.\u5728-f\u65f6,vfork\u4e0d\u88ab\u8ddf\u8e2a. <br \/>-h \u8f93\u51fa\u7b80\u8981\u7684\u5e2e\u52a9\u4fe1\u606f. <br \/>-i \u8f93\u51fa\u7cfb\u7edf\u8c03\u7528\u7684\u5165\u53e3\u6307\u9488. <br \/>-q \u7981\u6b62\u8f93\u51fa\u5173\u4e8e\u8131\u79bb\u7684\u6d88\u606f. <br \/>-r \u6253\u5370\u51fa\u76f8\u5bf9\u65f6\u95f4\u5173\u4e8e,,\u6bcf\u4e00\u4e2a\u7cfb\u7edf\u8c03\u7528. <br \/>-t \u5728\u8f93\u51fa\u4e2d\u7684\u6bcf\u4e00\u884c\u524d\u52a0\u4e0a\u65f6\u95f4\u4fe1\u606f. <br \/>-tt \u5728\u8f93\u51fa\u4e2d\u7684\u6bcf\u4e00\u884c\u524d\u52a0\u4e0a\u65f6\u95f4\u4fe1\u606f,\u5fae\u79d2\u7ea7. <br \/>-ttt \u5fae\u79d2\u7ea7\u8f93\u51fa,\u4ee5\u79d2\u4e86\u8868\u793a\u65f6\u95f4. <br \/>-T \u663e\u793a\u6bcf\u4e00\u8c03\u7528\u6240\u8017\u7684\u65f6\u95f4. <br \/>-v \u8f93\u51fa\u6240\u6709\u7684\u7cfb\u7edf\u8c03\u7528.\u4e00\u4e9b\u8c03\u7528\u5173\u4e8e\u73af\u5883\u53d8\u91cf,\u72b6\u6001,\u8f93\u5165\u8f93\u51fa\u7b49\u8c03\u7528\u7531\u4e8e\u4f7f\u7528\u9891\u7e41,\u9ed8\u8ba4\u4e0d\u8f93\u51fa. <br \/>-V \u8f93\u51fastrace\u7684\u7248\u672c\u4fe1\u606f. <br \/>-x \u4ee5\u5341\u516d\u8fdb\u5236\u5f62\u5f0f\u8f93\u51fa\u975e\u6807\u51c6\u5b57\u7b26\u4e32 <br \/>-xx \u6240\u6709\u5b57\u7b26\u4e32\u4ee5\u5341\u516d\u8fdb\u5236\u5f62\u5f0f\u8f93\u51fa. <br \/>-a column <br \/>\u8bbe\u7f6e\u8fd4\u56de\u503c\u7684\u8f93\u51fa\u4f4d\u7f6e.\u9ed8\u8ba4 \u4e3a40. <br \/>-e expr <br \/>\u6307\u5b9a\u4e00\u4e2a\u8868\u8fbe\u5f0f,\u7528\u6765\u63a7\u5236\u5982\u4f55\u8ddf\u8e2a.\u683c\u5f0f\u5982\u4e0b: <br \/>[qualifier=][!]value1[,value2]... <br \/>qualifier\u53ea\u80fd\u662f trace,abbrev,verbose,raw,signal,read,write\u5176\u4e2d\u4e4b\u4e00.value\u662f\u7528\u6765\u9650\u5b9a\u7684\u7b26\u53f7\u6216\u6570\u5b57.\u9ed8\u8ba4\u7684 qualifier\u662f trace.\u611f\u53f9\u53f7\u662f\u5426\u5b9a\u7b26\u53f7.\u4f8b\u5982: <br \/>-eopen\u7b49\u4ef7\u4e8e -e trace=open,\u8868\u793a\u53ea\u8ddf\u8e2aopen\u8c03\u7528.\u800c-etrace!=open\u8868\u793a\u8ddf\u8e2a\u9664\u4e86open\u4ee5\u5916\u7684\u5176\u4ed6\u8c03\u7528.\u6709\u4e24\u4e2a\u7279\u6b8a\u7684\u7b26\u53f7 all \u548c none. <br \/>\u6ce8\u610f\u6709\u4e9bshell\u4f7f\u7528!\u6765\u6267\u884c\u5386\u53f2\u8bb0\u5f55\u91cc\u7684\u547d\u4ee4,\u6240\u4ee5\u8981\u4f7f\u7528\\. <br \/>-e trace=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u53ea\u8ddf\u8e2a\u6307\u5b9a\u7684\u7cfb\u7edf \u8c03\u7528.\u4f8b\u5982:-e trace=open,close,rean,write\u8868\u793a\u53ea\u8ddf\u8e2a\u8fd9\u56db\u4e2a\u7cfb\u7edf\u8c03\u7528.\u9ed8\u8ba4\u7684\u4e3aset=all. <br \/>-e trace=file <br \/>\u53ea\u8ddf\u8e2a\u6709\u5173\u6587\u4ef6\u64cd\u4f5c\u7684\u7cfb\u7edf\u8c03\u7528. <br \/>-e trace=process <br \/>\u53ea\u8ddf\u8e2a\u6709\u5173\u8fdb\u7a0b\u63a7\u5236\u7684\u7cfb\u7edf\u8c03\u7528. <br \/>-e trace=network <br \/>\u8ddf\u8e2a\u4e0e\u7f51\u7edc\u6709\u5173\u7684\u6240\u6709\u7cfb\u7edf\u8c03\u7528. <br \/>-e strace=signal <br \/>\u8ddf\u8e2a\u6240\u6709\u4e0e\u7cfb\u7edf\u4fe1\u53f7\u6709\u5173\u7684 \u7cfb\u7edf\u8c03\u7528 <br \/>-e trace=ipc <br \/>\u8ddf\u8e2a\u6240\u6709\u4e0e\u8fdb\u7a0b\u901a\u8baf\u6709\u5173\u7684\u7cfb\u7edf\u8c03\u7528 <br \/>-e abbrev=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u8bbe\u5b9a strace\u8f93\u51fa\u7684\u7cfb\u7edf\u8c03\u7528\u7684\u7ed3\u679c\u96c6.-v \u7b49\u4e0e abbrev=none.\u9ed8\u8ba4\u4e3aabbrev=all. <br \/>-e raw=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u5c06\u6307 \u5b9a\u7684\u7cfb\u7edf\u8c03\u7528\u7684\u53c2\u6570\u4ee5\u5341\u516d\u8fdb\u5236\u663e\u793a. <br \/>-e signal=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u6307\u5b9a\u8ddf\u8e2a\u7684\u7cfb\u7edf\u4fe1\u53f7.\u9ed8\u8ba4\u4e3aall.\u5982 signal=!SIGIO(\u6216\u8005signal=!io),\u8868\u793a\u4e0d\u8ddf\u8e2aSIGIO\u4fe1\u53f7. <br \/>-e read=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u8f93\u51fa\u4ece\u6307\u5b9a\u6587\u4ef6\u4e2d\u8bfb\u51fa \u7684\u6570\u636e.\u4f8b\u5982: <br \/>-e read=<span style=\"line-height: 1.5; color: #800080;\">3<\/span>,<span style=\"line-height: 1.5; color: #800080;\">5<\/span> <br \/>-e write=<span style=\"line-height: 1.5; color: #0000ff;\">set<\/span> <br \/>\u8f93\u51fa\u5199\u5165\u5230\u6307\u5b9a\u6587\u4ef6\u4e2d\u7684\u6570\u636e. <br \/>-o filename <br \/>\u5c06strace\u7684\u8f93\u51fa\u5199\u5165\u6587\u4ef6filename <br \/>-p pid <br \/>\u8ddf\u8e2a\u6307\u5b9a\u7684\u8fdb\u7a0bpid. <br \/>-s strsize <br \/>\u6307\u5b9a\u8f93\u51fa\u7684\u5b57\u7b26\u4e32\u7684\u6700\u5927\u957f\u5ea6.\u9ed8\u8ba4\u4e3a32.\u6587\u4ef6\u540d\u4e00\u76f4\u5168\u90e8\u8f93\u51fa. <br \/>-u username <br \/>\u4ee5username \u7684UID\u548cGID\u6267\u884c\u88ab\u8ddf\u8e2a\u7684\u547d\u4ee4<br \/><br \/>---<br \/><br \/><\/pre>\n<h1 style=\"margin-top: 10px; margin-bottom: 5px; font-size: 24px; line-height: 48px; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><strong><span style=\"line-height: 1.5; font-size: 18pt;\">\u547d\u4ee4\u5b9e\u4f8b<\/span><\/strong><\/h1>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><strong>\u901a\u7528\u7684\u5b8c\u6574\u7528\u6cd5\uff1a<\/strong><\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\">strace -o output.txt -T -tt -e trace=all -p <span style=\"line-height: 1.5; color: #800080;\">28979<\/span><\/pre>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u4e0a\u9762\u7684\u542b\u4e49\u662f \u8ddf\u8e2a28979\u8fdb\u7a0b\u7684\u6240\u6709\u7cfb\u7edf\u8c03\u7528\uff08-e trace=all\uff09\uff0c\u5e76\u7edf\u8ba1\u7cfb\u7edf\u8c03\u7528\u7684\u82b1\u8d39\u65f6\u95f4\uff0c\u4ee5\u53ca\u5f00\u59cb\u65f6\u95f4\uff08\u5e76\u4ee5\u53ef\u89c6\u5316\u7684\u65f6\u5206\u79d2\u683c\u5f0f\u663e\u793a\uff09\uff0c\u6700\u540e\u5c06\u8bb0\u5f55\u7ed3\u679c\u5b58\u5728output.txt\u6587\u4ef6\u91cc\u9762\u3002<\/p>\n<h1 style=\"margin-top: 10px; margin-bottom: 5px; font-size: 24px; line-height: 48px; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><strong><span style=\"line-height: 1.5; font-size: 18pt;\">strace\u6848\u4f8b<\/span><\/strong><\/h1>\n<h2 style=\"margin-top: 10px; margin-bottom: 3px; font-size: 18px; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: 14pt;\"><strong>&nbsp; \u7528strace\u8c03\u8bd5\u7a0b\u5e8f<\/strong><\/span><\/h2>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u5728\u7406\u60f3\u4e16\u754c\u91cc\uff0c\u6bcf\u5f53\u4e00\u4e2a\u7a0b\u5e8f\u4e0d\u80fd\u6b63\u5e38\u6267\u884c\u4e00\u4e2a\u529f\u80fd\u65f6\uff0c\u5b83\u5c31\u4f1a\u7ed9\u51fa\u4e00\u4e2a\u6709\u7528\u7684\u9519\u8bef\u63d0\u793a\uff0c\u544a\u8bc9\u4f60\u5728\u8db3\u591f\u7684\u6539\u6b63\u9519\u8bef\u7684\u7ebf\u7d22\u3002\u4f46\u9057\u61be\u7684\u662f\uff0c\u6211\u4eec\u4e0d\u662f\u751f\u6d3b\u5728\u7406\u60f3\u4e16\u754c \u91cc\uff0c\u8d77\u7801\u4e0d\u603b\u662f\u751f\u6d3b\u5728\u7406\u60f3\u4e16\u754c\u91cc\u3002\u6709\u65f6\u5019\u4e00\u4e2a\u7a0b\u5e8f\u51fa\u73b0\u4e86\u95ee\u9898\uff0c\u4f60\u65e0\u6cd5\u627e\u5230\u539f\u56e0\u3002<br \/>\u8fd9\u5c31\u662f\u8c03\u8bd5\u7a0b\u5e8f\u51fa\u73b0\u7684\u539f\u56e0\u3002strace\u662f\u4e00\u4e2a\u5fc5\u4e0d\u53ef\u5c11\u7684 \u8c03\u8bd5\u5de5\u5177\uff0cstrace\u7528\u6765\u76d1\u89c6\u7cfb\u7edf\u8c03\u7528\u3002\u4f60\u4e0d\u4ec5\u53ef\u4ee5\u8c03\u8bd5\u4e00\u4e2a\u65b0\u5f00\u59cb\u7684\u7a0b\u5e8f\uff0c\u4e5f\u53ef\u4ee5\u8c03\u8bd5\u4e00\u4e2a\u5df2\u7ecf\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\uff08\u628astrace\u7ed1\u5b9a\u5230\u4e00\u4e2a\u5df2\u6709\u7684PID\u4e0a \u9762\uff09\u3002<br \/>\u9996\u5148\u8ba9\u6211\u4eec\u770b\u4e00\u4e2a\u771f\u5b9e\u7684\u4f8b\u5b50\uff1a\u542f\u52a8KDE\u65f6\u51fa\u73b0\u95ee\u9898<br \/>\u524d\u4e00\u6bb5\u65f6\u95f4\uff0c\u6211\u5728 \u542f\u52a8KDE\u7684\u65f6\u5019\u51fa\u4e86\u95ee\u9898\uff0cKDE\u7684\u9519\u8bef\u4fe1\u606f\u65e0\u6cd5\u7ed9\u6211\u4efb\u4f55\u6709\u5e2e\u52a9\u7684\u7ebf\u7d22\u3002<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\">_KDE_IceTransSocketCreateListener: failed to bind listener<br \/>_KDE_IceTransSocketUNIXCreateListener: ...SocketCreateListener() failed<br \/>_KDE_IceTransMakeAllCOTSServerListeners: failed to create listener <span style=\"line-height: 1.5; color: #0000ff;\">for<\/span> local<\/pre>\n<p>Cannot establish any listening sockets DCOPServer self-test failed.<\/p>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u5bf9 \u6211\u6765\u8bf4\u8fd9\u4e2a\u9519\u8bef\u4fe1\u606f\u6ca1\u6709\u592a\u591a\u610f\u4e49\uff0c\u53ea\u662f\u4e00\u4e2a\u5bf9KDE\u6765\u8bf4\u81f3\u5173\u91cd\u8981\u7684\u8d1f\u8d23\u8fdb\u7a0b\u95f4\u901a\u4fe1\u7684\u7a0b\u5e8f\u65e0\u6cd5\u542f\u52a8\u3002\u6211\u8fd8\u53ef\u4ee5\u77e5\u9053\u8fd9\u4e2a\u9519\u8bef\u548cICE\u534f\u8bae\uff08Inter Client Exchange\uff09\u6709\u5173\uff0c\u9664\u6b64\u4e4b\u5916\uff0c\u6211\u4e0d\u77e5\u9053\u4ec0\u4e48\u662fKDE\u542f\u52a8\u51fa\u9519\u7684\u539f\u56e0\u3002<strong><br \/><\/strong><\/p>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u6211\u51b3\u5b9a\u91c7\u7528strace\u770b\u4e00\u4e0b\u5728\u542f\u52a8 dcopserver\u65f6\u5230\u5e95\u7a0b\u5e8f\u505a\u4e86\u4ec0\u4e48\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\">strace -f -F -o ~\/dcop-strace.txt dcopserver<\/pre>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u8fd9\u91cc -f -F\u9009\u9879\u544a\u8bc9strace\u540c\u65f6\u8ddf\u8e2afork\u548cvfork\u51fa\u6765\u7684\u8fdb\u7a0b\uff0c-o\u9009\u9879\u628a\u6240\u6709strace\u8f93\u51fa\u5199\u5230~\/dcop-strace.txt\u91cc \u9762\uff0cdcopserver\u662f\u8981\u542f\u52a8\u548c\u8c03\u8bd5\u7684\u7a0b\u5e8f\u3002<\/p>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u518d\u6b21\u51fa\u73b0\u9519\u8bef\u4e4b\u540e\uff0c\u6211\u68c0\u67e5\u4e86\u9519\u8bef\u8f93\u51fa\u6587\u4ef6dcop-strace.txt\uff0c\u6587\u4ef6\u91cc\u6709\u5f88\u591a \u7cfb\u7edf\u8c03\u7528\u7684\u8bb0\u5f55\u3002\u5728\u7a0b\u5e8f\u8fd0\u884c\u51fa\u9519\u524d\u7684\u6709\u5173\u8bb0\u5f55\u5982\u4e0b\uff1a<strong><br \/><\/strong><\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<div class=\"cnblogs_code_toolbar\" style=\"margin-top: 5px;\">&nbsp;<\/div>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\"><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> mkdir(<span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">\/tmp\/.ICE-unix<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>, <span style=\"line-height: 1.5; color: #800080;\">0777<\/span>) = -<span style=\"line-height: 1.5; color: #800080;\">1<\/span> EEXIST (File exists)<br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> lstat64(<span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">\/tmp\/.ICE-unix<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>, {st_mode=S_IFDIR|S_ISVTX|<span style=\"line-height: 1.5; color: #800080;\">0755<\/span>, st_size=<span style=\"line-height: 1.5; color: #800080;\">4096<\/span>, ...}) = <span style=\"line-height: 1.5; color: #800080;\">0<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> unlink(<span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">\/tmp\/.ICE-unix\/dcop27207-1066844596<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>) = -<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> bind(<span style=\"line-height: 1.5; color: #800080;\">3<\/span>, {sin_family=AF_UNIX, path=<span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">\/tmp\/.ICE-unix\/dcop27207-1066844596<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>}, <span style=\"line-height: 1.5; color: #800080;\">38<\/span>) = -<span style=\"line-height: 1.5; color: #800080;\">1<\/span> EACCES (Permission denied) <br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">_KDE_IceTrans<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>, <span style=\"line-height: 1.5; color: #800080;\">13<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">13<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">SocketCreateListener: failed to <\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>..., <span style=\"line-height: 1.5; color: #800080;\">46<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">46<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> close(<span style=\"line-height: 1.5; color: #800080;\">3<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">0<\/span> <span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">_KDE_IceTrans<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>, <span style=\"line-height: 1.5; color: #800080;\">13<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">13<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">SocketUNIXCreateListener: ...Soc<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>..., <span style=\"line-height: 1.5; color: #800080;\">59<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">59<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> umask(<span style=\"line-height: 1.5; color: #800080;\">0<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">0<\/span> <span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">_KDE_IceTrans<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>, <span style=\"line-height: 1.5; color: #800080;\">13<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">13<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">MakeAllCOTSServerListeners: fail<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>..., <span style=\"line-height: 1.5; color: #800080;\">64<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">64<\/span><br \/><span style=\"line-height: 1.5; color: #800080;\">27207<\/span> write(<span style=\"line-height: 1.5; color: #800080;\">2<\/span>, <span style=\"line-height: 1.5; color: #800000;\">\"<\/span><span style=\"line-height: 1.5; color: #800000;\">Cannot establish any listening s<\/span><span style=\"line-height: 1.5; color: #800000;\">\"<\/span>..., <span style=\"line-height: 1.5; color: #800080;\">39<\/span>) = <span style=\"line-height: 1.5; color: #800080;\">39<\/span><\/pre>\n<div class=\"cnblogs_code_toolbar\" style=\"margin-top: 5px;\">&nbsp;<\/div>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: small;\"><br \/><span style=\"line-height: 1.5; font-size: 14px;\">\u5176\u4e2d\u7b2c\u4e00\u884c\u663e\u793a\u7a0b\u5e8f\u8bd5\u56fe\u521b\u5efa\/tmp\/.ICE-unix\u76ee\u5f55\uff0c\u6743\u9650\u4e3a0777\uff0c\u8fd9\u4e2a\u64cd\u4f5c\u56e0\u4e3a\u76ee\u5f55\u5df2\u7ecf\u5b58\u5728\u800c\u5931\u8d25\u4e86\u3002\u7b2c\u4e8c\u4e2a\u7cfb\u7edf\u8c03\u7528\uff08lstat64\uff09\u68c0\u67e5 \u4e86\u76ee\u5f55\u72b6\u6001\uff0c\u5e76\u663e\u793a\u8fd9\u4e2a\u76ee\u5f55\u7684\u6743\u9650\u662f0755\uff0c\u8fd9\u91cc\u51fa\u73b0\u4e86\u7b2c\u4e00\u4e2a\u7a0b\u5e8f\u8fd0\u884c\u9519\u8bef\u7684\u7ebf\u7d22\uff1a\u7a0b\u5e8f\u8bd5\u56fe\u521b\u5efa\u5c5e\u6027\u4e3a0777\u7684\u76ee\u5f55\uff0c\u4f46\u662f\u5df2\u7ecf\u5b58\u5728\u4e86\u4e00\u4e2a\u5c5e\u6027\u4e3a 0755\u7684\u76ee\u5f55\u3002\u7b2c\u4e09\u4e2a\u7cfb\u7edf\u8c03\u7528\uff08unlink\uff09\u8bd5\u56fe\u5220\u9664\u4e00\u4e2a\u6587\u4ef6\uff0c\u4f46\u662f\u8fd9\u4e2a\u6587\u4ef6\u5e76\u4e0d\u5b58\u5728\u3002\u8fd9\u5e76\u4e0d\u5947\u602a\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u64cd\u4f5c\u53ea\u662f\u8bd5\u56fe\u5220\u6389\u53ef\u80fd\u5b58\u5728\u7684\u8001\u6587\u4ef6\u3002<\/span><\/span><\/p>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: 14px;\">\u4f46\u662f\uff0c\u7b2c\u56db\u884c\u786e\u8ba4\u4e86\u9519\u8bef\u6240\u5728\u3002\u4ed6\u8bd5\u56fe\u7ed1\u5b9a\u5230\/tmp\/.ICE-unix\/dcop27207-1066844596\uff0c\u4f46\u662f\u51fa\u73b0\u4e86\u62d2\u7edd\u8bbf\u95ee\u9519\u8bef\u3002. ICE_unix\u76ee\u5f55\u7684\u7528\u6237\u548c\u7ec4\u90fd\u662froot\uff0c\u5e76\u4e14\u53ea\u6709\u6240\u6709\u8005\u5177\u6709\u5199\u6743\u9650\u3002\u4e00\u4e2a\u975eroot\u7528\u6237\u65e0\u6cd5\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u9762\u5efa\u7acb\u6587\u4ef6\uff0c\u5982\u679c\u628a\u76ee\u5f55\u5c5e\u6027\u6539\u62100777\uff0c \u5219\u524d\u9762\u7684\u64cd\u4f5c\u6709\u53ef\u80fd\u53ef\u4ee5\u6267\u884c\uff0c\u800c\u8fd9\u6b63\u662f\u7b2c\u4e00\u6b65\u9519\u8bef\u51fa\u73b0\u65f6\u8fdb\u884c\u8fc7\u7684\u64cd\u4f5c\u3002<\/span><\/p>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: 14px;\">\u6240\u4ee5\u6211\u8fd0\u884c\u4e86chmod 0777 \/tmp\/.ICE-unix\u4e4b\u540eKDE\u5c31\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8\u4e86\uff0c\u95ee\u9898\u89e3\u51b3\u4e86\uff0c\u7528strace\u8fdb\u884c\u8ddf\u8e2a\u8c03\u8bd5\u53ea\u9700\u8981\u82b1\u5f88\u77ed\u7684\u51e0\u5206\u949f\u65f6\u95f4\u8ddf\u8e2a\u7a0b\u5e8f\u8fd0\u884c\uff0c\u7136\u540e\u68c0\u67e5\u5e76\u5206 \u6790\u8f93\u51fa\u6587\u4ef6\u3002<\/span><\/p>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: small;\"><span style=\"line-height: 1.5; font-size: 14px;\">\u8bf4\u660e\uff1a\u8fd0\u884cchmod 0777\u53ea\u662f\u4e00\u4e2a\u6d4b\u8bd5\uff0c\u4e00\u822c\u4e0d\u8981\u628a\u4e00\u4e2a\u76ee\u5f55\u8bbe\u7f6e\u6210\u6240\u6709\u7528\u6237\u53ef\u8bfb\u5199\uff0c\u540c\u65f6\u4e0d\u8bbe\u7f6e\u7c98\u6ede\u4f4d(sticky bit)\u3002\u7ed9\u76ee\u5f55\u8bbe\u7f6e\u7c98\u6ede\u4f4d\u53ef\u4ee5\u963b\u6b62\u4e00\u4e2a\u7528\u6237\u968f\u610f\u5220\u9664\u53ef\u5199\u76ee\u5f55\u4e0b\u9762\u5176\u4ed6\u4eba\u7684\u6587\u4ef6\u3002\u4e00\u822c\u4f60\u4f1a\u53d1\u73b0\/tmp\u76ee\u5f55\u56e0\u4e3a\u8fd9\u4e2a\u539f\u56e0\u8bbe\u7f6e\u4e86\u7c98\u6ede\u4f4d\u3002KDE\u53ef\u4ee5\u6b63\u5e38\u542f\u52a8 \u4e4b\u540e\uff0c\u8fd0\u884cchmod +t \/tmp\/.ICE-unix\u7ed9.ICE_unix\u8bbe\u7f6e\u7c98\u6ede\u4f4d\u3002<\/span><br \/><\/span><\/p>\n<h2 style=\"margin-top: 10px; margin-bottom: 3px; font-size: 18px; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: 14pt;\"><strong>&nbsp; \u89e3\u51b3\u5e93\u4f9d\u8d56\u95ee\u9898<\/strong><\/span><\/h2>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">starce \u7684\u53e6\u4e00\u4e2a\u7528\u5904\u662f\u89e3\u51b3\u548c\u52a8\u6001\u5e93\u76f8\u5173\u7684\u95ee\u9898\u3002\u5f53\u5bf9\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u8fd0\u884cldd\u65f6\uff0c\u5b83\u4f1a\u544a\u8bc9\u4f60\u7a0b\u5e8f\u4f7f\u7528\u7684\u52a8\u6001\u5e93\u548c\u627e\u5230\u52a8\u6001\u5e93\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528\u4e00\u4e2a\u6bd4\u8f83\u8001 \u7684glibc\u7248\u672c\uff082.2\u6216\u66f4\u65e9\uff09\uff0c\u4f60\u53ef\u80fd\u4f1a\u6709\u4e00\u4e2a\u6709bug\u7684ldd\u7a0b\u5e8f\uff0c\u5b83\u53ef\u80fd\u4f1a\u62a5\u544a\u5728\u4e00\u4e2a\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e00\u4e2a\u52a8\u6001\u5e93\uff0c\u4f46\u662f\u771f\u6b63\u8fd0\u884c\u7a0b\u5e8f\u65f6\u52a8\u6001\u8fde\u63a5\u7a0b\u5e8f \uff08\/lib\/ld-linux.so.2\uff09\u5374\u53ef\u80fd\u5230\u53e6\u5916\u4e00\u4e2a\u76ee\u5f55\u53bb\u627e\u52a8\u6001\u8fde\u63a5\u5e93\u3002\u8fd9\u901a\u5e38\u56e0\u4e3a\/etc\/ld.so.conf\u548c \/etc\/ld.so.cache\u6587\u4ef6\u4e0d\u4e00\u81f4\uff0c\u6216\u8005\/etc\/ld.so.cache\u88ab\u7834\u574f\u3002\u5728glibc 2.3.2\u7248\u672c\u4e0a\u8fd9\u4e2a\u9519\u8bef\u4e0d\u4f1a\u51fa\u73b0\uff0c\u53ef\u80fdld-linux\u7684\u8fd9\u4e2abug\u5df2\u7ecf\u88ab\u89e3\u51b3\u4e86\u3002<\/p>\n<p>\u5c3d\u7ba1\u8fd9\u6837\uff0cldd\u5e76\u4e0d\u80fd\u628a\u6240\u6709\u7a0b\u5e8f\u4f9d\u8d56\u7684\u52a8\u6001\u5e93\u5217\u51fa \u6765\uff0c\u7cfb\u7edf\u8c03\u7528dlopen\u53ef\u4ee5\u5728\u9700\u8981\u7684\u65f6\u5019\u81ea\u52a8\u8c03\u5165\u9700\u8981\u7684\u52a8\u6001\u5e93\uff0c\u800c\u8fd9\u4e9b\u5e93\u53ef\u80fd\u4e0d\u4f1a\u88abldd\u5217\u51fa\u6765\u3002\u4f5c\u4e3aglibc\u7684\u4e00\u90e8\u5206\u7684NSS\uff08Name Server Switch\uff09\u5e93\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684\u4f8b\u5b50\uff0cNSS\u7684\u4e00\u4e2a\u4f5c\u7528\u5c31\u662f\u544a\u8bc9\u5e94\u7528\u7a0b\u5e8f\u5230\u54ea\u91cc\u53bb\u5bfb\u627e\u7cfb\u7edf\u5e10\u53f7\u6570\u636e\u5e93\u3002\u5e94\u7528\u7a0b\u5e8f\u4e0d\u4f1a\u76f4\u63a5\u8fde\u63a5\u5230NSS\u5e93\uff0cglibc\u5219\u4f1a\u901a \u8fc7dlopen\u81ea\u52a8\u8c03\u5165NSS\u5e93\u3002\u5982\u679c\u8fd9\u6837\u7684\u5e93\u5076\u7136\u4e22\u5931\uff0c\u4f60\u4e0d\u4f1a\u88ab\u544a\u77e5\u5b58\u5728\u5e93\u4f9d\u8d56\u95ee\u9898\uff0c\u4f46\u8fd9\u6837\u7684\u7a0b\u5e8f\u5c31\u65e0\u6cd5\u901a\u8fc7\u7528\u6237\u540d\u89e3\u6790\u5f97\u5230\u7528\u6237ID\u4e86\u3002\u8ba9\u6211\u4eec\u770b\u4e00\u4e2a\u4f8b\u5b50\uff1a<br \/>whoami\u7a0b\u5e8f\u4f1a\u7ed9\u51fa\u4f60\u81ea\u5df1\u7684\u7528\u6237\u540d\uff0c\u8fd9\u4e2a\u7a0b\u5e8f\u5728\u4e00\u4e9b\u9700\u8981\u77e5\u9053\u8fd0\u884c\u7a0b\u5e8f\u7684\u771f\u6b63\u7528\u6237\u7684\u811a\u672c\u7a0b\u5e8f\u91cc\u9762\u975e\u5e38\u6709\u7528\uff0cwhoami\u7684\u4e00\u4e2a\u793a\u4f8b \u8f93\u51fa\u5982\u4e0b\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\"># whoami<br \/>root<\/pre>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u5047\u8bbe\u56e0\u4e3a\u67d0\u79cd\u539f\u56e0\u5728\u5347 \u7ea7glibc\u7684\u8fc7\u7a0b\u4e2d\u8d1f\u8d23\u7528\u6237\u540d\u548c\u7528\u6237ID\u8f6c\u6362\u7684\u5e93NSS\u4e22\u5931\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u628anss\u5e93\u6539\u540d\u6765\u6a21\u62df\u8fd9\u4e2a\u73af\u5883\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\"># mv \/lib\/libnss_files.so.<span style=\"line-height: 1.5; color: #800080;\">2<\/span> \/lib\/libnss_files.so.<span style=\"line-height: 1.5; color: #800080;\">2<\/span>.backup <br \/># whoami<br \/>whoami: cannot find username <span style=\"line-height: 1.5; color: #0000ff;\">for<\/span> UID <span style=\"line-height: 1.5; color: #800080;\">0<\/span><\/pre>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u8fd9\u91cc\u4f60\u53ef\u4ee5\u770b\u5230\uff0c\u8fd0\u884cwhoami\u65f6\u51fa\u73b0\u4e86\u9519\u8bef\uff0cldd\u7a0b\u5e8f\u7684\u8f93\u51fa\u4e0d\u4f1a\u63d0\u4f9b\u6709\u7528\u7684\u5e2e\u52a9\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\"># ldd \/usr\/bin\/whoami<br \/>libc.so.<span style=\"line-height: 1.5; color: #800080;\">6<\/span> =&gt; \/lib\/libc.so.<span style=\"line-height: 1.5; color: #800080;\">6<\/span> (<span style=\"line-height: 1.5; color: #800080;\">0x4001f000<\/span>)<br \/>\/lib\/ld-linux.so.<span style=\"line-height: 1.5; color: #800080;\">2<\/span> =&gt; \/lib\/ld-linux.so.<span style=\"line-height: 1.5; color: #800080;\">2<\/span> (<span style=\"line-height: 1.5; color: #800080;\">0x40000000<\/span>)<\/pre>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u4f60\u53ea\u4f1a\u770b\u5230whoami\u4f9d\u8d56Libc.so.6\u548cld-linux.so.2\uff0c\u5b83\u6ca1\u6709\u7ed9\u51fa\u8fd0\u884cwhoami\u6240\u5fc5\u987b\u7684\u5176\u4ed6\u5e93\u3002\u8fd9\u91cc\u65f6\u7528strace\u8ddf\u8e2a whoami\u65f6\u7684\u8f93\u51fa\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<div class=\"cnblogs_code_toolbar\" style=\"margin-top: 5px;\">&nbsp;<\/div>\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\">strace -o whoami-strace.txt whoami<\/pre>\n<p>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/i686\/mmx\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>stat64(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/i686\/mmx<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, <span style=\"line-height: 1.5; color: #800080;\">0xbffff190<\/span>) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory) <br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/i686\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>stat64(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/i686<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, <span style=\"line-height: 1.5; color: #800080;\">0xbffff190<\/span>) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/mmx\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>stat64(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/mmx<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, <span style=\"line-height: 1.5; color: #800080;\">0xbffff190<\/span>) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory) <br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>stat64(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/lib<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, {st_mode=S_IFDIR|<span style=\"line-height: 1.5; color: #800080;\">0755<\/span>, st_size=<span style=\"line-height: 1.5; color: #800080;\">2352<\/span>, &#8230;}) = <span style=\"line-height: 1.5; color: #800080;\">0<\/span><br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/usr\/lib\/i686\/mmx\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<br \/>stat64(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/usr\/lib\/i686\/mmx<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, <span style=\"line-height: 1.5; color: #800080;\">0xbffff190<\/span>) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory) <br \/>open(<span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span><span style=\"line-height: 1.5; color: #800000;\">\/usr\/lib\/i686\/libnss_files.so.2<\/span><span style=\"line-height: 1.5; color: #800000;\">&#8220;<\/span>, O_RDONLY) = &#8211;<span style=\"line-height: 1.5; color: #800080;\">1<\/span> ENOENT (No such file or directory)<\/p>\n<div class=\"cnblogs_code_toolbar\" style=\"margin-top: 5px;\">&nbsp;<\/div>\n<\/div>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u4f60\u53ef\u4ee5\u53d1\u73b0\u5728\u4e0d\u540c\u76ee\u5f55\u4e0b\u9762\u67e5\u627elibnss.so.2\u7684\u5c1d\u8bd5\uff0c\u4f46\u662f\u90fd\u5931\u8d25\u4e86\u3002\u5982\u679c\u6ca1\u6709strace\u8fd9\u6837\u7684\u5de5\u5177\uff0c\u5f88\u96be\u53d1\u73b0\u8fd9\u4e2a\u9519\u8bef\u662f\u7531\u4e8e\u7f3a\u5c11\u52a8\u6001\u5e93\u9020\u6210\u7684\u3002\u73b0 \u5728\u53ea\u9700\u8981\u627e\u5230libnss.so.2\u5e76\u628a\u5b83\u653e\u56de\u5230\u6b63\u786e\u7684\u4f4d\u7f6e\u5c31\u53ef\u4ee5\u4e86\u3002\u3000<\/p>\n<h2 style=\"margin-top: 10px; margin-bottom: 3px; font-size: 18px; color: #000000; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\"><span style=\"line-height: 1.5; font-size: 14pt;\"><strong>&nbsp; \u9650\u5236strace\u53ea\u8ddf\u8e2a\u7279\u5b9a\u7684\u7cfb\u7edf\u8c03\u7528<\/strong><\/span><\/h2>\n<p style=\"font-size: 13px; line-height: 1.4; margin: 10px auto; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;\">\u5982\u679c\u4f60\u5df2\u7ecf\u77e5\u9053\u4f60\u8981\u627e\u4ec0\u4e48\uff0c\u4f60\u53ef\u4ee5\u8ba9strace\u53ea\u8ddf\u8e2a\u4e00\u4e9b\u7c7b\u578b\u7684\u7cfb\u7edf\u8c03\u7528\u3002\u4f8b\u5982\uff0c\u4f60\u9700\u8981\u770b\u770b\u5728configure\u811a\u672c\u91cc\u9762\u6267\u884c\u7684\u7a0b\u5e8f\uff0c\u4f60\u9700\u8981\u76d1\u89c6\u7684\u7cfb\u7edf\u8c03 \u7528\u5c31\u662fexecve\u3002\u8ba9strace\u53ea\u8bb0\u5f55execve\u7684\u8c03\u7528\u7528\u8fd9\u4e2a\u547d\u4ee4\uff1a<\/p>\n<div class=\"cnblogs_code\" style=\"background-color: #f5f5f5; font-family: 'Courier New'; font-size: 12px; border: 1px solid #cccccc; padding: 5px; overflow: auto; margin: 5px 0px;\">\n<pre style=\"margin-top: 0px; margin-bottom: 0px; white-space: pre-wrap; font-size: 12px; font-family: 'Courier New';\">strace -f -o configure-strace.txt -e execve .\/configure<\/pre>\n<\/div>\n<p><span style=\"font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;\">&nbsp;<\/span><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>root@ubuntu:\/usr# strace cat \/dev\/null execve(&#8220;\/bin\/cat&#8221;, [&#8220;cat&#8221;, &#8220;\/dev\/null&#8221;], [\/* 22 vars *\/]) = 0 brk(0) = 0xab1000 access(&#8220;\/etc\/ld.so.nohwcap&#8221;, F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f29379a7000 access(&#8220;\/etc\/ld.so.preload&#8221;, R_OK) = -1 ENOENT (No such file or directory) &#8230; brk(0) = 0xab1000 brk(0xad2000) = 0xad2000 fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[],"class_list":["post-410","post","type-post","status-publish","format-standard","hentry","category-centos-6"],"_links":{"self":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/410","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/comments?post=410"}],"version-history":[{"count":0,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/posts\/410\/revisions"}],"wp:attachment":[{"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/categories?post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shan.info\/new\/wp-json\/wp\/v2\/tags?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}