View Issue Details

IDProjectCategoryView StatusLast Update
0001934XdebugUncategorizedpublic2021-02-18 11:21
Reportermjo Assigned Toderick  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionunable to reproduce 
Platformamd64OSlinux 
Product Version3.0.1 
Summary0001934: Segfailt with php-7.4 and maintainer-zts enabled
Description

We have two reports of a crash on Gentoo,

https://bugs.gentoo.org/759835

which I've been able to narrow down to the "--enable-maintainer-zts" flag in PHP itself. I haven't tested any other versions besides 7.4, but it is my understanding that 7.4.x should still be supported.

Steps To Reproduce
  1. Build php with --enable-maintainer-zts
  2. Build xdebug-3.0.1 against that php
  3. Run php -v
TagsNo tags attached.
Operating System
PHP Version7.4.10-7.4.19

Activities

derick

2021-01-20 11:40

administrator   ~0005642

I can't reproduce this. I've rebuild a fresh PHP 7.4.13:

<code>
'./configure' '--prefix=/usr/local/php/7.4.13-zts' '--enable-debug' '--enable-maintainer-zts' '--enable-zts' '--with-gettext' '--with-gd' '--enable-gd' '--with-jpeg' '--without-freetype' '--with-jpeg-dir=/usr' '--without-freetype-dir' '--with-mysql=mysqlnd' '--enable-bcmath' '--with-readline' '--with-openssl' '--without-esmtp' '--with-curl' '--with-sodium' '--with-ffi' '--with-mysqli' '--enable-pcntl' '--enable-sockets' '--enable-zip' '--with-zip' '--enable-memory-limit' '--with-mcrypt' '--with-libxml' '--enable-libxml' '--with-iconv' '--enable-wddx' '--enable-calendar' '--with-sqlite3' '--enable-spl' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-ctype' '--with-bz2' '--enable-mbstring' '--with-mime-magic' '--with-xmlrpc' '--with-zlib' '--disable-zend-memory-manager' '--with-esmtp' '--with-xsl' '--enable-exif' '--enable-soap' '--enable-ftp' '--enable-intl' '--enable-opcache' '--enable-fpm' '--with-pear'
</code>

Then installed Xdebug 3.0.2 from pecl with "pecl install xdebug", and then I run:

<code>
USE_ZEND_ALLOC=0 valgrind php -n -dzend_extension=xdebug -v
</code>

And valgrind reports no error messages, warnings, and there is no crash:

<code>
==1901990== Memcheck, a memory error detector
==1901990== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1901990== Using Valgrind-3.16.1 and LibVEX; rerun with -h for copyright info
==1901990== Command: php -n -dzend_extension=xdebug -v
==1901990==
PHP 7.4.13 (cli) (built: Jan 20 2021 11:35:52) ( ZTS DEBUG )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
==1901990==
==1901990== HEAP SUMMARY:
==1901990== in use at exit: 3,396 bytes in 37 blocks
==1901990== total heap usage: 31,855 allocs, 31,818 frees, 4,899,494 bytes allocated
==1901990==
==1901990== LEAK SUMMARY:
==1901990== definitely lost: 0 bytes in 0 blocks
==1901990== indirectly lost: 0 bytes in 0 blocks
==1901990== possibly lost: 0 bytes in 0 blocks
==1901990== still reachable: 0 bytes in 0 blocks
==1901990== suppressed: 3,396 bytes in 37 blocks
==1901990==
==1901990== For lists of detected and suppressed errors, rerun with: -s
==1901990== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
</code/>

Please provide steps that shows that Xdebug is at fault in your situation.

mjo

2021-01-23 03:03

reporter   ~0005651

Naturally, it works fine when you build php with --enable-debug. Try without =)

derick

2021-01-23 11:39

administrator   ~0005652

Last edited: 2021-01-23 11:40

Works fine in a non debug build too:

<pre>
'./configure' '--prefix=/usr/local/php/7.4dev-nodebug' '--with-gettext' '--with-gd' '--enable-gd' '--with-jpeg' '--without-freetype' '--with-jpeg-dir=/usr' '--without-freetype-dir' '--with-mysql=mysqlnd' '--enable-bcmath' '--with-readline' '--with-openssl' '--without-esmtp' '--with-curl' '--with-sodium' '--with-ffi' '--with-mysqli' '--enable-pcntl' '--enable-sockets' '--enable-zip' '--with-zip' '--enable-memory-limit' '--with-mcrypt' '--with-libxml' '--enable-libxml' '--with-iconv' '--enable-wddx' '--enable-calendar' '--with-sqlite3' '--enable-spl' '--enable-pdo' '--with-pdo-mysql' '--with-pdo-sqlite' '--with-ctype' '--with-bz2' '--enable-mbstring' '--with-mime-magic' '--with-xmlrpc' '--with-zlib' '--disable-zend-memory-manager' '--with-esmtp' '--with-xsl' '--enable-exif' '--enable-soap' '--enable-ftp' '--enable-intl' '--enable-opcache' '--enable-fpm' '--with-pear'
</pre>

<pre>
pecl install xdebug
</pre>

<pre>
$ php -n -dzend_Extension=xdebug -v
PHP 7.4.13-dev (cli) (built: Jan 23 2021 11:34:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
</pre>

<pre>
$ gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
</pre>

You're going to have to prove to me that it is Xdebug that causes your problem, and not non-standard flags, your compiler, or anything else.

mjo

2021-01-23 12:56

reporter   ~0005654

Argh, what kind of CFLAGS does your build use by default? I've used both "-pipe -O2 -march=native" and "-pipe -ggdb" here, for both php and xdebug. I can't think of anything else that might be different. I've disabled most of the default PHP features to speed up the build time, but the other Gentoo users experiencing the problem haven't done that.

Also note that I'm now using php-7.4.14 and xdebug-3.0.2 (minor upgrades from the original report).

derick

2021-01-23 15:05

administrator   ~0005655

I showed you exactly what I typed. No extra flags.

mjo

2021-01-23 15:13

reporter   ~0005656

Can you try with e.g. CFLAGS="-O2 -march=native", then? The additional optimization is my current best guess as to why we're getting different results, since one side-effect of adding --enable-debug to PHP is to propagate "-O0" into the CFLAGS for xdebug.

derick

2021-01-24 12:44

administrator   ~0005657

-O2 is the default when not compiling with --enable-debug, and both my PHP and Xdebug were compiled with that flag on. I am not going to check locally with random combinations of flags, and my statement still stands:

You're going to have to prove to me that it is Xdebug that causes your problem, and not non-standard flags, your compiler, or anything else.

Unless you can do that, I am not going to reply.

derick

2021-02-18 11:21

administrator   ~0005670

I can't reproduce this, and not enough information was made available to unstick this issue. Please re-open if you can provide more information.

Issue History

Date Modified Username Field Change
2021-01-15 14:57 mjo New Issue
2021-01-20 11:40 derick Assigned To => derick
2021-01-20 11:40 derick Status new => feedback
2021-01-20 11:40 derick Note Added: 0005642
2021-01-23 03:03 mjo Note Added: 0005651
2021-01-23 03:03 mjo Status feedback => assigned
2021-01-23 11:39 derick Status assigned => feedback
2021-01-23 11:39 derick Note Added: 0005652
2021-01-23 11:39 derick Note Edited: 0005652
2021-01-23 11:40 derick Note Edited: 0005652
2021-01-23 12:56 mjo Note Added: 0005654
2021-01-23 12:56 mjo Status feedback => assigned
2021-01-23 15:05 derick Note Added: 0005655
2021-01-23 15:13 mjo Note Added: 0005656
2021-01-24 12:44 derick Status assigned => feedback
2021-01-24 12:44 derick Note Added: 0005657
2021-02-18 11:21 derick Status feedback => resolved
2021-02-18 11:21 derick Resolution open => unable to reproduce
2021-02-18 11:21 derick Note Added: 0005670