Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Console] Correctly convert SIGSYS to its name #60168

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
merged 1 commit into from
Apr 7, 2025

Conversation

cs278
Copy link
Contributor

@cs278 cs278 commented Apr 7, 2025

Q A
Branch? 6.4
Bug fix? yes
New feature? no
Deprecations? no
Issues N/A
License MIT

Because of a PHP easter egg using the SignalMap::getSignalName() method with SIGSYS results in 'SIGBABY' instead of the expected 'SIGSYS' being returned.

https://github.com/php/php-src/blob/213949dc340e17b7234c8a753703b1ab455c8585/ext/pcntl/pcntl_arginfo.h#L398-L400

require 'vendor/autoload.php';
var_dump(Symfony\Component\Console\SignalRegistry\SignalMap::getSignalName(SIGSYS));
// string(7) "SIGBABY"

@cs278 cs278 requested a review from chalasr as a code owner April 7, 2025 15:59
@carsonbot carsonbot added this to the 6.4 milestone Apr 7, 2025
@OskarStark
Copy link
Contributor

giphy

@carsonbot carsonbot changed the title Correctly convert SIGSYS to its name [Console] Correctly convert SIGSYS to its name Apr 7, 2025
@nicolas-grekas
Copy link
Member

Thank you @cs278.

@nicolas-grekas nicolas-grekas merged commit aa40689 into symfony:6.4 Apr 7, 2025
9 of 11 checks passed
@cs278 cs278 deleted the sigbaby branch April 7, 2025 20:04
This was referenced May 2, 2025
fabpot added a commit that referenced this pull request May 7, 2025
This PR was merged into the 6.4 branch.

Discussion
----------

don't hardcode OS-depending constant values

| Q             | A
| ------------- | ---
| Branch?       | 6.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        |
| License       | MIT

The values of the `SIG*` constants depend on the OS.

For example, on macOS the value of the `SIGSYS` constant is 12 and not 31 making the test added in #60168 fail.

Commits
-------

3213d88 don't hardcode OS-depending constant values
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.

4 participants