Skip to content

Commit 40c19f0

Browse files
author
duke
committed
Automatic merge of jdk:master into master
2 parents b9d0075 + aa2862a commit 40c19f0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/hotspot/os_cpu/linux_zero/os_linux_zero.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,16 @@ JVM_handle_linux_signal(int sig,
240240
}
241241
#endif // !PRODUCT
242242

243-
char buf[64];
244-
245-
sprintf(buf, "caught unhandled signal %d", sig);
243+
char buf[128];
244+
char exc_buf[32];
245+
246+
if (os::exception_name(sig, exc_buf, sizeof(exc_buf))) {
247+
bool sent_by_kill = (info != NULL && os::signal_sent_by_kill(info));
248+
snprintf(buf, sizeof(buf), "caught unhandled signal: %s %s",
249+
exc_buf, sent_by_kill ? "(sent by kill)" : "");
250+
} else {
251+
snprintf(buf, sizeof(buf), "caught unhandled signal: %d", sig);
252+
}
246253

247254
// Silence -Wformat-security warning for fatal()
248255
PRAGMA_DIAG_PUSH

0 commit comments

Comments
 (0)