View Issue Details

IDProjectCategoryView StatusLast Update
0002311XdebugUncategorizedpublic2025-01-19 09:45
Reporterstanilnytskyi Assigned To 
PriorityhighSeveritycrashReproducibilityalways
Status assignedResolutionopen 
Product Version3.4.0 
Summary0002311: Segmentation fault on xdebug 3.4.0
Description

After upgrading from 3.2.1 to 3.4.0 some composer scripts are failing.

Steps To Reproduce

I attach my docker reproducer (just build container, all files and dependencies already included)
Just follow steps from REPRODUCER.md or see the video.

The docker:
https://drive.google.com/file/d/1JvYk4GBiiz9GTYtOZU6MBTkq5WwVY0F9/view?usp=drive_link

The video:
https://drive.google.com/file/d/1nMcMnA433IfLwJMB1GuGDQhIofNoyq9v/view?usp=sharing

I just run a script inside attached reproducer:

./vendor/bin/magento-patches -n status
Additional Information

Interestingly it work if xdebug mode is off

XDEBUG_MODE=off ./vendor/bin/magento-patches -n status

I tried to dig into the code and found it starts to fail after calling

$this->reviewAppliedAction->execute($input, $output, []); in \Magento\CloudPatches\Command\Process\ShowStatus::run

The method does not seem to be unusual, it's just a class like this: https://github.com/magento/magento-cloud-patches/blob/1.1.2/src/Command/Process/Action/ReviewAppliedAction.php

We upgraded form xdebug 3.2.1

The debugger config can be seen in ini files and .env.

We usually put xdebug into XDEBUG_MODE=develop,debug and enable listener on demand.

Tagscrash, segfault
Operating SystemLinux
PHP Version8.1.20-8.1.29

Activities

derick

2024-12-24 10:51

administrator   ~0007133

Please follow the instructions at https://xdebug.org/reporting-bugs while reporting bug reports.

This is however possibly a duplicate of https://bugs.xdebug.org/view.php?id=2307, which has reportedly been fixed with https://github.com/xdebug/xdebug/pull/987, and is part of the xdebug_3_4 branch on Github.

cheers,
Derick

stanilnytskyi

2024-12-24 12:02

reporter   ~0007134

Thanks for your reply,
What information can I provide in addition to attached reproducing environment?

I am not sure if this is exact duplicate of https://bugs.xdebug.org/view.php?id=2307
On my reproducer and my php + xdebug configs the code form that issue is not failing with segfault.
It do fails when I change mode and run as XDEBUG_MODE=develop,trace php test.php

To check if mentioned fix help should we to try to compile xdebug from latest xdebug_3_4 or wait for release of 3.4.1 ?

derick

2025-01-06 15:37

administrator   ~0007143

Xdebug 3.4.1 will be released imminently (an hour), so wait for that.

NicolasD

2025-01-07 11:35

reporter   ~0007145

On our side we still have the issue even after upgrading Xdebug to last release

PHP 8.3.15 (cli) (built: Dec 24 2024 22:23:49) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.3.15, Copyright (c) Zend Technologies
with Zend OPcache v8.3.15, Copyright (c), by Zend Technologies
with the ionCube PHP Loader v14.0.0, Copyright (c) 2002-2024, by ionCube Ltd.
with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans

derick

2025-01-07 15:21

administrator   ~0007146

@NicolasD — Xdebug does not support being loaded with ionCube at the same time. Can you disable that? And if you can still reproduce it, please create a new issue as it is likely different than this one.

stanilnytskyi

2025-01-08 10:49

reporter   ~0007147

I did some extended testing with my reproducer and xdebug 3.4.1

The issue still present
But it only fails for develop mode

Works OK:
XDEBUG_MODE=debug ./vendor/bin/magento-patches -n status

Works NOT OK:
XDEBUG_MODE=develop ./vendor/bin/magento-patches -n status

I use this env
XDEBUG_MODE=develop,debug

Current setup:

PHP 8.1.23 (cli) (built: Sep 20 2023 19:22:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.23, Copyright (c) Zend Technologies
with Zend OPcache v8.1.23, Copyright (c), by Zend Technologies
with Xdebug v3.4.1, Copyright (c) 2002-2025, by Derick Rethans
with blackfire v1.92.31~linux-x64-non_zts81, https://blackfire.io, by Blackfire

I wondered if XDEBUG_MODE=develop might conflict with other profilers like blackfire and spx due to function overloading or neighbors decorators overlapping. But it previously worked just fine to me.

I also followed some steps with GDB and got this result:

Starting program: /usr/local/bin/php ./vendor/bin/magento-patches -n status
warning: Error disabling address space randomization: Operation not permitted
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Patch details you can find on https://experienceleague.adobe.com/tools/commerce-quality-patches/index.html (search for patch id, ex. MDVA-30265)
Release notes https://experienceleague.adobe.com/docs/commerce-operations/tools/quality-patches-tool/release-notes.html
[Detaching after fork from child process 418]
[Detaching after fork from child process 419]

Program received signal SIGSEGV, Segmentation fault.
0x00007f01b125b929 in zval_from_stack_add_frame_variables (opa=0x7f01af72fc00, symbols=<optimized out>, edata=0x7f01b1415dc0,
frame=0x7f01b14621d0) at /tmp/pear/temp/xdebug/src/develop/stack.c:431
431 /tmp/pear/temp/xdebug/src/develop/stack.c: No such file or directory.

full output in gdb.txt

tefxacn

2025-01-19 09:45

reporter   ~0007161

Do you still get this error without blackfire too?
I had/have a similar issue and while checking various similar issues, one common thing was that blackfire was being used