-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Uncaught USR2 signal kills the whole JVM with SIGSEGV #5049
Comments
@perlun Maybe this wiki article adds detail to "USR2 is... taken" https://github.com/jruby/jruby/wiki/Signal-Handling#jvm-occupied-signals |
Yeah, I noted that detail also. But on this JVM incarnation, catching USR2 typically works (in the Puma use case described above.) so I think that this is not the root cause for the problem in this case. |
@olleolleolle mentioned the
(Note: I don't know what a suitable setting for |
Confirmed on MacOS too. Looking at the crash dump, it does not look like JRuby is involved in the crash itself:
And if I kill from the command line it appears to have the same effect. And if I just launch a Java-only app, it also has the same effect.
So I'm afraid you'll have to take this one up with JVM folks. Of course that kinda includes me. Check out the OpenJDK bug tracker and see if anyone else has reported this. If not, I'll file an issue. |
Thanks @headius. Unfortunately, the OpenJDK bug tracker isn't publicly accessible; I cannot enter a bug there without becoming a "project author" or similar. Since I'm not working on the JDK (at least not at the moment 😄) this is not easily doable for me. I could file it via https://bugreport.java.com though. Would you mind filing this via the OpenJDK bug tracker for me? You have already done some of the important research here so it shouldn't be so much work; we could probably just copy-paste the relevant parts from here. |
@perlun Yes, I know you can't file anything, but I thought you might poke around and see if there's any existing issue. I'm happy to file a proper report once we determine nobody else has done so. |
Alright. I will check a bit more first, thanks. Will ping you again if needed here. |
@headius Long time no see, but: I finally got down to cleaning out my email inbox and revisited this issue. I looked at https://bugs.openjdk.java.net/projects/JDK/issues/, searched for USR2 but couldn't find any open issue about it. I also revisited your
Please submit this to the OpenJDK bug tracker so it can be reported upstream. Thanks a lot in advance. |
Environment
jruby -v
) and command line (flags, JRUBY_OPTS, etc): 9.1.15.0, no command line flags or JRUBY_OPTS needed to reproduce.uname -a
): macOS 17.4.0 and Linux 4.14.12.Expected Behavior
Raising the USR2 signal with no USR2 signal handler defined should output a message, like on MRI.
Actual Behavior
It kills the whole JVM with a SIGSEGV:
I set up this repro repo which also documents my findings a bit: https://github.com/perlun/jruby-core-dump. Here is the failing Travis job: https://travis-ci.org/perlun/jruby-core-dump/jobs/342244129
(I didn't include the coredump in this case since it's so easily reproducible, but let me know if you want it and I can post it somewhere.)
The easiest way to trigger this is by simply running
ruby -e "Process.kill('USR2', Process.pid)"
. On MRI 2.3.6 and 2.5.0, this works fine - it prints a harmless message saying "User defined signal 2: 31". On JRuby OTOH, it kills the whole process.I tried handling the signal to see if it makes an exception (I know it normally works, since Puma uses USR2 and it works fine on JRuby), but my code below didn't behave as expected:
The "USR2 raised" message was printed out on MRI, but on JRuby nothing was printed. It didn't kill the process though, so it seems like it's the "signal unhandled" scenario that triggers this bug/difference in behavior.
The text was updated successfully, but these errors were encountered: