-
Bug
-
Resolution: Fixed
-
P4
-
17, 19
-
b24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8315806 | 17.0.10-oracle | Calvin Cheung | P4 | Resolved | Fixed | b01 |
JDK-8314639 | 17.0.9 | Aleksey Shipilev | P4 | Resolved | Fixed | b04 |
In our error reporting we have two sections that print the registers:
```
STEP("printing register info")
// decode register contents if possible
if (_verbose && _context && _thread && Universe::is_fully_initialized()) {
ResourceMark rm(_thread);
os::print_register_info(st, _context);
st->cr();
}
STEP("printing registers, top of stack, instructions near pc")
// registers, top of stack, instructions near pc
if (_verbose && _context) {
os::print_context(st, _context);
st->cr();
}
```
On Linux x64 we perform the risky print_location calls inside the first section, so if that crash it only skips the rest of the registers. The plain value printing is done in the second section. However, on Linux x64, this has been swapped, so if we crash in the second section, it skips printing the instruction hex dump and pc context.
This is unfortunate, since we often crash in the register printing.
One way to fix this would be to mimic the x64 printing. Another, which I think would be nicer, would be to split this into three sections:
1) Print the register values (Like Linux AArch64 does)
2) Print the decoded register values using the risky print_location
3) Print the rest of the context
Alternatively, fuse the proposed (1) and (2), and make it so that the safe printing of all registers comes before the unsafe printing.
```
STEP("printing register info")
// decode register contents if possible
if (_verbose && _context && _thread && Universe::is_fully_initialized()) {
ResourceMark rm(_thread);
os::print_register_info(st, _context);
st->cr();
}
STEP("printing registers, top of stack, instructions near pc")
// registers, top of stack, instructions near pc
if (_verbose && _context) {
os::print_context(st, _context);
st->cr();
}
```
On Linux x64 we perform the risky print_location calls inside the first section, so if that crash it only skips the rest of the registers. The plain value printing is done in the second section. However, on Linux x64, this has been swapped, so if we crash in the second section, it skips printing the instruction hex dump and pc context.
This is unfortunate, since we often crash in the register printing.
One way to fix this would be to mimic the x64 printing. Another, which I think would be nicer, would be to split this into three sections:
1) Print the register values (Like Linux AArch64 does)
2) Print the decoded register values using the risky print_location
3) Print the rest of the context
Alternatively, fuse the proposed (1) and (2), and make it so that the safe printing of all registers comes before the unsafe printing.
- backported by
-
JDK-8314639 Early crashes in os::print_context on AArch64
- Resolved
-
JDK-8315806 Early crashes in os::print_context on AArch64
- Resolved
- relates to
-
JDK-8287037 Make crash reporting more robust
- Closed
- links to
-
Commit openjdk/jdk17u-dev/d7259618
-
Commit openjdk/jdk/83cec4b6
-
Review openjdk/jdk17u-dev/1669
-
Review openjdk/jdk/8736
(2 links to)