Skip to content

[RFC] Improve tests to temporarily downgrade to Xdebug 3.4.1 due to segfaults #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

clue
Copy link
Member

@clue clue commented Mar 13, 2025

This changeset updates the test environment to work around a segfault with Xdebug 3.4.2. Right now, this causes an unrelated build error for all builds on Windows and macOS with PHP 8.1+ (see also clue/reactphp-redis#173 and clue/framework-x#276).

I've tried multiple approaches and it looks like this issue does not occur in Xdebug 3.4.1. The Linux builds happen to use the correct version, macOS can be downgraded just fine, but unfortunately I've been unable to downgrade on Windows (shivammathur/setup-php#923).

I wonder how widespread this problem would be exactly, as I don't see anything special that this project would execute (except perhaps for Fibers as of #296?). In either case, we should probably report this upstream to Xdebug and/or shivammathur/setup-php.

Builds on top of #321, #238 and clue/framework-x#276 and clue/reactphp-redis#173

@clue clue added this to the v3.0.0 milestone Mar 13, 2025
@clue clue requested review from WyriHaximus and PaulRotmann March 13, 2025 08:38
Copy link
Contributor

@PaulRotmann PaulRotmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, we should report the problem upstream to Xdebug in order to potentially find a final solution.

The workaround itself does solve the problem locally, but I can imagine that it might reappear at some point in the future and cost us a lot of time again.

By reporting the issue upstream, we might be able to resolve the problem at the root.

@WyriHaximus
Copy link
Member

I'm with @PaulRotmann on this one. This should be reported upstream first, and we should only implement it if it blocks us. Once the issue is resolved upstream, we can then revert that change.

Alternatively we could also consider using PCOV for coverage instead.

@clue
Copy link
Member Author

clue commented Apr 1, 2025

I've managed to come up with a reproducible script that shows this is a bug in Xdebug 3.4.2 only with nested fibers and have reported this upstream accordingly last week: https://bugs.xdebug.org/view.php?id=2332. This is something that took the better half of the day. The bad news is this is something that will affect pretty much any project using fibers and Xdebug with code coverage enabled. The good news is this should not affect production at least.

I'm not sure how to best proceed here at the moment. I think it's best resolved upstream and there's hope this will happen within a reasonable time frame. If not, we would have to go through all affected repositories (talking a few dozens here, times number of supported version branches), pin this to an old Xdebug version and eventually revert all these changes once an upstream fix is released. Fingers crossed we can avoid this.

@WyriHaximus
Copy link
Member

Lets wait before Derick replies about reverting the changes or not before considering that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants