Apache の子プロセスが定期的にシグナル Segmentation fault (11) で終了する理由がわかりません。
php バージョン 5.2.5、eAccelerator 0.9.5.3。 eAccelerator 拡張機能でキャッシングを有効にしてストレス テストを実行すると、Apache は常にエラー ログとともに終了します。
[通知] child pid 29237 exit signal Segmentation fault (11) 別のエラーログが時々あります:
PHP 致命的なエラー: 行 0 の不明で、134217728 バイトの許容メモリ サイズを使い果たしました (47645029712760 バイトを割り当てようとしました)。</p>
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 でキャッシングを無効にすると、正常に動作し、セグメンテーションが消えました。</p>
PHP スクリプトは非常に単純です。
function test($option = array('dfii12dfdfdfdfdfdf' => 0))
{
return 'asdfasdfasdfais';
}
echo test();
テスト関数を実行した後、zend は "$option" ハッシュ テーブルを解放します。その時点で、セグメンテーションが発生しました。</p>
(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 (削除済み)
どうもありがとう。</p>