Segfault in test suite for ZTS

Issue #10 resolved
Remi Collet
created an issue
$ /usr/bin/zts-php -n -d extension=sockets.so -d extension=/dev/shm/BUILD/php-pecl-ev-0.2.11/ZTS/modules/ev.so tests/03_ev_loop_props.php
Erreur de segmentation (core dumped)

#0  _zend_mm_free_int (heap=0x7fd9eb44f280, p=0x7fd9eb44f528) at /usr/src/debug/php-5.6.0/Zend/zend_alloc.c:2104
2104            if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
(gdb) bt
#0  _zend_mm_free_int (heap=0x7fd9eb44f280, p=0x7fd9eb44f528) at /usr/src/debug/php-5.6.0/Zend/zend_alloc.c:2104
#1  0x00007fd9de8290fd in _zval_dtor (zvalue=<optimized out>) at /usr/include/php-zts/php/Zend/zend_variables.h:35
#2  php_ev_loop_object_ctor (ht=<optimized out>, return_value=0x7fd9e94a9f88, this_ptr=0x0, tsrm_ls=<optimized out>, in_ctor=<optimized out>, is_default_loop=<optimized out>, 
return_value_used=<optimized out>, return_value_ptr=<optimized out>) at /dev/shm/BUILD/php-pecl-ev-0.2.11/ZTS/loop.c:68
#3  0x00007fd9e9736982 in dtrace_execute_internal (execute_data_ptr=0x7fd9e9471388, fci=<optimized out>, return_value_used=<optimized out>, tsrm_ls=<optimized out>)
at /usr/src/debug/php-5.6.0/Zend/zend_dtrace.c:97
#4  0x00007fd9e97fa294 in zend_do_fcall_common_helper_SPEC (execute_data=<optimized out>, tsrm_ls=0x7fd9eb44ebd0) at /usr/src/debug/php-5.6.0/Zend/zend_vm_execute.h:560
#5  0x00007fd9e97886fb in execute_ex (execute_data=0x7fd9e9471388, tsrm_ls=tsrm_ls@entry=0x7fd9eb44ebd0) at /usr/src/debug/php-5.6.0/Zend/zend_vm_execute.h:363
#6  0x00007fd9e973685f in dtrace_execute_ex (execute_data=<optimized out>, tsrm_ls=0x7fd9eb44ebd0) at /usr/src/debug/php-5.6.0/Zend/zend_dtrace.c:73
#7  0x00007fd9e974b3be in zend_execute_scripts (type=type@entry=8, tsrm_ls=tsrm_ls@entry=0x7fd9eb44ebd0, retval=retval@entry=0x0, file_count=file_count@entry=3)
at /usr/src/debug/php-5.6.0/Zend/zend.c:1330
#8  0x00007fd9e96d9938 in php_execute_script (primary_file=primary_file@entry=0x7fffcc1018d0, tsrm_ls=tsrm_ls@entry=0x7fd9eb44ebd0) at /usr/src/debug/php-5.6.0/main/main.c:2584
#9  0x00007fd9e97fc6ed in do_cli (argc=7, argv=0x7fd9eb44e9e0, tsrm_ls=0x7fd9eb44ebd0) at /usr/src/debug/php-5.6.0/sapi/cli/php_cli.c:994
#10 0x00007fd9e95b2eb6 in main (argc=7, argv=0x7fd9eb44e9e0) at /usr/src/debug/php-5.6.0/sapi/cli/php_cli.c:1378

Comments (5)

  1. Remi Collet reporter
    From valgrind
    ==31267== Conditional jump or move depends on uninitialised value(s)
    ==31267==    at 0xFADE0E9: php_ev_loop_object_ctor.isra.8 (zend_variables.h:32)
    ==31267==    by 0x349981: dtrace_execute_internal (zend_dtrace.c:97)
    ==31267==    by 0x40D293: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:560)
    ==31267==    by 0x39B6FA: execute_ex (zend_vm_execute.h:363)
    ==31267==    by 0x34985E: dtrace_execute_ex (zend_dtrace.c:73)
    ==31267==    by 0x35E3BD: zend_execute_scripts (zend.c:1330)
    ==31267==    by 0x2EC937: php_execute_script (main.c:2584)
    ==31267==    by 0x40F6EC: do_cli (php_cli.c:994)
    ==31267==    by 0x1C5EB5: main (php_cli.c:1378)
    ==31267==  Uninitialised value was created by a heap allocation
    ==31267==    at 0x4C28409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==31267==    by 0xFADDFBF: php_ev_loop_object_ctor.isra.8 (loop.c:67)
    ==31267==    by 0x349981: dtrace_execute_internal (zend_dtrace.c:97)
    ==31267==    by 0x40D293: zend_do_fcall_common_helper_SPEC (zend_vm_execute.h:560)
    ==31267==    by 0x39B6FA: execute_ex (zend_vm_execute.h:363)
    ==31267==    by 0x34985E: dtrace_execute_ex (zend_dtrace.c:73)
    ==31267==    by 0x35E3BD: zend_execute_scripts (zend.c:1330)
    ==31267==    by 0x2EC937: php_execute_script (main.c:2584)
    ==31267==    by 0x40F6EC: do_cli (php_cli.c:994)
    ==31267==    by 0x1C5EB5: main (php_cli.c:1378)
    

    Will submit a PR asap

  2. Log in to comment