-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 randomly breaks out of Julia #9544
Comments
thanks for that analysis! we have no less than 3 independent mechanisms for trapping async signals on windows (unix has 1). but
|
what terminal client are you using (e.g. mintty, cygwin, conemu, command prompt, powershell, etc)? they each have their own quirks about how they deliver signals also, a more direct test: begin; while true; Base.sigatomic_begin(); sleep(1); Base.sigatomic_end(); end; end
^C |
That patch works equally well for me. Are there any potential problems related to not using the value of jl_signal_pending, which contains the actual signal code? While we're at it, I also seem to be able to fairly consistently trigger OpenBLAS-related
|
the signal code is always set to SIGINT, so no it's not a concern (if it ever becomes a concern, we could write a stub function that dispatches as needed, and still avoids the need to call raise) the second issue you mention is probably #2622 |
I'm running your direct test, but for the first few minutes I see nothing special with either patched or unpatched versions. Maybe deferred signals are rare under this setup? BTW, I'm using the command prompt, but getting somewhat fed up with the copy-paste behavior. |
Sorry, I missed the I agree about the second issue. |
@vtjnash seems like this can cause a segfault even on linux https://travis-ci.org/JuliaLang/julia/jobs/45657098 |
Master works for me now, thanks for fixing. |
though the intermittent codegen segfaults on CI are no good... |
Given the CI instability this one has caused, I don't think backporting this for 0.3.5 is a good idea. We can give it more testing time for 0.3.6. |
Likewise here, I don't plan on backporting the fix for this myself because it has messy conflicts that I don't know how to resolve. If anyone would like to see this resolved on 0.3.7 or later, please prepare a PR against release-0.3. |
Windows signal handling seems to be slightly broken in that
Ctrl-C
randomly exits Julia without any messages, like this:Based on some debugging this is related to the
jl_defer_signal
flag in the sense that non-deferred signals work whereas deferred signals cause an exit to the command prompt.My take is that the code translates the Windows signal
CTRL_C_EVENT
toSIGINT
and later, in case of deferred signals, callslibc
raise()
in theJL_SIGATOMIC_END
macro with the translated signal, which for some reason causes a different behavior than the original signal would have.The following patch seems to remove the symptoms, but since I guess it effectively removes the signal translation layer I'm not all that sure of the correctness:
Edit: I'm using master
Edit2: 32-bit build
The text was updated successfully, but these errors were encountered: