View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001583 | Xdebug | Step Debugging | public | 2018-10-25 10:27 | 2020-03-12 16:43 |
Reporter | kmdm | Assigned To | derick | ||
Priority | high | Severity | crash | Reproducibility | have not tried |
Status | closed | Resolution | fixed | ||
Platform | Linux | OS | Debian | OS Version | 7 |
Product Version | 2.7.0beta1 | ||||
Target Version | 2.7.0rc1 | Fixed in Version | 2.7.0rc1 | ||
Summary | 0001583: Xdebug crashes when OPcache's compact literals optimisation is on | ||||
Description | The segfault occurs when running certain scripts in our codebase, I've attached the gdb backtrace. | ||||
Steps To Reproduce | Run the following script with opcache and xdebug enabled: <?php function get_it() } $x = new Foo(); | ||||
Additional Information | Program received signal SIGSEGV, Segmentation fault. | ||||
Tags | No tags attached. | ||||
Operating System | Linux | ||||
PHP Version | 7.3.0-7.3.1 | ||||
has duplicate | 0001607 | resolved | derick | Warning Illegal offset type when using XDebug and Opcache with PHP 7.3 |
has duplicate | 0001612 | resolved | derick | Wrong default parameter when using xdebug |
has duplicate | 0001592 | resolved | derick | Removes the default constant ENT_QUOTES |
has duplicate | 0001590 | resolved | derick | Xdebug segfaults |
has duplicate | 0001605 | resolved | derick | XDebugs causes crash while using Composer |
has duplicate | 0001588 | resolved | derick | Incorrect handling of optional parameters with default values |
has duplicate | 0001600 | resolved | derick | Crashes while trying to debug laravel 5.7 app |
has duplicate | 0001619 | resolved | derick | after telling php in ini file where to find the extension, no page is delivered from apache2 |
|
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, |
|
Ok, I've got one. It only crashes in the FPM SAPI in my testing and not CLI. PHP: function get_it() } $x = new Foo(); GDB (BT): GDB PHP: NOTES:
|
|
FWIW, this issue is only reproducible with Opcache loaded. |
|
@morozov Aha! That explains why I couldn't reproduce it in the CLI! Now I can: % gdb --ex=r --args php7.3 -dzend_extension=xdebug.so -dopcache.enable_cli=On crash.php GNU gdb (GDB) 7.4.1-debian |
|
I can reproduce this:
Shows:
The first error is the same one as in 0001592, so these issues could as well be related. |
|
Full backtrace on PHP 7.3.0 with OpCache optimizer bug (PHP#77275) fixed: #0 i_free_compiled_variables (execute_data=<optimized out>) at ./Zend/zend_execute.c:2351 |
|
As I work around I have found disabling certain optimizations in opcache will avoid this bug. but setting it to: |
|
That 'B' would seem to align with this comment from php bug 77275: We set in php.ini: The second 'B' represents the removal of 0x400, or ZEND_OPTIMIZER_PASS_11 (1<<10) / Merge equal constants / |
|
Possibly related to (at a hunch/guess): https://github.com/php/php-src/commit/1a63fa6ec9b0bacbb726e60c3c212e7d97b518c6 |
|
I can confirm this bug with the most recent Archlinux. Both using the CLI and the php-fpm the same effect as described above happens. How can we help? What information is needed to track this down? |
|
I'm still on my Christmas break so haven't had time to check this more in depth. It's quite possible that this is a bug in opcache as a related issue was fixed there too. I'll be back on the weekend to look at this again. Right now, the workaround in (0004774) should work. (Turning off a specific opcache optimisation.) |
|
I don't know if it is exactly the same issue, but I can reproduce something similar using the following script:
Unfortunately my composer dependencies contain proprietary code, so I cannot post a self-contained test case. Commenting out the require_once makes the segfault disappear. I'm running PHP 7.3.0 and Xdebug 2.7.0beta1 (both from deb.sury.org) on Debian Stretch, invoked using the CLI:
Variations tried:
Running the script with valgrind ends with:
Hope this helps to narrow down the issue. |
|
I dove a bit in the Arch build system and tried to recompile PHP (+ Co.) with debugging symbols and without optimization. Then I ran php-fpm through valgrind and triggered the problem. The results can be seen here: https://gist.github.com/christianlupus/b942a198960c2d9f276f42a5d6f5a6cf. I hope this helps. If I can give more information or retry it with different configuration etc, please tell me. |
|
With PHP 7.3.1 the workaround with "opcache.optimization_level=0x7FFFBBFF" is not working anymore. Unsure if new issue or same issue as here. Also tried latest xdebug from master, same result as described here segfault 11 when xdebug is enabled and a breakpoint gets triggered. |
|
I just tried adding "opcache.optimization_level=0xFFFFFBFF" to my local file /etc/opt/remi/php73/php.d/9999-last.ini and it worked for me. |
|
Hi everybody, this turned out to be a bug in PHP's OPcache extension: https://bugs.php.net/bug.php?id=77287 — a fix for this was committed today, and will make it into the next PHP release (PHP 7.3.2). I will leave this issue open and linked to the 2.7.0 release. I intend to release 2.7.0 soon after PHP 7.3.2 is released. cheers, |
|
I can confirm that I'm no longer seeing segfaults while xdebug is loaded and active after building from the latest PHP-7.3 branch containing that fix. |
|
@mcfedr — It doesn't seem related. Please open a new issue, and make sure you make a gdb back trace, as the lldb one does not show any data. Alternative, please use valgrind to do memory analysis. There is a lot of information at https://xdebug.org/support.php#bugs that explain how to file a bug report in the most efficient way. (Once you've made it, I'll delete your comment and this one). |
|
I've just committed a fix to Xdebug that implements a workaround for this. This will be part of the soon-to-be-released 2.7.0rc1. |
|
opcache.optimization_level=0xFFFFFBFF helped also with problems on Debian with php7.3.1-1 and XDebug |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-10-25 10:27 | kmdm | New Issue | |
2018-10-25 10:53 | derick | Note Added: 0004712 | |
2018-10-25 10:53 | derick | Assigned To | => derick |
2018-10-25 10:53 | derick | Status | new => feedback |
2018-10-25 11:37 | kmdm | Note Added: 0004713 | |
2018-10-25 11:37 | kmdm | Status | feedback => assigned |
2018-12-10 22:54 | morozov | Note Added: 0004757 | |
2018-12-11 10:21 | kmdm | Note Added: 0004758 | |
2018-12-11 11:03 | derick | Note Added: 0004760 | |
2018-12-11 11:03 | derick | Status | assigned => confirmed |
2018-12-17 13:58 | ondrej | Note Added: 0004772 | |
2018-12-18 00:25 | superdav42 | Note Added: 0004773 | |
2018-12-18 10:13 | kmdm | Note Added: 0004774 | |
2018-12-18 13:41 | kmdm | Note Added: 0004776 | |
2019-01-02 10:34 | christianlupus | Note Added: 0004790 | |
2019-01-02 10:41 | derick | Note Added: 0004791 | |
2019-01-02 15:02 | aboks | Note Added: 0004792 | |
2019-01-02 17:32 | christianlupus | Note Added: 0004793 | |
2019-01-14 13:55 | attrib | Note Added: 0004801 | |
2019-01-17 11:51 | derick | Relationship added | has duplicate 0001607 |
2019-01-17 11:51 | derick | Relationship added | has duplicate 0001612 |
2019-01-17 12:13 | derick | Relationship added | has duplicate 0001592 |
2019-01-21 16:01 | kschroeder | Note Added: 0004820 | |
2019-01-22 21:24 | derick | Relationship added | has duplicate 0001590 |
2019-01-22 22:01 | derick | Note Added: 0004823 | |
2019-01-22 22:01 | derick | Target Version | => 2.7.0 |
2019-01-22 22:04 | derick | Relationship added | has duplicate 0001605 |
2019-01-22 22:25 | derick | Relationship added | has duplicate 0001588 |
2019-01-22 22:47 | dwilks | Note Added: 0004837 | |
2019-01-23 19:38 | derick | Relationship added | has duplicate 0001549 |
2019-01-23 19:39 | derick | Relationship deleted | has duplicate 0001549 |
2019-01-29 18:43 | derick | Note Added: 0004851 | |
2019-02-01 09:37 | derick | PHP Version | 7.3-dev => 7.3.0-7.3.1 |
2019-02-01 09:37 | derick | Status | confirmed => assigned |
2019-02-01 09:37 | derick | Target Version | 2.7.0 => 2.7.0rc1 |
2019-02-01 09:37 | derick | Summary | xdebug 2.7.0beta1 SIGSEGV while running some php scripts on PHP 7.3.0RC3 => Xdebug crashes when OPcache's compact literals optimisation is on |
2019-02-01 09:37 | derick | Steps to Reproduce Updated | |
2019-02-01 14:47 | derick | Note Added: 0004854 | |
2019-02-01 14:47 | derick | Status | assigned => closed |
2019-02-01 14:47 | derick | Resolution | open => fixed |
2019-02-01 14:47 | derick | Fixed in Version | => 2.7.0rc1 |
2019-02-01 15:23 | derick | Relationship added | has duplicate 0001600 |
2019-02-01 15:54 | Dietmar_42 | Note Added: 0004861 | |
2019-02-01 17:04 | derick | Relationship added | has duplicate 0001619 |
2020-03-12 16:43 | derick | Category | Feature/Change request => Step Debugging |