That works similar to the SafeFetch logic: when an assert happens, we trigger a segfault and in the signal handler we squirrel the ucontext away, before continuing with error reporting.
We do this right after the assert condition was evaluated, within the assert macro itself, as to preserve the context as close to the assertion point as possible.
A short poll on hotspot-runtime-dev [1] indicated that there is interest we contribute this feature.
[1] http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2017-October/025018.html
- relates to
-
JDK-8200608 Build failures after JDK-8191101 (Show register content in hs-err file on assert)
- Resolved
-
JDK-8216982 Assertion poison page established too early
- Resolved
-
JDK-8225703 crash_handler code makes safepoint polling threads look like they crashed
- Closed
-
JDK-8214229 Enable ShowRegistersOnAssert by default
- Resolved
-
JDK-8227275 Within native OOM error handling, assertions may hang the process
- Resolved
-
JDK-8212913 (Nested)ThreadsListHandleInErrorHandlingTest need to disable ShowRegistersOnAssert
- Resolved
-
JDK-8251383 Disable Event::log from linux_mprotect when processing the assertion poison page
- Resolved
-
JDK-8343756 CAN_SHOW_REGISTERS_ON_ASSERT for Windows
- Resolved