怎样调查Linux服务进程的崩溃问题

By admin, 8 一月, 2016

如果运气好,服务进程崩溃会弹窗通知,并在/var/crash目录留下log,此时可以参考:怎样分析Linux里/var/crash目录下的文件

如果没有留下崩溃的log,又知道重现方法,那么可以使用gdb attach进程。

gdb <进程运行文件> -p <进程ID>

attach之后,按c继续让进程运行,然后让其崩溃,这是就可以拿到崩溃的堆栈调查代码。

如果gdb attach进程的时候出现“ptrace: 不允许的操作.”或“ptrace: Operation not permitted.”,那么可以用sudo运行解决。

评论

Restricted HTML

  • 允许的HTML标签:<a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id> <img src>
  • 自动断行和分段。
  • 网页和电子邮件地址自动转换为链接。
验证码
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
请输入"Drupal10"