-
Bug
-
Resolution: Fixed
-
P4
-
25
-
master
-
ppc
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.
- links to
-
Commit(master) openjdk/jdk/030c85de
-
Review(master) openjdk/jdk/23640