"[notice] child pid XXXX退出信号分段错误(11)"在apache error.log中

mgP*_*ePe 94 php apache error-logging cakephp

我正在使用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)
Run Code Online (Sandbox Code Playgroud)

这是什么分段错误,我该如何解决?

更新:

PHP Version 5.3.4, OSX local development
Server version: Apache/2.2.17 (Unix)
CakePhp: 1.3.10
Run Code Online (Sandbox Code Playgroud)

Mat*_*man 63

将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
Run Code Online (Sandbox Code Playgroud)

...

现在将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.
Run Code Online (Sandbox Code Playgroud)

等待崩溃...然后:

(gdb) backtrace
Run Code Online (Sandbox Code Playgroud)

要么

(gdb) backtrace full
Run Code Online (Sandbox Code Playgroud)

应该给你一些线索是什么.如果您提交错误报告,则应包含回溯.

如果崩溃很难重现,那么将Apache配置为仅使用一个子进程来处理请求可能是个好主意.配置是这样的:

StartServers 1
MinSpareServers 1
MaxSpareServers 1
Run Code Online (Sandbox Code Playgroud)

  • 找到解决方案:调用```set follow-fork-mode child```然后附加到父进程(生成子进程的进程) - > http://stackoverflow.com/questions/15126925/gdb-debugging柴尔德 - 处理 - 后叉跟踪叉模式儿童configured0 (2认同)

phi*_*hag 20

分段错误是php中的内部错误(或者,不太可能是apache).通常,分段错误是由较新的和较少测试的php模块之一引起的,例如imagemagick或subversion.

尝试禁用所有非必要模块(in php.ini),然后逐个重新启用它们,直到发生错误.您可能还想更新php和apache.

如果这没有用,你应该报告一个php bug.


Way*_*yne 16

你试过在php.ini中增加output_buffering吗?

"zend_mm_heap corrupted"是什么意思

  • 在更新后,我在使用apache/php/mysql进行debian压缩时遇到了同样的问题.我把它设置为`output_buffering = 4096`,现在页面再次工作.谢谢 (4认同)
  • 而对我来说,只有`output_buffering = 8192`有效.非常感谢! (3认同)
  • 现在,在另一页上,“ output_buffering = 8192”会导致段错误,该错误已通过将“ output_buffering = Off”设置来解决。我很困惑。 (2认同)
  • 几年后,但对于像我一样偶然发现这一点的其他人......我发现关闭服务器的输出缓冲,然后使用 htaccess 文件进行基于目录或文件的编辑是可行的方法。输出缓冲确定在发布给用户之前保留多少数据。对于小单行,这可能会导致错误。在较大的文件中,您可能会面临进程超载的风险。 (2认同)