Skip to content

Instantly share code, notes, and snippets.

@thekid
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save thekid/31d9f2b8d756565c9c11 to your computer and use it in GitHub Desktop.

Select an option

Save thekid/31d9f2b8d756565c9c11 to your computer and use it in GitHub Desktop.
phpng Segmentation Faults
(gdb) run -C -q -dinclude_path=".:/home/friebe/xp/xp-framework/core::." -dmagic_quotes_gpc=0 -ddate.timezone="Europe/Berlin" /home/friebe/xp/xp-framework/core/tools/class.php xp.unittest.Runner src/test/config/unittest/core.ini
Starting program: /home/friebe/devel/php-src/sapi/cli/php -C -q -dinclude_path=".:/home/friebe/xp/xp-framework/core::." -dmagic_quotes_gpc=0 -ddate.timezone="Europe/Berlin" /home/friebe/xp/xp-framework/core/tools/class.php xp.unittest.Runner src/test/config/unittest/core.ini
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[........................................................................
.........................................................................
.........................................................................
..............................................................NNNNN......
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.........................................................................
.......................................
Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x555555d5a630, size=28) at /home/friebe/devel/php-src/Zend/zend_alloc.c:1911
1911 heap->cache[index] = best_fit->prev_free_block;
(gdb) p index
$1 = 2
(gdb) p heap
$2 = (zend_mm_heap *) 0x555555d5a630
(gdb) p heap->cache
$3 = {0x0, 0x555555fb1ef0, 0x7fffef7addb800, 0x7fffef6c9db8, 0x0, 0x7fffef644140, 0x555555f9f108, 0x7fffef80c9c0,
0x555555ff7cf0, 0x555555f5c528, 0x55555602db50, 0x555555ff1730, 0x7fffef5cc9c0, 0x7fffef735fa0, 0x0, 0x0,
0x5555560a28a0, 0x0, 0x7fffefc7c5f8, 0x7fffef66c360, 0x0, 0x0, 0x0, 0x0, 0x555556002bd0, 0x7fffef84cbb8,
0x7fffef98bfe0, 0x0, 0x55555609eb40, 0x7fffefada4f0, 0x55555602e458, 0x555556067f38, 0x7fffef846940,
0x5555560d2ca0, 0x555555fdb020, 0x0, 0x55555601c0b8, 0x555555fa1798, 0x7fffefb152d8, 0x7fffef5ef7c0, 0x0, 0x0,
0x555555f704a0, 0x7fffefc10258, 0x7fffef695488, 0x0, 0x7ffff7e4f588, 0x55555607af40, 0x555556088f40,
0x7fffef819440, 0x7fffef83e2a8, 0x0, 0x5555560a02c0, 0x7fffefb76350, 0x0, 0x5555560746b8, 0x7fffeff34358,
0x555555f94d40, 0x555555f7bd58, 0x0, 0x555555f8ee48, 0x7fffefea16c8, 0x0, 0x555555f00eb8}
(gdb) p best_git
No symbol "best_git" in current context.
(gdb) p best_fit
$4 = (zend_mm_free_block *) 0x7fffef7addb800
(gdb) p best_fit->prev_free_block
Cannot access memory at address 0x7fffef7addb810
(gdb) bt
#0 _zend_mm_alloc_int (heap=0x555555d5a630, size=28) at /home/friebe/devel/php-src/Zend/zend_alloc.c:1911
#1 0x00005555558e848d in zend_str_alloc (persistent=<optimized out>, len=7)
at /home/friebe/devel/php-src/Zend/zend_string.h:112
#2 zend_str_init (persistent=<optimized out>, len=7, str=0x555555a292f7 "termsig")
at /home/friebe/devel/php-src/Zend/zend_string.h:148
#3 _zend_hash_str_add_or_update (ht=0x7fffef5b16b8, str=0x555555a292f7 "termsig", len=7,
pData=pData@entry=0x7fffffff9f20, flag=flag@entry=1) at /home/friebe/devel/php-src/Zend/zend_hash.c:310
#4 0x00005555558dc470 in zend_symtable_str_update (pData=0x7fffffff9f20, len=<optimized out>, str=<optimized out>,
ht=<optimized out>) at /home/friebe/devel/php-src/Zend/zend_hash.h:338
#5 add_assoc_long_ex (arg=arg@entry=0x7ffff7f2c3a8, key=key@entry=0x555555a292f7 "termsig",
key_len=key_len@entry=7, n=n@entry=0) at /home/friebe/devel/php-src/Zend/zend_API.c:1342
#6 0x000055555584c823 in zif_proc_get_status (param_count=<optimized out>, return_value=0x7ffff7f2c3a8)
at /home/friebe/devel/php-src/ext/standard/proc_open.c:392
#7 0x000055555598336a in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7f2c058)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:586
#8 0x00005555559106af in execute_ex (execute_data=0x7ffff7f2c058)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:358
#9 0x00005555558c433b in zend_call_function (fci=fci@entry=0x7fffffffa240, fci_cache=<optimized out>,
fci_cache@entry=0x7fffffffa210) at /home/friebe/devel/php-src/Zend/zend_execute_API.c:863
#10 0x000055555578d3c5 in zim_reflection_method_invokeArgs (param_count=<optimized out>, return_value=0x7ffff7f2b8e8)
at /home/friebe/devel/php-src/ext/reflection/php_reflection.c:2997
#11 0x000055555598336a in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7f2b348)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:586
#12 0x00005555559106af in execute_ex (execute_data=0x7ffff7f2b348)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:358
#13 0x00005555558c433b in zend_call_function (fci=fci@entry=0x7fffffffa560, fci_cache=<optimized out>,
fci_cache@entry=0x7fffffffa530) at /home/friebe/devel/php-src/Zend/zend_execute_API.c:863
#14 0x000055555578d3c5 in zim_reflection_method_invokeArgs (param_count=<optimized out>, return_value=0x7ffff7f27b38)
at /home/friebe/devel/php-src/ext/reflection/php_reflection.c:2997
#15 0x000055555598336a in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7f27598)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:586
#16 0x00005555559106af in execute_ex (execute_data=0x7ffff7f27598)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:358
#17 0x00005555558d9802 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0,
file_count=file_count@entry=3) at /home/friebe/devel/php-src/Zend/zend.c:1308
#18 0x00005555558647e6 in php_execute_script (primary_file=primary_file@entry=0x7fffffffcae0)
at /home/friebe/devel/php-src/main/main.c:2549
#19 0x0000555555985475 in do_cli (argc=9, argv=0x555555d5a0d0) at /home/friebe/devel/php-src/sapi/cli/php_cli.c:980
#20 0x00005555556363fa in main (argc=9, argv=0x555555d5a0d0) at /home/friebe/devel/php-src/sapi/cli/php_cli.c:1359
(gdb) run -C -q -dinclude_path=".:/home/friebe/xp/xp-framework/core::." -dmagic_quotes_gpc=0 -ddate.timezone="Europe/Berlin" /home/friebe/xp/xp-framework/core/tools/class.php xp.unittest.Runner src/test/config/unittest/remote.ini
Starting program: /home/friebe/devel/php-src/sapi/cli/php -C -q -dinclude_path=".:/home/friebe/xp/xp-framework/core::." -dmagic_quotes_gpc=0 -ddate.timezone="Europe/Berlin" /home/friebe/xp/xp-framework/core/tools/class.php xp.unittest.Runner src/test/config/unittest/remote.ini
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[........................................................................
..............
Program received signal SIGSEGV, Segmentation fault.
_zend_mm_alloc_int (heap=0x555555d5a630, size=29) at /home/friebe/devel/php-src/Zend/zend_alloc.c:1911
1911 heap->cache[index] = best_fit->prev_free_block;
(gdb) p index
$1 = 2
(gdb) p heap
$2 = (zend_mm_heap *) 0x555555d5a630
(gdb) p heap->cache
$3 = {0x555555facae8, 0x7fffefea5138, 0x555555fb09e000, 0x0, 0x555555fbc660, 0x555555f830d0, 0x7fffefc5e6a0, 0x0,
0x555555f862b0, 0x0, 0x555555fbac50, 0x555555fbc898, 0x555555f81f20, 0x0, 0x0, 0x0, 0x555555fabfe8,
0x555555fbc748, 0x555555fbcba8, 0x555555f7fe98, 0x0, 0x0, 0x555555fb0a10, 0x0, 0x0, 0x0, 0x0, 0x555555fb0ae0,
0x555555f9cea8, 0x7fffefe94aa8, 0x7fffefeb34a0, 0x555555f81670, 0x0, 0x555555fb4c48, 0x555555fbb908,
0x555555fab490, 0x555555fab5c8, 0x0, 0x555555fabad8, 0x0, 0x555555eb72d0, 0x0, 0x0, 0x7fffefc7ca30, 0x0, 0x0,
0x555555e94d00, 0x0, 0x0, 0x0, 0x555555fabc28, 0x0, 0x555555faafd8, 0x0, 0x555555eb8a30, 0x0, 0x555555e97a38, 0x0,
0x7fffeff58408, 0x0, 0x0, 0x0, 0x555555fabdd8, 0x0}
(gdb) p best_fit
$4 = (zend_mm_free_block *) 0x555555fb09e000
(gdb) p best_fit->prev_free_block
Cannot access memory at address 0x555555fb09e010
(gdb) bt
#0 _zend_mm_alloc_int (heap=0x555555d5a630, size=29) at /home/friebe/devel/php-src/Zend/zend_alloc.c:1911
#1 0x00005555558e848d in zend_str_alloc (persistent=<optimized out>, len=8)
at /home/friebe/devel/php-src/Zend/zend_string.h:112
#2 zend_str_init (persistent=<optimized out>, len=8, str=0x555555a09e42 "function")
at /home/friebe/devel/php-src/Zend/zend_string.h:148
#3 _zend_hash_str_add_or_update (ht=0x7fffefa1c9f8, str=str@entry=0x555555a09e42 "function", len=len@entry=8,
pData=pData@entry=0x7fffffffa150, flag=flag@entry=1) at /home/friebe/devel/php-src/Zend/zend_hash.c:310
#4 0x00005555558dcd2c in zend_symtable_str_update (pData=0x7fffffffa150, len=8, str=0x555555a09e42 "function",
ht=<optimized out>) at /home/friebe/devel/php-src/Zend/zend_hash.h:338
#5 add_assoc_string_ex (arg=arg@entry=0x7fffffffa200, key=key@entry=0x555555a09e42 "function",
key_len=key_len@entry=8, str=0x7fffefb274f4 "afterTestClass") at /home/friebe/devel/php-src/Zend/zend_API.c:1402
#6 0x00005555558f25e4 in zend_fetch_debug_backtrace (return_value=return_value@entry=0x7fffffffa280,
skip_last=<optimized out>, skip_last@entry=0, options=options@entry=0, limit=limit@entry=0)
at /home/friebe/devel/php-src/Zend/zend_builtin_functions.c:2248
#7 0x00005555558fb85c in zend_default_exception_new_ex (class_type=<optimized out>, skip_top_traces=0)
at /home/friebe/devel/php-src/Zend/zend_exceptions.c:162
#8 0x00005555558dc26a in _object_and_properties_init (arg=arg@entry=0x7fffffffa310, class_type=0x7ffff7e289a0,
properties=properties@entry=0x0) at /home/friebe/devel/php-src/Zend/zend_API.c:1312
#9 0x00005555558dc33d in _object_init_ex (arg=arg@entry=0x7fffffffa310, class_type=<optimized out>)
at /home/friebe/devel/php-src/Zend/zend_API.c:1320
#10 0x00005555559517f1 in ZEND_NEW_SPEC_HANDLER (execute_data=0x7ffff7f2a3a8)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:964
#11 0x00005555559106af in execute_ex (execute_data=0x7ffff7f2a3a8)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:358
#12 0x00005555558c433b in zend_call_function (fci=fci@entry=0x7fffffffa560, fci_cache=<optimized out>,
fci_cache@entry=0x7fffffffa530) at /home/friebe/devel/php-src/Zend/zend_execute_API.c:863
#13 0x000055555578d3c5 in zim_reflection_method_invokeArgs (param_count=<optimized out>, return_value=0x7ffff7f27b38)
at /home/friebe/devel/php-src/ext/reflection/php_reflection.c:2997
#14 0x000055555598336a in zend_do_fcall_common_helper_SPEC (execute_data=0x7ffff7f27598)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:586
#15 0x00005555559106af in execute_ex (execute_data=0x7ffff7f27598)
at /home/friebe/devel/php-src/Zend/zend_vm_execute.h:358
#16 0x00005555558d9802 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0,
file_count=file_count@entry=3) at /home/friebe/devel/php-src/Zend/zend.c:1308
#17 0x00005555558647e6 in php_execute_script (primary_file=primary_file@entry=0x7fffffffcae0)
at /home/friebe/devel/php-src/main/main.c:2549
#18 0x0000555555985475 in do_cli (argc=9, argv=0x555555d5a0d0) at /home/friebe/devel/php-src/sapi/cli/php_cli.c:980
#19 0x00005555556363fa in main (argc=9, argv=0x555555d5a0d0) at /home/friebe/devel/php-src/sapi/cli/php_cli.c:1359
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment