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

StackWalker may skip Continuation::yield0 frame mistakenly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 22
    • 21
    • core-libs
    • None
    • b17

    Description

      VM ends the batch when it reaches the bottom of a continuation
      i.e. Continuation::enter. The stack walker will set the continuation to
      its parent to continue. Loom added FrameBuffer::isAtBottom to detect
      if it reaches the bottom of a continuation.

      FrameBuffer::isAtBottom returns true if the stack frames in the buffer have
      all been traversed *and* the last frame is not the last element of the buffer
      i.e. the buffer still has room not filled.

      If Continuation::enter is the last element of the buffer, FrameBuffer::isAtBottom
      returns false. It will need to fetch another batch, which will be returned with
      an empty batch and at that point, it will detect that it reaches the bottom of
      continuation and FrameBuffer::isAtBottom returns true.

      JVM_MoreStackWalk has a bug that always assumes that the Java frame
      stream is currently at the frame decoded in the last patch and so always
      advances to the next frame before filling in the new batch of stack frame.
      If JVM_MoreStackWalk returns 0 (as described above), then the library sets
      the continuation to its parent. It then call JVM_MoreStackWalk to continue
      the stack walking but the last decoded frame has already been advanced.
      The Java frame stream is already at the top frame of the parent continuation. .
      The current implementation may skip "Continuation::yield0" mistakenly.

      Attachments

        Issue Links

          Activity

            People

              mchung Mandy Chung
              mchung Mandy Chung
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: