MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001387XdebugUsage problems (Wrong Results)public2017-01-08 18:352017-01-14 15:16
Reporterkelunik 
Assigned Toderick 
PrioritynormalSeveritycrashReproducibilityalways
StatusassignedResolutionopen 
Platformx64OSUbuntuOS Version16.04
Product Version2.5.0 
Target VersionFixed in Version 
Summary0001387: Segfault in GC
DescriptionRunning the Humbug PHPUnit test suite with xdebug loaded makes PHP segfault at the end of the tests.

Note: Running on PHP 7.1.0, but only 7.1-dev is available in the select box.
Steps To Reproduce1. git clone https://github.com/padraic/humbug [^]
2. cd humbug
3. composer install
4. vendor/bin/phpunit
Additional InformationGDB LOG
=======

php: /home/kelunik/.php-build/release/Zend/zend_gc.c:276: gc_possible_root: Assertion `(ref)->gc.u.v.type == 7 || (ref)->gc.u.v.type == 8' failed.

Program received signal SIGABRT, Aborted.
0x00007ffff49c2428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
(gdb) bt
#0 0x00007ffff49c2428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff49c402a in __GI_abort () at abort.c:89
0000002 0x00007ffff49babd7 in __assert_fail_base (fmt=<optimized out>,
    assertion=assertion@entry=0x102d198 "(ref)->gc.u.v.type == 7 || (ref)->gc.u.v.type == 8",
    file=file@entry=0x102d168 "/home/kelunik/.php-build/release/Zend/zend_gc.c", line=line@entry=276,
    function=function@entry=0x102d2b0 <__PRETTY_FUNCTION__.9732> "gc_possible_root") at assert.c:92
0000003 0x00007ffff49bac82 in __GI___assert_fail (
    assertion=0x102d198 "(ref)->gc.u.v.type == 7 || (ref)->gc.u.v.type == 8",
    file=0x102d168 "/home/kelunik/.php-build/release/Zend/zend_gc.c", line=276,
    function=0x102d2b0 <__PRETTY_FUNCTION__.9732> "gc_possible_root") at assert.c:101
0000004 0x00000000009444c6 in gc_possible_root (ref=0x7fffed53c8a0)
    at /home/kelunik/.php-build/release/Zend/zend_gc.c:276
0000005 0x0000000000921f09 in gc_check_possible_root (z=0x7fffed523e60)
    at /home/kelunik/.php-build/release/Zend/zend_gc.h:136
0000006 0x0000000000921f68 in i_zval_ptr_dtor (zval_ptr=0x7fffed523e60,
    __zend_filename=0x10291a0 "/home/kelunik/.php-build/release/Zend/zend_hash.c", __zend_lineno=1310)
    at /home/kelunik/.php-build/release/Zend/zend_variables.h:50
0000007 0x0000000000925d99 in zend_array_destroy (ht=0x7fffed53c900)
    at /home/kelunik/.php-build/release/Zend/zend_hash.c:1310
0000008 0x000000000090d126 in _zval_dtor_func (p=0x7fffed53c900,
    __zend_filename=0x1024ae8 "/home/kelunik/.php-build/release/Zend/zend_opcode.c", __zend_lineno=397)
    at /home/kelunik/.php-build/release/Zend/zend_variables.c:43
0000009 0x00000000008fcb6d in _zval_ptr_dtor_nogc (zval_ptr=0x7fffedfedbe0,
    __zend_filename=0x1024ae8 "/home/kelunik/.php-build/release/Zend/zend_opcode.c", __zend_lineno=397)
    at /home/kelunik/.php-build/release/Zend/zend_variables.h:40
0000010 0x00000000008fddf4 in destroy_op_array (op_array=0x7fffed5145c0)
    at /home/kelunik/.php-build/release/Zend/zend_opcode.c:397
0000011 0x00000000008fcf40 in zend_function_dtor (zv=0x7fffed58d820)
    at /home/kelunik/.php-build/release/Zend/zend_opcode.c:122
0000012 0x0000000000925a74 in zend_hash_destroy (ht=0x7fffed514338)
    at /home/kelunik/.php-build/release/Zend/zend_hash.c:1236
0000013 0x00000000008fd8ac in destroy_zend_class (zv=0x7fffffffb2a0)
    at /home/kelunik/.php-build/release/Zend/zend_opcode.c:287
0000014 0x000000000092513c in _zend_hash_del_el_ex (ht=0x1344eb0, idx=218, p=0x1584f40, prev=0x0)
    at /home/kelunik/.php-build/release/Zend/zend_hash.c:998
0000015 0x000000000092521c in _zend_hash_del_el (ht=0x1344eb0, idx=218, p=0x1584f40)
    at /home/kelunik/.php-build/release/Zend/zend_hash.c:1021
0000016 0x0000000000926ac4 in zend_hash_reverse_apply (ht=0x1344eb0,
    apply_func=0x8f7350 <clean_non_persistent_class>)
    at /home/kelunik/.php-build/release/Zend/zend_hash.c:1603
0000017 0x00000000008f7de8 in shutdown_executor ()
    at /home/kelunik/.php-build/release/Zend/zend_execute_API.c:369
0000018 0x000000000090f5a1 in zend_deactivate () at /home/kelunik/.php-build/release/Zend/zend.c:997
0000019 0x000000000087f2e5 in php_request_shutdown (dummy=0x0)
    at /home/kelunik/.php-build/release/main/main.c:1873
0000020 0x00000000009f39f9 in do_cli (argc=2, argv=0x13150c0)
    at /home/kelunik/.php-build/release/sapi/cli/php_cli.c:1157
0000021 0x00000000009f420c in main (argc=2, argv=0x13150c0)
    at /home/kelunik/.php-build/release/sapi/cli/php_cli.c:1378
TagsSIGSEGV
Operating SystemUbuntu 16.04
PHP Version7.1-dev
Attached Filestxt file icon gdb1.txt [^] (8,262 bytes) 2017-01-08 21:25 [Show Content]
txt file icon gdb2.txt [^] (12,109 bytes) 2017-01-08 21:25 [Show Content]
? file icon php.sh [^] (1,992 bytes) 2017-01-11 22:13
? file icon xdebug.sh [^] (453 bytes) 2017-01-11 22:13

- Relationships

-  Notes
(0004161)
kelunik (reporter)
2017-01-08 18:47

This doesn't happen on 7.0.5 with xdebug 2.5.0
(0004163)
derick (administrator)
2017-01-08 20:33

I can not reproduce this. Can you please try the following:

install valgrind (apt-get install valgrind).

Then on the shell, run the following:

export USE_ZEND_ALLOC=0

The first test:

gdb --args php vendor/bin/phpunit

and on the GDB prompt: "run". Then when it crashes, type "bt full". And attach the output as a file to this issue.

The second test:

valgrind php vendor/bin/phpunit

and attach the output as a file to this issue.
(0004165)
kelunik (reporter)
2017-01-08 21:25

Done. :-)
(0004173)
derick (administrator)
2017-01-11 20:35

I can still not reproduce this, not even with Ubuntu 16.04 and the compiler it comes with. Can you try disabling Xdebug in php.ini and try to run the test again? Nothing in the valgrind or gdb output even hints that Xdebug is the culprit here as it is not mentioned at all in the traces.
(0004174)
kelunik (reporter)
2017-01-11 22:13
edited on: 2017-01-11 22:14

I've set up things on another server and can reproduce it there, too. Disabling xDebug fails some tests, but doesn't crash at the end.

Maybe it's not xDebug directly, a GC issue that does only appear on certain memory allocations and xDebug changes those to show up?

I'll upload my php.sh and xdebug.sh files which I used to set things up.

./php.sh 7.1.0 && ./xdebug.sh 2.5.0

Used the default php.ini-development from current master and added the extension at the top.

(0004177)
derick (administrator)
2017-01-13 16:50

I can reproduce that now on Joe's box, but no idea how and why this happens...
(0004183)
kelunik (reporter)
2017-01-14 15:16

My previous statement was wrong. This happens with 7.0.0-7.0.14, too.

- Issue History
Date Modified Username Field Change
2017-01-08 18:35 kelunik New Issue
2017-01-08 18:36 kelunik Tag Attached: SIGSEGV
2017-01-08 18:47 kelunik Note Added: 0004161
2017-01-08 20:33 derick Note Added: 0004163
2017-01-08 20:33 derick Assigned To => derick
2017-01-08 20:33 derick Status new => feedback
2017-01-08 21:25 kelunik File Added: gdb1.txt
2017-01-08 21:25 kelunik File Added: gdb2.txt
2017-01-08 21:25 kelunik Note Added: 0004165
2017-01-08 21:25 kelunik Status feedback => assigned
2017-01-11 20:35 derick Note Added: 0004173
2017-01-11 20:35 derick Status assigned => feedback
2017-01-11 22:13 kelunik Note Added: 0004174
2017-01-11 22:13 kelunik Status feedback => assigned
2017-01-11 22:13 kelunik File Added: php.sh
2017-01-11 22:13 kelunik File Added: xdebug.sh
2017-01-11 22:14 kelunik Note Edited: 0004174 View Revisions
2017-01-13 16:50 derick Note Added: 0004177
2017-01-14 15:16 kelunik Note Added: 0004183


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker