Skip to content

Commit d89b489

Browse files
committed
[GR-15252] Add documentation about signal handling, noting differences from MRI.
PullRequest: truffleruby/832
2 parents a0c4b47 + 3d2e35c commit d89b489

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

doc/user/compatibility.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,24 @@ streams do not provide a way to detect this.
182182
Error message strings will sometimes differ from MRI, as these are not generally
183183
covered by the Ruby Specification suite or tests.
184184

185+
#### Signals
186+
187+
The set of signals that TruffleRuby can handle is different from MRI. When
188+
launched as a GraalVM Native Image, TruffleRuby allows trapping all the same
189+
signals that MRI does, as well as a few that MRI doesn't. The only signals
190+
that can't be trapped are `KILL`, `STOP`, and `VTALRM`. Consequently, any
191+
signal handling code that runs on MRI can run on TruffleRuby without modification
192+
in the GraalVM Native Image.
193+
194+
However, when run on the JVM, TruffleRuby is unable to trap `USR1` or `QUIT`,
195+
as these are reserved by the JVM itself. Any code that relies on being able to
196+
trap those signals will need to fallover to another available signal. Additionally,
197+
`FPE`, `ILL`, `KILL`, `SEGV`, `STOP`, and `VTALRM` cannot be trapped, but these
198+
signals are also unavailable on MRI.
199+
200+
When TruffleRuby is run as part of a polyglot application, any signals that are
201+
handled by another language become unavailable for TruffleRuby to trap.
202+
185203
## Features with very low performance
186204

187205
#### `ObjectSpace`

0 commit comments

Comments
 (0)