利用strace诊断程序错误
来源:互联网 发布:windows netstat 编辑:程序博客网 时间:2024/05/22 17:27
最近在调试程序的时候接触到了strace这个工具。strace是一个十分强大的调试/分析/诊断工具,这里有一篇详细的介绍。
今天在配置lighty + web.py的时候遇到了问题,按照http://webpy.org/cookbook/fastcgi-lighttpd/进行配置后lighty无法正常启动,从lighty的error log看是加载处理fcgi的python模块时出了问题,但是不知道具体原因。尝试了几次以后决定用strace试一试:
sudo strace -fF /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -o log
从strace的输出里看到了这样的错误:
[pid 3125] write(2, "ImportError", 11) = 11
[pid 3125] write(2, ": ", 2) = 2
[pid 3125] write(2, "No module named flup.server.fcgi", 32) = 32
[pid 3125] write(2, "/n", 1) = 1
[pid 3125] rt_sigaction(SIGINT, {SIG_DFL, [], 0}, {0x810fde0, [], 0}, 8) = 0
[pid 3125] exit_group(1) = ?
Process 3125 detached
这样原因就清楚了,没有装python-flup,sudo apt-get install python-flup后重启lighty,一切ok。strace小试牛刀 :)
- 利用strace诊断程序错误
- 利用strace 调试程序
- Linux问题诊断工具strace
- Linux strace 诊断问题 【转】
- Linux strace 诊断问题 【转】
- 错误注入和程序诊断技术研究
- 利用strace ltrace或truss跟踪程序的系统调用
- 利用pstack 和 strace分析程序在哪里耗时?
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- 自助Linux之问题诊断工具strace
- VC下遍历文件夹查找文件
- 读高质量C++编程指南
- The System Server in Android
- Servlet生命周期
- The init process and init.rc
- 利用strace诊断程序错误
- My first research experience...and tips
- NTKO Word在线编辑器
- NSString 转换 NSdate
- A closer look at the Android project build system part I
- 对话框中WaitForSingleObject等待线程退出导致程序阻塞的原因及解决
- redhat 配置yum源
- 冒个泡。
- 在linux中处理php上传问题