Skip to content

Conversation

supermartian
Copy link

In some occasions, CGI processes will hang up if their signals are not processed properly.

@supermartian
Copy link
Author

Sorry, commit 88da485 didn't take interpreter into consideration. Please just take a look at 9bd6ec2.

@supermartian
Copy link
Author

The man page of execve says that "POSIX.1-2001 specifies one exception: if SIGCHLD is being ignored, then an implementation may leave the disposition unchanged or reset it to the default; Linux does the former."
So I think at least SIGCHLD should be set to default, and in case of any possible situations, I just reset all of them.
In fact, I do encountered the problem. When I was running this script(https://gist.github.com/4371205) as a CGI in Android, it hung. And this commit is my solution.

@cpq
Copy link
Member

cpq commented Dec 25, 2012

Right, I see. SIGCHLD is an exception.
Do you mind to make a change to reset SIGCHLD only, with a comment saying about POSIX exception please?
Then I'd be ready to merge.
Thank you very much!

According to POSIX.1-2001 and Linux's implementation, SIGCHLD's handler
will leave unchanged after execve if it was set to be ignored. Thus it
should be restored to SIG_DFL before execve.
@supermartian
Copy link
Author

Would that be OK? Sorry for my screwed commits...

@cpq
Copy link
Member

cpq commented Dec 25, 2012

To keep change history cleaner, I've integrated your change myself, and submitted 1eb719f.
Thank you!

@cpq cpq closed this Dec 25, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants