-
Bug
-
Resolution: Fixed
-
P4
-
25
-
b14
-
ppc
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8362974 | 21.0.9 | Richard Reingruber | P4 | Resolved | Fixed | master |
Symptom: Crashes crashes when sampling the stack using AsyncGetCallTrace()
Analysis:
AsyncGetCallTrace() returns ticks_unknown_not_Java if JavaFrameAnchor::_last_Java_pc is found to be null in JavaThread::pd_get_top_frame_for_profiling().
async-profiler reacts to this by loading JavaFrameAnchor::_last_Java_sp[-1] and setting this value as last java pc in the threads JavaFrameAnchor before retrying to sample the stack with AsyncGetCallTrace()
https://github.com/async-profiler/async-profiler/blob/3beae04e9d3aec18114fef5b2fd6a868b5a2413c/src/profiler.cpp#L498-L517
This is incorrect on ppc64 and causes the crashes.
_last_Java_pc unset is not uncommon. E.g. c1/c2 runtime stubs to resolve compiled calls don't set _last_Java_pc.
While it is possible to reduce returning ticks_unknown_not_Java a lot it can still occur.
This means that incorrect setting of the pc in the JavaFrameAncor by async-profiler can still crash the vm.
Analysis:
AsyncGetCallTrace() returns ticks_unknown_not_Java if JavaFrameAnchor::_last_Java_pc is found to be null in JavaThread::pd_get_top_frame_for_profiling().
async-profiler reacts to this by loading JavaFrameAnchor::_last_Java_sp[-1] and setting this value as last java pc in the threads JavaFrameAnchor before retrying to sample the stack with AsyncGetCallTrace()
https://github.com/async-profiler/async-profiler/blob/3beae04e9d3aec18114fef5b2fd6a868b5a2413c/src/profiler.cpp#L498-L517
This is incorrect on ppc64 and causes the crashes.
_last_Java_pc unset is not uncommon. E.g. c1/c2 runtime stubs to resolve compiled calls don't set _last_Java_pc.
While it is possible to reduce returning ticks_unknown_not_Java a lot it can still occur.
This means that incorrect setting of the pc in the JavaFrameAncor by async-profiler can still crash the vm.
- backported by
-
JDK-8362974 [PPC] Avoid ticks_unknown_not_Java AsyncGetCallTrace() if JavaFrameAnchor::_last_Java_pc not set
-
- Resolved
-
- relates to
-
JDK-8352800 [PPC] OpenJDK fails to build on PPC after JDK-8350106
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk21u-dev/d5908231
-
Commit(master) openjdk/jdk/030c85de
-
Review(master) openjdk/jdk21u-dev/1971
-
Review(master) openjdk/jdk/23640
(1 links to)