RFR: 8343756: CAN_SHOW_REGISTERS_ON_ASSERT for Windows [v2]
Markus Grönlund
mgronlun at openjdk.org
Wed Nov 13 17:25:10 UTC 2024
On Wed, 13 Nov 2024 14:07:24 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.hpp line 41:
>
>> 39: #define CAN_SHOW_REGISTERS_ON_ASSERT
>> 40: extern char* g_assert_poison;
>> 41: extern const char* g_assert_poison_page_for_reporting;
>
> This g_assert_poison_page_for_reporting only exists to recognize assert poison crash when the assert poison itself is disarmed, right? So, during error reporting?
>
> Makes sense but proposal for simplification:
> - have two pointers initialized to the poison at arm time. E.g. "g_assert_poison" (the real one) and "g_assert_poison_copy"
> - on disarm, switch g_assert_poison but leave the other unchanged
> - when checking, always check against the copy - it never changes
> - now you can unify the several code pieces that do `if ((si->si_signo == SIGSEGV || si->si_signo == SIGBUS) && si->si_addr == g_assert_poison_copy)` to something like `bool VMError::was_assertion_poison_crash(siginfo)`
void disarm_assert_poison() {
g_assert_poison_page_for_reporting = g_assert_poison;
g_assert_poison = &g_dummy;
}
Its only initialized when the real page deactivates. The purpose here for deactivation is to not get more traps, i.e. during further reporting?
g_assert_poison_page_for_reporting is only used in print_siginfo() to skip printing the sigInfo, only applies on Windows, I believe.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21994#discussion_r1840870438
More information about the hotspot-dev
mailing list