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

SIGINT handling doesn't play well with others #3

Closed
jtlapp opened this issue Dec 19, 2016 · 1 comment
Closed

SIGINT handling doesn't play well with others #3

jtlapp opened this issue Dec 19, 2016 · 1 comment
Assignees
Labels

Comments

@jtlapp
Copy link
Owner

jtlapp commented Dec 19, 2016

@banjocat on Stackoverflow points out that the SIGINT processing is all wrong.

According to this detailed explanation of SIGINT handling, a process can't just catch SIGINT and exit because (1) the front-most process might intercept and inhibit the signal and (2) a process cannot communicate SIGINT to its caller via exit(). Instead, a caller should only process SIGINT after its children have exited for SIGINT, if they choose to exit, and the process should exit on SIGINT by sending SIGINT to itself and not catching it on the second round.

The same issues apparently apply to SIGQUIT.

To correct the problem, the handler should only conditionally process SIGINT when it has no child processes, and it will have to uninstall itself before sending a SIGINT to itself to finally exit.

@jtlapp jtlapp added the bug label Dec 19, 2016
@jtlapp jtlapp self-assigned this Dec 19, 2016
@jtlapp
Copy link
Owner Author

jtlapp commented Dec 24, 2016

I rewrote the module to resolve this and related issues.

@jtlapp jtlapp closed this as completed Dec 24, 2016
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

1 participant