Skip to content

[Console]  Fix signal handlers called after event listeners and skip exit #48210

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

Merged

Conversation

GromNaN
Copy link
Member

@GromNaN GromNaN commented Nov 13, 2022

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #48205
License MIT
Doc PR -

Restore registration of signal handlers after the event dispatcher.
https://github.com/symfony/symfony/pull/45333/files#diff-8f1fd83284712ab08cb5d391da70ea0e78719ef08db852596997a4085848a026L1009

@GromNaN GromNaN requested a review from chalasr as a code owner November 13, 2022 23:02
@carsonbot carsonbot added this to the 5.4 milestone Nov 13, 2022
@carsonbot carsonbot changed the title [Console] Fix signal handlers called after event listeners and skip exit [Console]  Fix signal handlers called after event listeners and skip exit Nov 13, 2022
@nicolas-grekas
Copy link
Member

Thank you @GromNaN.

@nicolas-grekas nicolas-grekas merged commit b0e1f66 into symfony:5.4 Nov 14, 2022
@GromNaN GromNaN deleted the 5.4-signal-hander-after-event-listeners branch November 14, 2022 11:24
@fabpot fabpot mentioned this pull request Nov 19, 2022
@Naktibalda
Copy link
Contributor

This change causes Segmentation fault when Xdebug path coverage is enabled.

@Naktibalda
Copy link
Contributor

Naktibalda commented Nov 20, 2022

I really can't blame this change, because in my case $commandSignals is empty, but foreach call itself causes segmentation fault much further down the line. (Removing foreach solves my problem).

Also this change only causes segmentation fault when used in combination with Codeception 5 and PHPUnit's main branch.
I can't create smaller sample than this: https://github.com/Naktibalda/codeception-segfault
Xdebug bug report https://bugs.xdebug.org/view.php?id=2108
Similar segmentation fault was caused and quickly fixed by moving signal code back in August.

@GromNaN
Copy link
Member Author

GromNaN commented Nov 21, 2022

It might be possible to prevent this issue by wrapping the foreach in an if ($commandSignals) { ... } but that will not solve it when command signal are actually used.

This was referenced Nov 28, 2022
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.

6 participants