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

JDWP Spec: Incorrect location specified for MonitorWait and MonitorWaited events

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        Filed By : JCK team
        JDK : java full version "1.6.0-fcs"
        JCK : 6a-b11
        Platform[s] : solaris-sparc
        switch/Mode : default
        JCK test owner : http://javaweb.sfbay/jcce/tcks/jck/docs/others/owners.jto
        Failed tests:
          vm/jdwp/Event/MONITOR_WAIT/mntrwait001/mntrwait001.html
          vm/jdwp/Event/MONITOR_WAITED/mntrwaited001/mntrwaited001.html

        Problem description
        ===================
        The JDWP 6.0 specification for MonitorWait and MonitorWaited events commands at:
          http://javaweb.sfbay/java/re/jdk/6.0/latest/docs/platform/jpda/jdwp/jdwp-protocol.html#JDWP_Event_Composite
        states as follows:
          ---Excerpt-from-spec-for-MonitorWait---
          Case MonitorWait - if eventKind is JDWP.EventKind.MONITOR_WAIT: Notification of a thread about to wait on a monitor object.
          ...
        location location location contended monitor enter
          ...
          ---End-of-excerpt---
        and
          ---Excerpt-from-spec-for-MonitorWaited---
          Case MonitorWaited - if eventKind is JDWP.EventKind.MONITOR_WAITED: Notification that a thread in the target VM has finished waiting on a monitor object.
          ...
        location location location contended monitor enter
          ...
          ---End-of-excerpt---


        However, returned event packet for these events contains unexpected location for contended monitor:
          ---Excerpt-from-mntrwait001.jtr---
        ...
        Creating location for synchronized statement
          ... got location: Location(tag=1, classID=3, methodID=1020280, index=29)

        ...
        Parsing event packet:
            suspendPolicy: 2
            events: 1
            event #0:
              eventKind: 45
              requestID: 4
              threadID: 4
              tag: 116
              objectID: 4
              location: Location(tag=1, classID=5, methodID=1020292, index=-1)
              timeout: 20000
              checking location ...
        # ERROR: Unexpected classID of location of event 0 in tested event packet: 5 (expected: 3)
        # ERROR: Unexpected methodID of location of event 0 in tested event packet: 1020292 (expected: 1020280)
        ...
          ---End-of-excerpt---

        Sources for these new tests are located at:
          /java/re/jck/6a/qac/latest/binaries/JCK-runtime-6a/tests/vm/jdwp/Event/MONITOR_WAIT/mntrwait001/
          /java/re/jck/6a/qac/latest/binaries/JCK-runtime-6a/tests/vm/jdwp/Event/MONITOR_WAITED/mntrwaited001/

        <yg153347@sqeel> javap -c -classpath /java/re/jck/6a/qac/latest/binaries/JCK-runtime-6a/classes javasoft.sqe.tests.vm.jdwp.Event.MONITOR_WAIT.mntrwait001a\$TestedClass
           ...
           24: ldc #7; //String Breakpoint line passed
           26: invokevirtual #5; //Method javasoft/sqe/jck/lib/jpda/Log.display:(Ljava/lang/String;)V
           29: aload_0
           30: dup
           31: astore_1
           32: monitorenter
           33: aload_0
           34: ldc2_w #8; //long 20000l
           37: invokevirtual #10; //Method java/lang/Object.wait:(J)V
           40: goto 44
           43: astore_2
           44: aload_1
           45: monitorexit
           46: goto 54
           49: astore_3
           50: aload_1
           51: monitorexit
           52: aload_3
           53: athrow
           54: getstatic #3; //Field javasoft/sqe/tests/vm/jdwp/Event/MONITOR_WAIT/mntrwait001a.log:Ljavasoft/sqe/jck/lib/jpda/Log;
           57: ldc #12; //String Tested thread: finished run method
           ...

        The same problem is shown in mntrwaited001.jtr. Please see attached .jtr files for details.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                ygaevsky Yuri Gaevsky
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: