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

NotifyFramePop request is not cleared if JVMTI_EVENT_FRAME_POP is disabled

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 11
    • hotspot
    • None
    • behavioral
    • minimal
    • Hide
      The compatibility risk is minimal. First, this change only impacts the JVMTI_EVENT_FRAME_POP events notification that is a rarely used JVMTI feature. Second, it impacts only JVMTI agents that disable the JVMTI_EVENT_FRAME_POP events while there are still uncleared NotifyFramePop requests and incorrectly expect such requests to remain uncleared after the corresponding stack frames are popped.
      Show
      The compatibility risk is minimal. First, this change only impacts the JVMTI_EVENT_FRAME_POP events notification that is a rarely used JVMTI feature. Second, it impacts only JVMTI agents that disable the JVMTI_EVENT_FRAME_POP events while there are still uncleared NotifyFramePop requests and incorrectly expect such requests to remain uncleared after the corresponding stack frames are popped.
    • Other
    • SE

      Summary

      A NotifyFramePop request is only cleared if the JVMTI_EVENT_FRAME_POP is enabled but it must be always cleared when the corresponding frame is popped regardless of whether the JVMTI_EVENT_FRAME_POP event is enabled or not.

      For reference, see the JVMTI NotifyFramePop spec: https://docs.oracle.com/javase/8/docs/platform/jvmti/jvmti.html#NotifyFramePop

      Problem

      Current implementation behavior is incorrect and has to be changed. The problem is that if a NotifyFramePop request is not cleared when the JVMTI_EVENT_FRAME_POP events notification is disabled then an unrelated FRAME_POP event can be sent after the notification is re-enabled.

      Solution

      The solution is to clear the NotifyFramePop request when the specified frame is popped, even if the JVMTI_EVENT_FRAME_POP event is disabled.

      The full set of changes can be viewed here: http://cr.openjdk.java.net/%7Esspitsyn/webrevs/2017/hotspot/8187289-jvmti-framepop.2/

      Specification

      The specification of the JVMTI NotifyFramePop function is not changed as the expected (correct) behavior is pretty intuitive. The full set of changes can be viewed here: http://cr.openjdk.java.net/%7Esspitsyn/webrevs/2017/hotspot/8187289-jvmti-framepop.2/

            sspitsyn Serguei Spitsyn
            sspitsyn Serguei Spitsyn
            Chris Plummer, Daniel Daugherty
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: