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();
```
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();
```
- causes
-
JDK-8350201 Out of bounds access on Linux aarch64 in os::print_register_info
-
- Resolved
-
- relates to
-
JDK-8296907 VMError: add optional callstacks, siginfo for secondary errors
-
- Resolved
-
-
JDK-8259648 Avoid secondary crashes when reporting registers contents of a crash
-
- Closed
-