eAccelerator导致apache分段错误

时间:2012-03-07 07:10:06

标签: php apache eaccelerator

我不知道为什么apache子进程会定期退出并出现信号Segmentation fault(11)。

php Version 5.2.5,eAccelerator 0.9.5.3。 在eAccelerator扩展中启用缓存并进行压力测试时,apache始终退出whit错误日志:

[通知]儿童pid 29237退出信号分段故障(11) 有时会出现另一个错误日志:

PHP致命错误:第0行的“未知”中允许的内存大小为134217728字节(尝试分配47645029712760字节)。

使用gdb跟踪分段错误,我得到了上下文:

(gdb) bt
#0  _zend_mm_free_int (heap=0x53c95b0, p=0x2b5538df1f58) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_alloc.c:1944
#1  0x00002b553214e718 in zend_hash_destroy (ht=0x5395ec0) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_hash.c:526
#2  0x00002b553214368f in _zval_dtor_func (zvalue=0x5395e98) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_variables.c:43
#3  0x00002b5532137116 in _zval_ptr_dtor (zval_ptr=0x5395ff0) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_variables.h:35
#4  0x00002b553214e988 in zend_hash_clean (ht=0x5395df0) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_hash.c:552
#5  0x00002b553216435c in zend_do_fcall_common_helper_SPEC (execute_data=0x7fff7210ac30) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_vm_execute.h:255
#6  0x00002b553216382c in execute (op_array=0x5395b18) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend_vm_execute.h:92
#7  0x00002b55321439ad in zend_execute_scripts (type=8, retval=<value optimized out>, file_count=3) at /usr/src/redhat/BUILD/php-5.2.5/Zend/zend.c:1134
#8  0x00002b553210103b in php_execute_script (primary_file=0x7fff7210d100) at /usr/src/redhat/BUILD/php-5.2.5/main/main.c:2005
#9  0x00002b55321c3ba5 in php_handler (r=0x53d7d08) at /usr/src/redhat/BUILD/php-5.2.5/sapi/apache2handler/sapi_apache2.c:631
#10 0x0000000000443c9c in ap_run_handler ()
#11 0x0000000000444541 in ap_invoke_handler ()
#12 0x000000000048336c in ap_process_request ()
#13 0x000000000047ff71 in ap_process_http_connection ()
#14 0x000000000044d2ce in ap_run_process_connection ()
#15 0x000000000044d641 in ap_process_connection ()
#16 0x00000000004a26e7 in child_main ()
#17 0x00000000004a288d in make_child ()
#18 0x00000000004a2aff in perform_idle_server_maintenance ()
#19 0x00000000004a2fe2 in ap_mpm_run ()
#20 0x000000000042a93f in main ()

同样与EA没有任何关系,但是当我在EA中禁用缓存时,同样的工作正常,分段也没有了。

php脚本非常简单:

function test($option = array('dfii12dfdfdfdfdfdf' => 0))
{
     return 'asdfasdfasdfais';
}
echo test();   

在排除测试函数后,zend将释放“$ option”哈希表,此时,分段发生了。

(gdb) p *ht->pListHead 
$8 = {h = 14664090660519840576, nKeyLength = 19, pData = 0x5395f80, pDataPtr = 0x2b5538df1f58, pListNext = 0x0, pListLast = 0x0, pNext = 0x0, pLast = 0x0, arKey = "d"} 

点pDataPtr是无效地址。 我通过pmap检查地址,0x2b5538df1f58映射到/ dev / zero

  

00002b5538def000 131072K rw-s- / dev / zero(已删除)

非常感谢。

0 个答案:

没有答案