Skip to content
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

Simplify signal handling using sigwait, eliminate some undefined behavior #72

Merged
merged 1 commit into from
Apr 30, 2016

Conversation

chriskuehl
Copy link
Contributor

This fixes #58 by processing signals synchronously. It simplifies our code because we don't need to worry about all the special cases that exist for asynchronous signal handlers (there are lots of them).

There shouldn't be any behavior changes here. All existing tests (which are pretty comprehensive) passed, with the exception of the one that tests debug output (since we now report when we get SIGCHLD as well if running in verbose/debug mode).

This also drops the use of signal which @kpengboy pointed out.

@asottile
Copy link
Contributor

🚢 nice

@chriskuehl chriskuehl merged commit 6449c1a into Yelp:master Apr 30, 2016
PhilippWendler added a commit to sosy-lab/benchexec that referenced this pull request Oct 17, 2016
Inspired by Yelp/dumb-init#72.
In container mode, we need to have a process that acts as PID 1
and forwards all signals to the actual benchmarked process
(while at the same time waiting for this process to finish).
We can do this with sigwait instead of asynchronous signal handlers,
which is less and complex and avoids some signal handling problems.
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.

UB in signal_handler
2 participants