RFR: 8294160: misc crash dump improvements [v2]

Dean Long dlong at openjdk.org
Wed Sep 28 04:06:21 UTC 2022


On Wed, 28 Sep 2022 01:24:34 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Dean Long has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   revert unneeded changes
>
> src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp line 357:
> 
>> 355:   // point to garbage if entry point in an nmethod is corrupted. Leave
>> 356:   // this at the end, and hope for the best.
>> 357:   address pc = os::fetch_frame_from_context(uc).pc();
> 
> What is the difference between `ucontext_get_pc(uc)` and getting the pc from the frame from the uc? How many pc's can a ucontext have?

The former returns the PC where the crash happened, which could be in unreadable memory.  Blindly inspecting that memory will cause error reporting to crash.  The latter returns the PC of a frame constructed from the context, and _possibly adjusted to reflect where the caller was when it made the bad call_, which is more useful for getting stack backtraces and less likely to crash error reporting.  When error reporting crashes we recover, but we don't get the information it was dumping when it crashed.

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

PR: https://git.openjdk.org/jdk/pull/10387


More information about the hotspot-dev mailing list