RFR: 8358725: RunThese30M: assert(nm->insts_contains_inclusive(original_pc)) failed: original PC must be in the main code section of the compiled method (or must be immediately following it)

Dean Long dlong at openjdk.org
Wed Oct 29 22:36:05 UTC 2025


On Wed, 29 Oct 2025 05:01:28 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> The problem is code called from a signal handler, like SharedRuntime::handle_unsafe_access(), can call os::malloc(), and when NMT is enabled, we try to get a stack backtrace.  But os::get_native_stack() does not know how to walk through signal handler frames.
>> 
>> This fix introduces FirstNativeFrameMark to be used by the POSIX version of os::get_native_stack() to set a frame to stop at in the POSIX signal handler.
>
> src/hotspot/os/posix/signals_posix.cpp line 575:
> 
>> 573:   // We are called from a signal handler, so stop the stack backtrace here.
>> 574:   // See os::is_first_C_frame() in os::get_native_stack().
>> 575:   os::FirstNativeFrameMark fnfm;
> 
> Won't this break stack-walking in hs_err file generation when we get a SEGV for example?

Yes, I suppose so.  Good catch.  We shouldn't consider the "first frame" marker if we are starting before it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27985#discussion_r2475788254


More information about the hotspot-runtime-dev mailing list