RFR: 8296469: Instrument VMError::report with reentrant iteration step for register and stack printing [v12]

Thomas Stuefe stuefe at openjdk.org
Tue May 16 09:40:54 UTC 2023


On Tue, 16 May 2023 09:31:32 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> Add reentrant step logic to VMError::report with an inner loop which enable the logic to recover at every step of the iteration.
>> 
>> Before this change, if printing one register/stack position crashes then no more registers/stack positions will be printed.
>> 
>> After this change even if the VM is unstable and some registers print_location crashes the hs_err printing will recover and keep attempting to print the rest of the registers or stack values.
>> 
>> Enables the following
>> ```C++
>> REENTRANT_STEP_IF("printing register info", _verbose && _context && _thread && Universe::is_fully_initialized())
>>   os::print_register_info_header(st, _context);
>> 
>>   REENTRANT_LOOP_START(os::print_nth_register_info_max_index())
>>     // decode register contents if possible
>>     ResourceMark rm(_thread);
>>     os::print_nth_register_info(st, REENTRANT_ITERATION_STEP, _context);
>>   REENTRANT_LOOP_END
>> 
>>   st->cr();
>> 
>> 
>> Testing: tier 1 and compiled Linux-x64/aarch64, MacOS-x64/aarch64, Windows x64 and cross-compiled Linux-x86/riscv/arm/ppc/s390x (GHA and some local)
>
> Axel Boldt-Christmas has updated the pull request incrementally with five additional commits since the last revision:
> 
>  - Feedback: constrain print_register_info continuation value
>  - Feedback: print general registers first ppc s390
>  - Feedback: Move timeout recording into condition
>  - Feedback: improve print_stack_location
>  - Feedback: riscv print format

Looks good to me now. Thank you for your perseverance. About the x86 errors, you may want to merge head, I think Aleksey fixed these yesterday.

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

Marked as reviewed by stuefe (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/11017#pullrequestreview-1428161163


More information about the hotspot-dev mailing list