View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001916 | Xdebug | Uncategorized | public | 2020-12-16 00:40 | 2021-04-14 16:00 |
Reporter | Mr_What4 | Assigned To | derick | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Product Version | 3.0.1 | ||||
Summary | 0001916: Seeing a Segfault with XDebug 3.0.1 and PHP 7.2 - 8.0 | ||||
Description | When running PHPCS with xdebug installed and enabled is causing a segfault: Starting program: /usr/lib64/php7.4/bin/php -f vendor/bin/phpcs -- -s --standard=phpcs.xml Program received signal SIGSEGV, Segmentation fault. This only seems to happen with XDebug 3.0.1, 2.9.8 seems to work as expected. | ||||
Steps To Reproduce | /usr/lib64/php7.4/bin/php -f vendor/bin/phpcs -- -s --standard=phpcs.xml | ||||
Additional Information | PHP version doesn't seem to matter, 7.4.13 was used for this backtrace. squizlabs/php_codesniffer 3.5.8 PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. My xdebug.ini: zend_extension=/usr/lib64/php7.4/lib/extensions/no-debug-zts-20190902/xdebug.so My phpcs.xml: <?xml version="1.0"?>
</ruleset> | ||||
Tags | No tags attached. | ||||
Operating System | |||||
PHP Version | 7.4.10-7.4.19 | ||||
|
I put in the xdebug.ini from 2.9, here is my 3.0.1: zend_extension=/usr/lib64/php7.4/lib/extensions/no-debug-zts-20190902/xdebug.so |
|
Can you provide the exact steps (git clone, composer install, etc) for me to try to reproduce this problem? |
|
Hi Derick, Thanks for taking a look at this. I am using gentoo AMD Ryzen 7 3700X 8-Core Processor, cflags = "-march=native -mtune=native -O2 -ftree-vectorize -fomit-frame-pointer -ggdb -pipe". Composer version: 1.10.15 The following produces two segfaults. First segfault happens on composer install and the second on phpcs. Seems to happen every time for me. git clone git@github.com:FaaPz/PDO.git |
|
Problem still persists with xdebug 3.0.2 |
|
I have tried reproducing this (with xdebug 3.0.3-dev), but I am not getting any segfault, or any other warnings when running with valgrind like this either: <code> Your original backtrace doesn't show that Xdebug is involved in the crash either... So unless you can come up with something that allows me to see the problem locally, I am not sure what I can do. |
|
This bug is the same as https://bugs.xdebug.org/view.php?id=1934, my best guess is xdebug is getting unloaded twice but I'll see if I can get a better trace in the other bug. |
|
I got a bunch of segfaults yesterday that started out as php errors, but were crashing fpm. I haven't investigated them but my best guess is Xdebug (call me grinch :D). Have you managed to reproduce it or should I try to rollback the code and see if I can generate a dump? |
|
I can reproduce it every time I run php but my GDB skills are pretty poor. This segfault seems to be related to unloading the xdebug extension when ZTS is enabled. I suspect it is getting unloaded twice or this is some other type of race condition going on when PHP is cleaning itself up. If you have an idea about something I should try with GDB or anything else let me know. If I disable ZTS things do work normally. My configuration: ./configure --prefix=/usr --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --docdir=/usr/share/doc/php-7.4.14-r1 --htmldir=/usr/share/doc/php-7.4.14-r1/html --prefix=/usr/lib64/php7.4 --mandir=/usr/lib64/php7.4/man --infodir=/usr/lib64/php7.4/info --libdir=/usr/lib64/php7.4/lib --with-libdir=lib64 --localstatedir=/var --without-pear --enable-maintainer-zts --without-password-argon2 --enable-bcmath --with-bz2=/usr --disable-calendar --disable-gcov --enable-ctype --with-curl --enable-dom --without-enchant --disable-exif --without-ffi --enable-fileinfo --enable-filter --enable-ftp --with-gettext=/usr --without-gmp --without-mhash --with-iconv --disable-intl --disable-ipv6 --enable-json --without-kerberos --with-libxml --enable-mbstring --with-openssl --enable-pcntl --enable-phar --enable-pdo --enable-opcache --without-pgsql --enable-posix --with-pspell=/usr --enable-simplexml --disable-shmop --without-snmp --enable-soap --enable-sockets --without-sodium --with-sqlite3 --enable-sysvmsg --enable-sysvsem --enable-sysvshm --without-tidy --enable-tokenizer --enable-xml --disable-xmlreader --enable-xmlwriter --without-xmlrpc --without-xsl --with-zip --with-zlib=/usr --disable-debug --enable-dba --without-cdb --with-db4=/usr --enable-flatfile --with-gdbm=/usr --disable-inifile --without-qdbm --without-tcadb --without-lmdb --without-freetype --disable-gd-jis-conv --without-jpeg --without-xpm --without-webp --disable-gd --without-mysqli --with-mysql-sock=/var/run/mysqld/mysqld.sock --without-unixODBC --without-iodbc --without-pdo-odbc --without-oci8 --without-pdo-dblib --with-pdo-mysql=mysqlnd --without-pdo-pgsql --with-pdo-sqlite --without-pdo-firebird --without-pdo-oci --with-readline=/usr --without-libedit --without-mm --with-pic --with-external-pcre --without-pcre-jit --cache-file=/var/tmp/portage/dev-lang/php-7.4.14-r1/temp/config.cache --with-config-file-path=/etc/php/cli-php7.4 --with-config-file-scan-dir=/etc/php/cli-php7.4/ext-active --disable-embed --enable-cli --disable-cgi --disable-fpm --without-apxs2 --disable-phpdbg |
|
Confirming this. Using the docker image 7.3-apache-stretch with "pecl install xdebug" and XDEBUG_MODE="develop,debug" XDEBUG_CONFIG="cli_color=1 client_host=192.168.64.1 client_port=9000 discover_client_host=0 start_with_request=1" |
|
I can reproduce this error in a docker container running php7.3 & xdebug 3.0.2. Random tests are failing, depending if i call phpunit with or without --testdox. It only happens with xdebug.mode=develop. every other mode is fine, and every combination without develop is fine. stacktrace.txt (4,957 bytes)
#0 0x0000563a6ae485a2 in _emalloc_56 () #1 0x0000563a6ae7b499 in _zend_new_array_0 () #2 0x0000563a6ad9aefd in ?? () #3 0x00007f515813c315 in xdebug_execute_internal (current_execute_data=0x7f5158623ec0, return_value=0x7f5158623eb0) at ./build-7.3/src/base/base.c:921 #4 0x0000563a6acbf10f in ?? () #5 0x0000563a6aef8096 in execute_ex () #6 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623e30) at ./build-7.3/src/base/base.c:803 #7 0x0000563a6acbf097 in ?? () #8 0x0000563a6aef8096 in execute_ex () #9 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623d50) at ./build-7.3/src/base/base.c:803 #10 0x0000563a6acbf097 in ?? () #11 0x0000563a6aef8096 in execute_ex () #12 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623c50) at ./build-7.3/src/base/base.c:803 #13 0x0000563a6acbf097 in ?? () #14 0x0000563a6aef8096 in execute_ex () #15 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623a40) at ./build-7.3/src/base/base.c:803 #16 0x0000563a6acbed59 in ?? () #17 0x0000563a6aef8096 in execute_ex () #18 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f51586238a0) at ./build-7.3/src/base/base.c:803 #19 0x0000563a6acbed59 in ?? () #20 0x0000563a6aef8096 in execute_ex () #21 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623710) at ./build-7.3/src/base/base.c:803 #22 0x0000563a6acbed59 in ?? () #23 0x0000563a6aef8096 in execute_ex () #24 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f51586236a0) at ./build-7.3/src/base/base.c:803 #25 0x0000563a6acbed59 in ?? () #26 0x0000563a6aef8096 in execute_ex () #27 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623520) at ./build-7.3/src/base/base.c:803 #28 0x0000563a6acbed59 in ?? () #29 0x0000563a6aef8096 in execute_ex () #30 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623410) at ./build-7.3/src/base/base.c:803 #31 0x0000563a6acbed59 in ?? () #32 0x0000563a6aef8096 in execute_ex () #33 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623370) at ./build-7.3/src/base/base.c:803 #34 0x0000563a6acbf097 in ?? () #35 0x0000563a6aef8096 in execute_ex () #36 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623300) at ./build-7.3/src/base/base.c:803 #37 0x0000563a6acbed59 in ?? () #38 0x0000563a6aef8096 in execute_ex () #39 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f51586231e0) at ./build-7.3/src/base/base.c:803 #40 0x0000563a6acbed59 in ?? () #41 0x0000563a6aef8096 in execute_ex () #42 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158623160) at ./build-7.3/src/base/base.c:803 #43 0x0000563a6acbed59 in ?? () #44 0x0000563a6aef8096 in execute_ex () #45 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f51586229f0) at ./build-7.3/src/base/base.c:803 #46 0x0000563a6acbed59 in ?? () #47 0x0000563a6aef8096 in execute_ex () #48 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f51586219e0) at ./build-7.3/src/base/base.c:803 #49 0x0000563a6acbed59 in ?? () #50 0x0000563a6aef8096 in execute_ex () #51 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158620f20) at ./build-7.3/src/base/base.c:803 #52 0x0000563a6acbed59 in ?? () #53 0x0000563a6aef8096 in execute_ex () #54 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158620830) at ./build-7.3/src/base/base.c:803 #55 0x0000563a6acbed59 in ?? () #56 0x0000563a6aef8096 in execute_ex () #57 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f5158620140) at ./build-7.3/src/base/base.c:803 #58 0x0000563a6acbed59 in ?? () #59 0x0000563a6aef8096 in execute_ex () #60 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f515861fa50) at ./build-7.3/src/base/base.c:803 ---Type <return> to continue, or q <return> to quit--- #61 0x0000563a6acbed59 in ?? () #62 0x0000563a6aef8096 in execute_ex () #63 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f515861d6a0) at ./build-7.3/src/base/base.c:803 #64 0x0000563a6acbf097 in ?? () #65 0x0000563a6aef8096 in execute_ex () #66 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f515861d2b0) at ./build-7.3/src/base/base.c:803 #67 0x0000563a6acbf097 in ?? () #68 0x0000563a6aef8096 in execute_ex () #69 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f515861d200) at ./build-7.3/src/base/base.c:803 #70 0x0000563a6acbed59 in ?? () #71 0x0000563a6aef8096 in execute_ex () #72 0x00007f515813ba39 in xdebug_execute_ex (execute_data=0x7f515861d030) at ./build-7.3/src/base/base.c:803 #73 0x0000563a6aefe7d3 in zend_execute () #74 0x0000563a6ae6f692 in zend_execute_scripts () #75 0x0000563a6ae0f4f0 in php_execute_script () #76 0x0000563a6af00cfc in ?? () #77 0x0000563a6acc7806 in ?? () #78 0x00007f515b314bf7 in __libc_start_main (main=0x563a6acc73f0, argc=3, argv=0x7ffca238f0c8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffca238f0b8) at ../csu/libc-start.c:310 #79 0x0000563a6acc79aa in _start () (gdb) |
|
Same issue on a private repository (can't provide source code to reproduce) PHP 8.0.0 (cli) (built: Dec 1 2020 03:33:03) ( NTS ) [Xdebug] scratch.txt (3,394 bytes)
(gdb) bt #0 0x0000564c8a624a8c in zend_call_function () #1 0x0000564c8a6256c5 in zend_call_known_function () #2 0x0000564c8a6b4014 in zend_objects_destroy_object () #3 0x0000564c8a6b88c7 in zend_objects_store_del () #4 0x00007f7683ecda9d in function_stack_entry_dtor (elem=0x564c8b5ba840) at /tmp/pear/temp/xdebug/src/base/base.c:122 #5 0x00007f7683ecec37 in xdebug_vector_pop (v=0x564c8b71c010) at /tmp/pear/temp/xdebug/src/lib/vector.h:64 #6 xdebug_execute_ex (execute_data=0x7f766039d500) at /tmp/pear/temp/xdebug/src/base/base.c:792 #7 0x0000564c8a6ae062 in zend_generator_resume () #8 0x0000564c8a682ce9 in ?? () #9 0x0000564c8a692a67 in execute_ex () #10 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f76650bbe00) at /tmp/pear/temp/xdebug/src/base/base.c:765 #11 0x0000564c8a6ae062 in zend_generator_resume () #12 0x0000564c8a682ce9 in ?? () #13 0x0000564c8a692a67 in execute_ex () #14 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c19810) at /tmp/pear/temp/xdebug/src/base/base.c:765 #15 0x0000564c8a6983c9 in execute_ex () #16 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c196a0) at /tmp/pear/temp/xdebug/src/base/base.c:765 #17 0x0000564c8a6983c9 in execute_ex () #18 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c192f0) at /tmp/pear/temp/xdebug/src/base/base.c:765 #19 0x0000564c8a69950b in execute_ex () #20 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c18e40) at /tmp/pear/temp/xdebug/src/base/base.c:765 #21 0x0000564c8a69950b in execute_ex () #22 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c18720) at /tmp/pear/temp/xdebug/src/base/base.c:765 #23 0x0000564c8a6983c9 in execute_ex () #24 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c17550) at /tmp/pear/temp/xdebug/src/base/base.c:765 #25 0x0000564c8a6983c9 in execute_ex () #26 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c16900) at /tmp/pear/temp/xdebug/src/base/base.c:765 #27 0x0000564c8a6983c9 in execute_ex () #28 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c16200) at /tmp/pear/temp/xdebug/src/base/base.c:765 #29 0x0000564c8a6983c9 in execute_ex () #30 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c15b00) at /tmp/pear/temp/xdebug/src/base/base.c:765 #31 0x0000564c8a6983c9 in execute_ex () #32 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c136d0) at /tmp/pear/temp/xdebug/src/base/base.c:765 #33 0x0000564c8a69950b in execute_ex () #34 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c13300) at /tmp/pear/temp/xdebug/src/base/base.c:765 #35 0x0000564c8a69950b in execute_ex () #36 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c131f0) at /tmp/pear/temp/xdebug/src/base/base.c:765 #37 0x0000564c8a6983c9 in execute_ex () #38 0x00007f7683ecebc6 in xdebug_execute_ex (execute_data=0x7f7683c13020) at /tmp/pear/temp/xdebug/src/base/base.c:765 #39 0x0000564c8a69a8ee in zend_execute () #40 0x0000564c8a6329dd in zend_execute_scripts () #41 0x0000564c8a5d00fe in php_execute_script () #42 0x0000564c8a6c004e in ?? () #43 0x0000564c8a35d7cb in ?? () #44 0x00007f7686d5909b in __libc_start_main (main=0x564c8a35d380, argc=3, argv=0x7ffd43973288, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffd43973278) at ../csu/libc-start.c:308 #45 0x0000564c8a35df0a in _start () |
|
Hi Derick, I have tracked the issue to |
|
Hi, I've just tried reproducing this again, but it still does not produce any crashes, or valgrind errors with php 7.4.13 in non-debug mode, and Xdebug also not compiled in debug mode. Perhaps this is a compiler or libc inconsistency, but as long as I can't reproduce this... I'm going to be in the dark. If somebody can manage to create a docker setup, where I can ssh-in and run a PHP CLI command, and where also gdb, valgrind, and strace are installed, I can give that a go. cheers, |
|
Unless I get the requested additional information, I will be closing this report in the next week or so. |
|
Closing this, as I can't either reproduce this, or not enough information has been provided, even after soliciting feedback again. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-12-16 00:40 | Mr_What4 | New Issue | |
2020-12-16 00:51 | Mr_What4 | Note Added: 0005590 | |
2020-12-17 15:00 | derick | Assigned To | => derick |
2020-12-17 15:00 | derick | Status | new => feedback |
2020-12-17 15:00 | derick | Note Added: 0005591 | |
2020-12-17 15:55 | Mr_What4 | Note Added: 0005593 | |
2020-12-17 15:55 | Mr_What4 | Status | feedback => assigned |
2021-01-19 02:59 | Mr_What4 | Note Added: 0005639 | |
2021-01-20 11:28 | derick | Status | assigned => feedback |
2021-01-20 11:28 | derick | Note Added: 0005641 | |
2021-01-25 16:22 | Mr_What4 | Note Added: 0005659 | |
2021-01-25 16:22 | Mr_What4 | Status | feedback => assigned |
2021-02-03 13:04 | dinu | Note Added: 0005665 | |
2021-02-03 15:11 | Mr_What4 | Note Added: 0005666 | |
2021-02-15 07:28 | catalin.nicolescu | Note Added: 0005667 | |
2021-02-19 16:26 | BitWire | Note Added: 0005691 | |
2021-02-19 16:26 | BitWire | File Added: stacktrace.txt | |
2021-03-02 09:58 | vincent | Note Added: 0005699 | |
2021-03-02 09:58 | vincent | File Added: scratch.txt | |
2021-03-03 06:39 | Mr_What4 | Note Added: 0005700 | |
2021-03-03 11:43 | derick | Note Added: 0005702 | |
2021-03-03 11:43 | derick | Status | assigned => feedback |
2021-03-17 08:21 | derick | Note Added: 0005716 | |
2021-04-14 16:00 | derick | Status | feedback => closed |
2021-04-14 16:00 | derick | Resolution | open => unable to reproduce |
2021-04-14 16:00 | derick | Note Added: 0005827 |