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

Skip to content

Why are these "sigchild"-related things in place in Process? #16888

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

Closed
nicolas-grekas opened this issue Dec 7, 2015 · 3 comments
Closed

Why are these "sigchild"-related things in place in Process? #16888

nicolas-grekas opened this issue Dec 7, 2015 · 3 comments
Labels

Comments

@nicolas-grekas
Copy link
Member

I'd like to ask for some pointers about the special handling of --enable-sigchild php in the Process component.
I'm currently trying with such a php, I'm able to reproduce https://bugs.php.net/25727 , but not when using proc_open.
Do we really need these hacks? Can someone give me sample tests / reports?

@xabbuh xabbuh added the Process label Dec 7, 2015
@xabbuh
Copy link
Member

xabbuh commented Dec 7, 2015

@nicolas-grekas The only thing I can tell you that all tests from the dedicated test class where failing for me when I worked on a bug fix on the past and tried to execute it with a PHP environment that was not compiled with the desired flag. Not sure if that is of any help for you, but you can start by compiling PHP that way and try to reproduce this behaviour (if that isn't what you are actually talking about, in that case we might need to compare envs in more detail).

@romainneutron
Copy link
Contributor

See the original PR #5353

PHP compiled with --enable-sigchild basically fails to return exit codes, and randomly returns -1 instead most of the time (see https://bugs.php.net/bug.php?id=29123).

This works around it by having the exit code going through another pipe. It's enabled by default for linux because the new pipe trick won't work on windows I think, but that's unlikely to be an issue because most people don't compile their own php there.

I could have it enabled only when sigchild is enabled using the code below, but obviously that adds some overhead, so I'm not sure what's worst.

And the second one that enabled the compatibility flag #5543

@romainneutron
Copy link
Contributor

And the actual PHP bug is https://bugs.php.net/bug.php?id=29123

nicolas-grekas added a commit that referenced this issue Dec 10, 2015
…olas-grekas)

This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Enhance compatiblity with --enable-sigchild

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #16888
| License       | MIT
| Doc PR        | -

This is complete rewrite of the fallback `--enable-sigchild` handling in the Process class.
It removes most of the differences between this and a non-sigchild-enabled php.
Which means the test suite doesn't need anymore to be replayed 3 times (which is how I started this PR, looking for a way to test this component in less time).

I validated this with a locally compiled php, sigchild-enabled. Green.
Changes affect only this special-mode php.

Ping @romainneutron and @Seldaek (original writer of the sigchild support)

Submitted on 2.3 as bugfix, which it is to me.

Commits
-------

e7cc4aa [Process] Enhance compatiblity with --enable-sigchild
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants