RFR: 8316309: AArch64: VMError::print_native_stack() crashes on Java native method frame [v2]
Patricio Chilano Mateo
pchilanomate at openjdk.org
Fri Sep 29 16:35:32 UTC 2023
On Fri, 29 Sep 2023 13:14:28 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> Patricio Chilano Mateo has updated the pull request incrementally with two additional commits since the last revision:
>>
>> - add comment to tests
>> - use driver + @requires vm.flagless
>
> src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp line 170:
>
>> 168: bool use_codeblob = cb != nullptr && cb->frame_size() > 0;
>> 169: assert(!use_codeblob || !Interpreter::contains(pc), "should not be an interpreter frame");
>> 170: intptr_t* sender_sp = use_codeblob ? (fr->link() + frame::metadata_words - cb->frame_size()) : fr->link();
>
> Is this assuming that, if the caller is a native frame, the current FP will point to the lowest word in the caller's stack frame?
If this is a native frame the current FP would point to the current's frame lowest address. The value stored there would be the sender's FP. If the sender is also a native frame, then that value would just point to the lowest address of that frame. If the sender is a frame associated with some CodeBlob and we know its size then the sender's FP would point two words below the highest address of that frame (unless the sender's FP value is wrong but then _unextended_sp would be wrong anyways if we set it to the sender's FP as the old code) and we can calculate the actual _unextended_sp so that when getting the sender of that frame we don't crash.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15972#discussion_r1341523258
More information about the hotspot-dev
mailing list