RFR: 8343756: CAN_SHOW_REGISTERS_ON_ASSERT for Windows [v2]
Markus Grönlund
mgronlun at openjdk.org
Wed Nov 13 17:21:57 UTC 2024
On Wed, 13 Nov 2024 14:00:10 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:
>> Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:
>>
>> initialize report page
>
> src/hotspot/share/utilities/debug.cpp line 192:
>
>> 190: #ifdef CAN_SHOW_REGISTERS_ON_ASSERT
>> 191: if (os::current_thread_id() == g_asserting_thread) {
>> 192: context = os::get_saved_assert_context(&siginfo);
>
> I would leave the `g_assertion_context != nullptr` in. It should not happen, but its defensive and a bug at this point is difficult to figure out (because you just don't get a hs-err file)
The g_assertion_context is a ucontext_t, which is why it cannot be in debug.cpp.
The same test for nullptr exist in the os::get_saved_assert_context(), i.e. if the ucVoid came in as nullptr, then it is not saved, _has_saved_context == false. But if ucVoid came in as nullptr, then also os::current_thread_id() != g_asserting_thread, so I think it is sufficient.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21994#discussion_r1840862225
More information about the hotspot-dev
mailing list