Open deepj opened 4 years ago
https://github.com/jruby/jruby/wiki/Signal-Handling this page from the JRuby wiki deals with signals. It has a note about the SIGINT kind of being "taken". Does that apply to the TruffleRuby situation, too?
Also does the same happen to JRuby?
TruffleRuby Native (used here) supports the same signals as MRI, and has the same signal semantics. In fact, it supports even more signal handlers. This is documented in https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md#signals
https://github.com/ruby/spec/blob/ebdf0d1b06b39374a85baaae53771449ab1fe3d7/core/signal/trap_spec.rb#L121-L133 lists the reserved signals per Ruby implementation. TruffleRuby JVM cannot trap SIGUSR1
and SIGQUIT
but otherwise can trap all other signals MRI can trap.
Also, TruffleRuby has the same default SIGINT handler as MRI.
So the error here is not about signal availability but somehow something going wrong when receiving that signal. It looks a signal is sent while the context is closing. https://github.com/oracle/truffleruby/issues/1823#issuecomment-603674696 looks like another, maybe related issue. I'll try to reproduce.
I can reproduce.
The most likely reason it doesn't work here is that agoo
registers the signal handlers not using Ruby Signal.trap
but using C code: https://github.com/ohler55/agoo/blob/3a73cbfd6c5afc374d63c2cc07ffa4a8b8d39c97/ext/agoo/agoo.c#L119-L129
agoo --help
just quits on MRI, not sure why it hangs on TruffleRuby.
Maybe related to agoo overriding the VM-reserved signal SIGVTALRM (it's also reserved on MRI), which might break many things: https://github.com/ohler55/agoo/blob/3a73cbfd6c5afc374d63c2cc07ffa4a8b8d39c97/ext/agoo/agoo.c#L123-L126
Closed due to I'm not welcome anymore in Ruby community
To reproduce:
Then
Ctrl-C
Error: