8332894: ubsan: vmError.cpp:2090:26: runtime error: division by zero

Reviewed-by: dholmes, stuefe
This commit is contained in:
Matthias Baesken 2024-05-27 10:27:41 +00:00
parent 0e7ea390bb
commit 1b8dea4a92

View File

@ -2082,8 +2082,13 @@ bool VMError::check_timeout() {
#ifdef ASSERT
typedef void (*voidfun_t)();
// Crash with an authentic sigfpe
// Crash with an authentic sigfpe; behavior is subtly different from a real signal
// compared to one generated with raise (asynchronous vs synchronous). See JDK-8065895.
volatile int sigfpe_int = 0;
#if defined(__clang__) || defined(__GNUC__)
__attribute__((no_sanitize("undefined")))
#endif
static void ALWAYSINLINE crash_with_sigfpe() {
// generate a native synchronous SIGFPE where possible;