Register output in assert case useful?

Thomas Stüfe thomas.stuefe at
Thu Oct 26 13:37:54 UTC 2017

Hi all,

when an assert happens, one does not have an ucontext_t and hence no
register context - that is why hs-err files generated by an assert do not
contain registers.

But sometimes there are cases where it would be useful to know the content
of registers at assert - e.g. to know the current stack depth, or because
remnants in registers may help with investigating.

At SAP we added a small feature to retrieve the current context when an
assert happens and make that part of the hs-err file. 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, so
this is as close to the assert point as possible (basically, just a read
access which is part of the assert macro).

I wonder whether there is interest in us contributing this?

Kind Regards, Thomas

More information about the hotspot-runtime-dev mailing list