RFR: 8342607: Enhance register printing on x86_64 platforms

Thomas Stuefe stuefe at openjdk.org
Thu Oct 24 09:48:05 UTC 2024


On Thu, 24 Oct 2024 09:37:43 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

> > Thanks for your input @reinrich, @tstuefe. I've tried taking the values from `uc->uc_mcontext.fpregs->_xmm[i]`. This seems to work fine if we got a signal. However, "should_not_reach_here()" and friends don't trigger any signal. They call `MacroAssembler::debug64`.
> 
> odd. debug64 ends up calling fatal, which should use the assertion poison page to get a valid context. see debug.hpp.

to extend: we trigger an artificial segfault in fatal with the poison page, and grab that context. Generally that works. Question is why not here.

> > > Thanks for your input @reinrich, @tstuefe. I've tried taking the values from `uc->uc_mcontext.fpregs->_xmm[i]`. This seems to work fine if we got a signal. However, "should_not_reach_here()" and friends don't trigger any signal. They call `MacroAssembler::debug64`.
> > 
> > 
> > odd. debug64 ends up calling fatal, which should use the assertion poison page to get a valid context. see debug.hpp.
> 
> The [`ucontext_t` is memcpyed](https://github.com/openjdk/jdk/blob/f0b130e54f33d3190640ce33c991e35f27e9f812/src/hotspot/share/utilities/debug.cpp#L727). The `fpregs` pointer in the copy is probably invalid when used.

oh good point! I remember dealing with a similar problem on PPC years ago and implementing a deep copy somehow.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/21615#issuecomment-2434792978
PR Comment: https://git.openjdk.org/jdk/pull/21615#issuecomment-2434796142


More information about the hotspot-runtime-dev mailing list