SEARCH

THIS WEEK'S MOST VIEWED ARTICLES

Segmentation fault eAccelerator + cPanel + PHP 5.2.x
admin
22.08.2013

If it happens to get a segmentation fault error in error_log

[notice] child pid XXXX exit signal Segmentation fault (11)

Even if we use DSO or FCGI mode but it works if you disable the eAccelerator extension in php.ini, try this:

nano /usr/local/lib/php.ini

and change this setting to be:

eaccelerator.optimizer="0" 

and restart Apache.

To debug the segmentation fault you can do this. Attach GDB to one of the child processes of Apache:

gdb --pid=12345 # (or whatever the number is as found through ps)

I then had the process continue to run:

continue

Then refresh a URL until it caused the segfault. Ask gdb for a backtrace:

Program received signal SIGSEGV, Segmentation fault.
_zend_mm_realloc_int (heap=0x1f1a9d0, p=0x3, size=9) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_alloc.c:2010
2010 orig_size = ZEND_MM_BLOCK_SIZE(mm_block);
(gdb) bt
#0 _zend_mm_realloc_int (heap=0x1f1a9d0, p=0x3, size=9) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_alloc.c:2010
#1 0x00007f59ec5da1a2 in optimize_bb (bb=0x7fffa29ece10, op_array=0x22d5cd0, global=0x7fffa29eca90 "", pass=0) at /home/cpeasyapache/src/eaccelerator/optimize.c:2202
#2 0x00007f59ec5dd916 in eaccelerator_optimize (op_array=<value optimized out>) at /home/cpeasyapache/src/eaccelerator/optimize.c:3705
#3 0x00007f59f05372b1 in zend_llist_apply_with_argument (l=<value optimized out>, func=0x7f59f05379e0 <zend_extension_op_array_handler>, arg=0x22d5cd0)
at /home/cpeasyapache/src/php-5.2.17/Zend/zend_llist.c:236
#4 0x00007f59f0537dee in pass_two (op_array=0x22d5cd0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_opcode.c:374
#5 0x00007f59f052f606 in zend_do_end_function_declaration (function_token=0x7fffa29ed610) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_compile.c:1281
#6 0x00007f59f051ea2d in zendparse () at /home/cpeasyapache/src/php-5.2.17/Zend/zend_language_parser.c:3368
#7 0x00007f59f0523a39 in compile_file (file_handle=0x7fffa29f09b0, type=<value optimized out>) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_language_scanner.c:3420
#8 0x00007f59ec5d194e in eaccelerator_compile_file (file_handle=0x7fffa29f09b0, type=8) at /home/cpeasyapache/src/eaccelerator/eaccelerator.c:1290
#9 0x00007f59f0567f13 in ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER (execute_data=0x7fffa29f0ad0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:2058
#10 0x00007f59f056414c in execute (op_array=0x2236698) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:92
#11 0x00007f59f0567885 in ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER (execute_data=0x7fffa29f0d80) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:20302
#12 0x00007f59f056414c in execute (op_array=0x22cebb0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:92
#13 0x00007f59f0577a7e in zend_do_fcall_common_helper_SPEC (execute_data=0x7fffa29f0ff0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:234
#14 0x00007f59f056414c in execute (op_array=0x22cc200) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:92
#15 0x00007f59f0577a7e in zend_do_fcall_common_helper_SPEC (execute_data=0x7fffa29f1210) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:234
#16 0x00007f59f056414c in execute (op_array=0x22cc0a0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:92
#17 0x00007f59f0577a7e in zend_do_fcall_common_helper_SPEC (execute_data=0x7fffa29f1420) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:234
#18 0x00007f59f056414c in execute (op_array=0x22360a0) at /home/cpeasyapache/src/php-5.2.17/Zend/zend_vm_execute.h:92
#19 0x00007f59f0540837 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/cpeasyapache/src/php-5.2.17/Zend/zend.c:1134
#20 0x00007f59f04fd378 in php_execute_script (primary_file=0x7fffa29f3890) at /home/cpeasyapache/src/php-5.2.17/main/main.c:2037
#21 0x00007f59f05b4d35 in php_handler (r=0x22b24f0) at /home/cpeasyapache/src/php-5.2.17/sapi/apache2handler/sapi_apache2.c:639
#22 0x000000000044b3a2 in ap_run_handler ()
#23 0x000000000044bcaf in ap_invoke_handler ()
#24 0x00000000004c39e5 in ap_process_request ()
#25 0x00000000004c063a in ap_process_http_connection ()
#26 0x0000000000454e6f in ap_run_process_connection ()
#27 0x0000000000455320 in ap_process_connection ()
#28 0x00000000004ec60d in child_main ()
#29 0x00000000004ec7f2 in make_child ()
#30 0x00000000004ec86b in startup_children ()
#31 0x00000000004ecd8e in ap_mpm_run ()
#32 0x0000000000430a29 in main ()

 

This is relevant for …

cPanel, Apache, Linux, eaccelerator

Post a comment