我正在使用 Apache/PHP/MySQL 堆栈。
作为框架使用 CakePHP。
我时不时地得到一个空白的白页。我无法通过 Cake 调试它,所以我查看了 apache error.log,这是我得到的:
[Wed Oct 12 15:27:23 2011] [notice] child pid 3580 exit signal Segmentation fault (11)
[Wed Oct 12 15:27:34 2011] [notice] child pid 3581 exit signal Segmentation fault (11)
[Wed Oct 12 15:30:52 2011] [notice] child pid 3549 exit signal Segmentation fault (11)
[Wed Oct 12 16:04:27 2011] [notice] child pid 3579 exit signal Segmentation fault (11)
zend_mm_heap corrupted
[Wed Oct 12 16:26:24 2011] [notice] child pid 3625 exit signal Segmentation fault (11)
[Wed Oct 12 17:57:24 2011] [notice] child pid 3577 exit signal Segmentation fault (11)
[Wed Oct 12 17:58:54 2011] [notice] child pid 3550 exit signal Segmentation fault (11)
[Wed Oct 12 17:59:52 2011] [notice] child pid 3578 exit signal Segmentation fault (11)
[Wed Oct 12 18:01:38 2011] [notice] child pid 3683 exit signal Segmentation fault (11)
[Wed Oct 12 22:20:53 2011] [notice] child pid 3778 exit signal Segmentation fault (11)
[Wed Oct 12 22:29:51 2011] [notice] child pid 3777 exit signal Segmentation fault (11)
[Wed Oct 12 22:33:42 2011] [notice] child pid 3774 exit signal Segmentation fault (11)
什么是段错误,我该如何解决?
更新:
PHP Version 5.3.4, OSX local development
Server version: Apache/2.2.17 (Unix)
CakePhp: 1.3.10
最佳答案
将 gdb 附加到 httpd 子进程之一并重新加载或继续工作并等待崩溃,然后查看回溯。做这样的事情:
$ ps -ef|grep httpd
0 681 1 0 10:38pm ?? 0:00.45 /Applications/MAMP/Library/bin/httpd -k start
501 690 681 0 10:38pm ?? 0:00.02 /Applications/MAMP/Library/bin/httpd -k start
...
现在将 gdb 附加到其中一个子进程,在本例中为 PID 690(列是 UID、PID、PPID...)
$ sudo gdb
(gdb) attach 690
Attaching to process 690.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ....................... done
0x9568ce29 in accept$NOCANCEL$UNIX2003 ()
(gdb) c
Continuing.
等待崩溃...然后:
(gdb) backtrace
或者
(gdb) backtrace full
应该给你一些线索是怎么回事。如果您提交错误报告,则应包括回溯。
如果崩溃难以重现,最好将 Apache 配置为仅使用一个子进程来处理请求。配置是这样的:
StartServers 1
MinSpareServers 1
MaxSpareServers 1
关于php - apache error.log 中的 "[notice] child pid XXXX exit signal Segmentation fault (11)",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7745578/