phacility / xhprof

XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based user interface.
http://pecl.php.net/package/xhprof
Apache License 2.0
2.6k stars 925 forks source link

seg fault in zif_current #101

Closed michbsd closed 6 years ago

michbsd commented 6 years ago

Hi,

xhprof: 0.9.4 php: 5.6 OS: FreeBSD 10.x

After the "xhprof_enable(XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);" - I get SIGSEGV (signal)

Attaching a debugger (unfortunately without symbols) I see:

Program received signal SIGSEGV, Segmentation fault.
0x00000000004ac204 in zif_current ()
(gdb) bt
#0  0x00000000004ac204 in zif_current ()
#1  0x0000000808bae832 in hp_execute_internal () from /usr/local/lib/php/20131226/xhprof.so
#2  0x00000000005f2ff6 in zend_do_fcall_common_helper_SPEC ()
#3  0x00000000005b4288 in execute_ex ()
#4  0x0000000808bae3d9 in hp_execute_ex () from /usr/local/lib/php/20131226/xhprof.so
#5  0x00000000005f32ca in zend_do_fcall_common_helper_SPEC ()
#6  0x00000000005b4288 in execute_ex ()
#7  0x0000000808bae3d9 in hp_execute_ex () from /usr/local/lib/php/20131226/xhprof.so
#8  0x00000000005f32ca in zend_do_fcall_common_helper_SPEC ()
#9  0x00000000005b4288 in execute_ex ()
#10 0x000000000057f1cc in zend_call_function ()
#11 0x00000000004b6404 in zif_call_user_func_array ()
#12 0x00000000005f3104 in zend_do_fcall_common_helper_SPEC ()
#13 0x00000000005b4288 in execute_ex ()
#14 0x000000000057f1cc in zend_call_function ()
#15 0x00000000004b6404 in zif_call_user_func_array ()
#16 0x00000000005f3104 in zend_do_fcall_common_helper_SPEC ()
#17 0x00000000005b4288 in execute_ex ()
#18 0x000000000058c223 in zend_execute_scripts ()
#19 0x0000000000533c33 in php_execute_script ()
#20 0x0000000000617af9 in main ()

Not quite sure if this is a known issue?

thanks,

michbsd commented 6 years ago

Setting XHPROF_FLAGS_NO_BUILTINS is solving the issue...

michbsd commented 6 years ago

Could this be it : https://github.com/phacility/xhprof/commit/55a47c0d8ffeea4b84133fd21103caa816676b5d

michbsd commented 6 years ago

This patch fixed it for me : https://github.com/QafooLabs/php-profiler-extension/commit/16b3ae28b2558f99461325db4c4d3032db9e3746