RFR: 8282306: os::is_first_C_frame(frame*) crashes on invalid link access [v2]

Johannes Bechberger duke at openjdk.java.net
Wed Feb 23 21:58:56 UTC 2022


On Wed, 23 Feb 2022 20:33:28 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Do all these extra checks need to be done in product bits or would debug-only work? What kind of errors are we trying to guard against by doing this?

They currently do not affect production code, but I forgot that the `NativeCallStack` class exists that can make use of it (especially when using the simpler API as @tstuefe correctly proposed).

The main motivation is to prevent crashes in native stack walking in cases where just calling `frame.is_safe_for_sender` would return false, but a walk is still possible (typically on the bottom of the native call stack). I currently observe these crashes while walking on AsyncGetCallTrace modifications.

And to @tstuefe:

> But bottom line, I think safefetch would be a simpler and more robust approach.

Thanks for the comment. I missed that safefetch does exactly what I want,and hopefully without a large performance penalty?).

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

PR: https://git.openjdk.java.net/jdk/pull/7591


More information about the hotspot-dev mailing list