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
Ctrl+C does not kill gcc #4443
Comments
Copied from conda-build. I'm not sure yet whether this is a bug in conda or conda-build. In my searches through conda's code, there were no changes to code involving KeyboardInterrupt between 4.2.x and 4.3.x. Still, this bug is present with conda 4.3.x and not 4.2.x, so it seems to be some exception swallowing added in 4.3.x. |
Yes, there's a signal handler in 4.3. It's invoked and registered anytime logging is also configured. https://github.com/conda/conda/blob/4.3.x/conda/gateways/signals.py I've created a pull request to handle signal forwarding better: #4447 I've based what I'm doing in the PR on advice from http://stackoverflow.com/questions/13593223/making-sure-a-python-script-with-subprocesses-dies-on-sigint |
Is this fixed in 4.3.9? It looks like #4447 landed in that version. |
@kalefranz this is still an issue with conda 4.3.11. I don't understand your response, though - is this something you're working on fixing in conda, or is it like logging where it needs some fix on the conda-build side too? |
@kalefranz can you please update this issue with current status? I've just received a report from Samsung that they are using the latest conda from canary and are still seeing this issue. |
Full history of this issue can be tracked from #5133 (comment) I think. There's also #5135. The only reason conda needs to deal with signal handlers at all is to be able to attempt a rollback during an install transaction if a signal is sent mid-transaction. I've spent time with http://stackoverflow.com/questions/13593223/making-sure-a-python-script-with-subprocesses-dies-on-sigint and implemented pretty much every suggestion in there. If anybody has any more ideas, please share! |
As in that stack overflow link, whenever conda-build subprocesses, it should also be sure it's forwarding signals to child processes, apparently by setting stdin as PIPE. |
conda-build is also free to use https://github.com/conda/conda/blob/master/conda/gateways/subprocess.py#L38-L60 |
@msarahan Have we made progress on this at all in recent versions of conda? Do you feel like it's getting better at least? |
I'm going to close this issue for now. For the conda-build case in particular, I think it should mostly be solved with registering signal handlers only right before executing unlink-link transactions, and the deregistering them afterward. In the initial implementation for signal handling, conda registered signal handlers on import, and then kept them registered. |
Hi there, thank you for your contribution to Conda! This issue has been automatically locked since it has not had recent activity after it was closed. Please open a new issue if needed. |
@sscherfke commented on Fri Jan 27 2017
If I build a C-lib with conda-build, I can no longer cancel the build using
Ctrl-C
. Conda itself will die, but the compiler processes will continue to run. It looks like the signals are not (or no longer) forwared to all sub processes.@msarahan commented on Fri Jan 27 2017
Confirmed. Switching to conda 4.2.x fixes it for me. Leaving this issue here until I can isolate it further.
The text was updated successfully, but these errors were encountered: