Skip to content

Commit 5bd684f

Browse files
committed
[GR-24622] Show stacktrace on SIGQUIT on Native Image for the truffleruby launcher.
PullRequest: truffleruby/1755
2 parents e23b835 + 0bdafa8 commit 5bd684f

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ New features:
1111
* Add basic support for Linux ARM64.
1212
* `foreign_object.name = value` will now call `Interoplibrary#writeMember("name", value)` instead of `invokeMember("name=", value)`.
1313
* Always show the Ruby core library files in backtraces (#1414).
14+
* The Java stacktrace is now shown when sending SIGQUIT to the process, also on TruffleRuby Native, see [Debugging](doc/user/debugging.md) for details (#2041).
1415

1516
Bug fixes:
1617

doc/user/debugging.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ Java exceptions can be printed with `--exceptions-print-uncaught-java` or
1414

1515
See other `--backtraces-*` and `--exceptions-*` options for more possibilities.
1616

17+
## Printing Stacktraces and Backtraces of a running Process
18+
19+
One can send the `SIGQUIT` signal to TruffleRuby to make it print the Java stacktraces of all threads.
20+
`Ctrl + \ ` can be used to send `SIGQUIT` to the current process in a terminal.
21+
This is useful to debug hangs, deadlocks or know what the process is doing.
22+
This works on both TruffleRuby Native and JVM.
23+
24+
Sending `SIGALRM` to a TruffleRuby process will print the Ruby backtraces of all threads.
25+
Note that printing the Ruby backtraces of all threads significantly lowers
26+
performance, so it should only be used for debugging.
27+
1728
## More Information in Backtraces
1829

1930
We try to match MRI's backtrace format as closely as possible. This sometimes means

mx.truffleruby/mx_truffleruby.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ def verify_ci(args):
219219
jar_distributions=['truffleruby:TRUFFLERUBY-LAUNCHER'],
220220
main_class='org.truffleruby.launcher.RubyLauncher',
221221
build_args=[
222+
'-H:+DumpThreadStacksOnSignal',
222223
'-H:+DetectUserDirectoriesInImageHeap',
223224
'-H:+TruffleCheckBlackListedMethods',
224225
],

mx.truffleruby/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{
88
"name": "sulong",
99
"subdir": True,
10-
"version": "89aaf872689d47977073e0b87f7e12c8f28bc44e",
10+
"version": "8b8603b39b55288db5e23750066efbd6d52ee2db",
1111
"urls": [
1212
{"url": "https://github.com/oracle/graal.git", "kind": "git"},
1313
{"url": "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind": "binary"},

0 commit comments

Comments
 (0)