Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8350106

[PPC] Avoid ticks_unknown_not_Java AsyncGetCallTrace() if JavaFrameAnchor::_last_Java_pc not set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • hotspot
    • svc
    • 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.
       

            rrich Richard Reingruber
            rrich Richard Reingruber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: