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 | |||
| 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. |
|
|
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] |
|
|
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. |