MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001583XdebugFeature/Change requestpublic2018-10-25 11:272018-10-25 14:13
Reporterkmdm 
Assigned Toderick 
PriorityhighSeveritycrashReproducibilityhave not tried
StatusassignedResolutionopen 
PlatformLinuxOSDebianOS Version7
Product Version2.7.0beta1 
Target VersionFixed in Version 
Summary0001583: xdebug 2.7.0beta1 SIGSEGV while running some php scripts on PHP 7.3.0RC3
DescriptionThe segfault occurs when running certain scripts in our codebase, I've attached the gdb backtrace.
Steps To ReproduceN/A -- pending test case script which can trigger the issue
Additional InformationProgram received signal SIGSEGV, Segmentation fault.
zval_addref_p (pz=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_types.h:1017
1017 /build/php7.3-7.3.0~rc3/Zend/zend_types.h: No such file or directory.
(gdb) bt
#0 zval_addref_p (pz=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_types.h:1017
#1 ZEND_SEND_VAR_EX_SPEC_CV_QUICK_HANDLER (execute_data=0x2aaaad420dc0) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:37385
0000002 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000003 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420dc0)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000004 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420ca0)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000005 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000006 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420ca0)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000007 0x0000555555850ec8 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x2aaaad420b70)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:1083
0000008 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000009 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420b70)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000010 0x0000555555850ec8 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x2aaaad420a10)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:1083
0000011 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000012 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420a10)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000013 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420940)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000014 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000015 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420940)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000016 0x0000555555850ec8 in ZEND_DO_FCALL_SPEC_RETVAL_USED_HANDLER (execute_data=0x2aaaad420860)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:1083
0000017 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000018 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420860)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000019 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420740)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000020 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000021 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420740)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000022 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad4206c0)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000023 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000024 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad4206c0)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000025 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420650)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000026 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000027 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420650)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000028 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420030)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000029 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000030 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420030)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000031 0x000055555585167a in zend_execute (op_array=op_array@entry=0x2aaaad48c000, return_value=return_value@entry=0x0)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:60834
0000032 0x00005555557c5614 in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3)
    at /build/php7.3-7.3.0~rc3/Zend/zend.c:1568
0000033 0x0000555555764588 in php_execute_script (primary_file=primary_file@entry=0x7fffffffea60)
    at /build/php7.3-7.3.0~rc3/main/main.c:2630
0000034 0x000055555562571e in main (argc=<optimized out>, argv=<optimized out>) at /build/php7.3-7.3.0~rc3/sapi/fpm/fpm/fpm_main.c:1947
TagsNo tags attached.
Operating SystemLinux
PHP Version7.3-dev
Attached Files

- Relationships

-  Notes
(0004712)
derick (administrator)
2018-10-25 11:53

Hi,

I"m going to need a (short) script to reproduce this. Please note, that 2.7.0-beta1 is still a pre-release version, and that there are still issues with it. A short script to reproduce this will expedite fixes.

cheers,
Derick
(0004713)
kmdm (reporter)
2018-10-25 12:37

Ok, I've got one. It only crashes in the FPM SAPI in my testing and not CLI.

PHP:
<?php
class Foo
{
    public function __destruct() { $this->shutdown(); }
    public function shutdown($how=STREAM_SHUT_RDWR) { }
}

function get_it()
{
    return false;

}

$x = new Foo();
$x->shutdown();
echo json_encode(['x'=>get_it()]);

GDB (BT):
#0 i_free_compiled_variables (execute_data=0x2aaaad420080) at /build/php7.3-7.3.0~rc3/Zend/zend_execute.c:2351
#1 zend_leave_helper_SPEC (execute_data=0x2aaaad420080) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:589
0000002 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000003 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420080)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000004 0x0000555555851299 in ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (execute_data=0x2aaaad420030)
    at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:961
0000005 0x0000555555802170 in execute_ex (ex=<optimized out>) at /build/php7.3-7.3.0~rc3/Zend/zend_vm_execute.h:55287
0000006 0x00002aaaad89a7bc in xdebug_execute_ex (execute_data=0x2aaaad420030)
    at /build/xdebug-2.7.0~beta1+2.6.1+2.5.5/build-7.3/xdebug.c:1868
0000007 0x00005555557b71ba in zend_call_function (fci=fci@entry=0x7fffffffe560, fci_cache=<optimized out>, fci_cache@entry=0x7fffffffe540)
    at /build/php7.3-7.3.0~rc3/Zend/zend_execute_API.c:756
0000008 0x00005555557f49ef in zend_objects_destroy_object (object=0x2aaaad470a78) at /build/php7.3-7.3.0~rc3/Zend/zend_objects.c:158
0000009 0x00005555557f9cbc in zend_objects_store_del (object=0x2aaaad470a78) at /build/php7.3-7.3.0~rc3/Zend/zend_objects_API.c:170
0000010 0x00005555557d5c45 in _zend_hash_del_el_ex (prev=<optimized out>, p=<optimized out>, idx=7, ht=<optimized out>)
    at /build/php7.3-7.3.0~rc3/Zend/zend_hash.c:1181
0000011 _zend_hash_del_el (p=0x2aaaad4662e0, idx=7, ht=0x555555bb23b0) at /build/php7.3-7.3.0~rc3/Zend/zend_hash.c:1204
0000012 zend_hash_reverse_apply (ht=ht@entry=0x555555bb23b0, apply_func=apply_func@entry=0x5555557b5a20 <zval_call_destructor>)
    at /build/php7.3-7.3.0~rc3/Zend/zend_hash.c:1775
0000013 0x00005555557b5e55 in shutdown_destructors () at /build/php7.3-7.3.0~rc3/Zend/zend_execute_API.c:240
0000014 0x00005555557c5267 in zend_call_destructors () at /build/php7.3-7.3.0~rc3/Zend/zend.c:1089
0000015 0x000055555576322d in php_request_shutdown (dummy=dummy@entry=0x0) at /build/php7.3-7.3.0~rc3/main/main.c:1873
0000016 0x000055555562578b in main (argc=<optimized out>, argv=<optimized out>) at /build/php7.3-7.3.0~rc3/sapi/fpm/fpm/fpm_main.c:1975

GDB PHP:
[0x2aaaad420080] Foo->shutdown() /<redacted>/crash.php:5
[0x2aaaad420030] Foo->__destruct() /<redacted>/crash.php:4
[0x7fffffffe4a0] ???

NOTES:

 * Changing $how=STREAM_SHUT_RDWR to $how=1 fixes the issue.
 * Removing the call to get_it() and just using 'false' fixes the issue.

- Issue History
Date Modified Username Field Change
2018-10-25 11:27 kmdm New Issue
2018-10-25 11:53 derick Note Added: 0004712
2018-10-25 11:53 derick Assigned To => derick
2018-10-25 11:53 derick Status new => feedback
2018-10-25 12:37 kmdm Note Added: 0004713
2018-10-25 12:37 kmdm Status feedback => assigned


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker