When crashing and writing an error log, error reporting steps may hang for any number of reasons.
JDK-8166944 (https://bugs.openjdk.java.net/browse/JDK-8166944) added the ability to interrupt hanging error reporting steps in order to allow subsequent steps to run. This works fine, but testing uncovered another bug, discovered by @Chris Plummer, where a crash or timeout happening after the error log is written and before the error reporter had a chance to run would lead to infinitely repeated error reports. This would be repeated until either the reporting thread runs out of stack space or until the ErrorLogTimeout hits.
The reason for this is that, when a secondary error happens, VMError::report_and_die() is re-invoked from the signal handler in a new frame and error reporting is continued from the last error reporting step - if the crash happened inside VMError::report(), where the actual error reporting happens. However, if the crash happens in the caller function VMError::report_and_die() - specifically, after VMError::report() is called and before the log_done flag is set - we wil re-enter VMError::report_and_die and re-execute VMError::report.
The reason for this is that, when a secondary error happens, VMError::report_and_die() is re-invoked from the signal handler in a new frame and error reporting is continued from the last error reporting step - if the crash happened inside VMError::report(), where the actual error reporting happens. However, if the crash happens in the caller function VMError::report_and_die() - specifically, after VMError::report() is called and before the log_done flag is set - we wil re-enter VMError::report_and_die and re-execute VMError::report.
- relates to
-
JDK-8156823 VMError::report_and_die() hangs during malloc call
-
- Resolved
-
-
JDK-8166944 Hanging Error Reporting steps may lead to torn error logs.
-
- Resolved
-