【问题标题】:apache2 seg fault: cannot find causeapache2 段错误:找不到原因
【发布时间】:2012-03-18 09:01:27
【问题描述】:

我在 ubuntu 10.04 lts 上不断收到此日志条目:

# vim /var/log/apache2/error.log

[Sun Mar 18 08:58:01 2012] [notice] child pid 4300 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:02 2012] [notice] child pid 4302 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:03 2012] [notice] child pid 4303 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:03 2012] [notice] child pid 4304 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:04 2012] [notice] child pid 4305 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:04 2012] [notice] child pid 4306 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:04 2012] [notice] child pid 4307 exit signal Segmentation fault (11)
[Sun Mar 18 08:58:04 2012] [notice] child pid 4308 exit signal Segmentation fault (11)

我在我的 httpd.conf 中添加了核心转储:

CoreDumpDirectory /tmp/apache2-gdb-dump

创建,chmod 777 和 chown www-data:www-data tmp/apache2-dgb-dump,设置

# ulimit -c unlimited

并重新启动 apache。 创建了 Coredump,我尝试对其进行分析,但它没有告诉我任何信息...:

# gdb /etc/init.d/apache2 core
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
"/etc/init.d/apache2": not in executable format: File format not recognized
[New Thread 7968]
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f78121f36ad in ?? ()
(gdb) where
#0  0x00007f78121f36ad in ?? ()
#1  0x00007f7800000002 in ?? ()
#2  0x00007f78044af088 in ?? ()
#3  0x00007f7815e86080 in ?? ()
#4  0x00007f7816e5b5e8 in ?? ()
#5  0x00007f7816ed2a10 in ?? ()
#6  0x00007f7815e86080 in ?? ()
#7  0x00007f7815e86080 in ?? ()
#8  0x00007f78129058c0 in ?? ()
#9  0x00007f7816ed2a10 in ?? ()
#10 0x00007f781223614c in ?? ()
#11 0x00007f7815e86080 in ?? ()
#12 0x00007f7812235ee0 in ?? ()
#13 0x0000000000000006 in ?? ()
#14 0x00007f7816a251d0 in ?? ()
#15 0x00007f7816d38a40 in ?? ()
#16 0x01007fff69cdd3c0 in ?? ()
#17 0x00007fff69cdd3c0 in ?? ()
#18 0x00007f78129058c0 in ?? ()
#19 0x00007fff69cdd3c0 in ?? ()
#20 0x0000000000000001 in ?? ()
#21 0x0000000000000000 in ?? ()

我该怎么做才能找出问题所在?

【问题讨论】:

  • 您必须为您的 apache 创建一个调试版本,或者,如果您使用数据包安装了 apache,请安装您的发行版的 apache-debug 包。编辑:我刚刚读到您正在使用 ubuntu。我想包的名字是apache2-dbg

标签: apache2 gdb segmentation-fault


【解决方案1】:

您以错误的方式调用 gdb。根据 gdb 输出,核心转储是由/usr/sbin/apache2 生成的。你应该像这样运行 gdb:gdb /usr/sbin/apache2 core/etc/init.d/apache2 很可能是某个调用 /usr/sbin/apache2 的脚本。查看 gdb 输出:

"/etc/init.d/apache2": not in executable format: File format not recognized
[New Thread 7968]
Core was generated by `/usr/sbin/apache2 -k start'.
Program terminated with signal 11, Segmentation fault.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-09-24
    • 2012-02-29
    • 1970-01-01
    • 2019-03-20
    • 1970-01-01
    • 1970-01-01
    • 2015-04-08
    相关资源
    最近更新 更多