Skip to content

Commit d0bbc7f

Browse files
committed
Do not fail when signal handling machinery is unavailable in AgentPremain
1 parent 22f6ca8 commit d0bbc7f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/kotlinx-coroutines-debug/src/AgentPremain.kt

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ internal object AgentPremain {
1919
}
2020

2121
private fun installSignalHandler() {
22-
Signal.handle(Signal("TRAP") ) { // kill -5
23-
DebugProbes.dumpCoroutines()
22+
try {
23+
Signal.handle(Signal("TRAP")) { // kill -5
24+
DebugProbes.dumpCoroutines()
25+
}
26+
} catch (t: Throwable) {
27+
System.err.println("Failed to install signal handler: $t")
2428
}
2529
}
2630
}

0 commit comments

Comments
 (0)