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

JDI: VMDisconnectEvent is missing or VMDisconnectedException precedes it

XMLWordPrintable

    • generic
    • generic



      Name: egR10015 Date: 03/29/2001



      HS1.3.1-rc1-b19 and HS1.4.0-beta-b57 fail to pass the following tests

      nsk/jdi/EventRequestManager/accessWatchpointRequests/accwtchpreq001
      nsk/jdi/EventRequestManager/breakpointRequests/breakpreq001
      nsk/jdi/EventRequestManager/classPrepareRequests/clsprepreq001
      nsk/jdi/EventRequestManager/classUnloadRequests/clsunlreq001

      from testbase_nsk on all platforms. All these tests catch unexpected
      VMDisconnectedException when they attempt to call method
      com.sun.jdi.event.EventQueue.remove().

      The JDI spec 1.3 on the method com.sun.jdi.event.EventQueue.remove() says:
      ---------------------------------------------------------------------------
      "...
      Throws:
      ...
      VMDisconnectedException - if the connection to the target VM is no longer available.
               Note this will always be preceded by a VMDisconnectEvent."
      ---------------------------------------------------------------------------

      According to the spec the tests always expect the VMDisconnectEvent which
      is interpreted as a marker of stopping work with JDI's event queue. But
      the VMDisconnectEvent intermittently missed (1 time in 10-12 executions).

      The tests work as follows.
      In a separate thread (the source file share/EventListener.java) the tests
      asynchronously listens to JDI events in endless loop. In this loop the method
      com.sun.jdi.event.EventQueue.remove() is being called. After obtaining
      the VMDisconnectEvent the separate thread does not call the method
      com.sun.jdi.event.EventQueue.remove() anymore and exits. But if
      VMDisconnectedException was caught without preceded by the VMDisconnectEvent,
      the thread throws an own RuntimeException (the file share/Failure.java) and
      the test fails.
      The test clsprepreq001 was put in GammaBase for the bug illustration.
      This test consists of a debugger program (the file clsprepreq001.java)
      and a debuggee program (the file clsprepreq001t.java). Note that the main goal
      of the test is to exercise the method
      com.sun.jdi.request.EventRequestManager.classPrepareRequests().
      The VMDisconnectEvent appearance is only indirect testing.

      To reproduce the bug run several times
      doit.ksh <jdk home directory>
      in
      /net/sqesvr.eng/export/vsn/GammaBase/Bugs/<this bug number>

      ------------- output on Solsparc with HS1.4.0-beta-b57 -------------
      $ ./doit.ksh /home/eug/hotspot/jdk1.4/solsparc
      java version "1.4.0-internal"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-internal-b57)
      Java HotSpot(TM) Client VM (build 1.4.0-beta-b57, mixed mode)
      Binder> Listening for a pipe connection to port: 7000
      Binder> Binding to pipe socket
      Binder> Listening to pipe server socket
      Binder> VirtualMachineManager: version 1.4
      Binder> LaunchingConnector:
      Binder> name: com.sun.jdi.CommandLineLaunch
      Binder> description: Launches target using Sun Java VM command line and attaches to it
      Binder> transport: dt_socket
      Binder> Connector arguments:
      Binder> home=/export/ld54/java/dest/jdk1.4.0beta-b57/solsparc
      Binder> vmexec=java
      Binder> options= -classpath ".:share/classes:/home/eug/hotspot/jdk1.4/solsparc/lib/tools.jar"
      Binder> main=clsprepreq001t "-verbose" "-waittime=2"
      Binder> quote="
      Binder> suspend=true
      test.pipe> Waiting for pipe connection
      debugee.err> debugee.pipe> Making pipe connection to socket: localhost:7000
      Creating ClassPrepareRequest #0 with the property (first,a quick)...
      Creating ClassPrepareRequest #1 with the property (second,brown)...
      Creating ClassPrepareRequest #2 with the property (third,fox)...
      Creating ClassPrepareRequest #3 with the property (fourth,jumps)...
      Creating ClassPrepareRequest #4 with the property (fifth,over)...
      Creating ClassPrepareRequest #5 with the property (sixth,the lazy)...
      Creating ClassPrepareRequest #6 with the property (seventh,dog)...

      1) Getting ClassPrepareRequest objects with disabled event requests...
      Found expected ClassPrepare request with the property: (first,a quick)
      Found expected ClassPrepare request with the property: (second,brown)
      Found expected ClassPrepare request with the property: (third,fox)
      Found expected ClassPrepare request with the property: (fourth,jumps)
      Found expected ClassPrepare request with the property: (fifth,over)
      Found expected ClassPrepare request with the property: (sixth,the lazy)
      Found expected ClassPrepare request with the property: (seventh,dog)

      2) Getting ClassPrepareRequest objects with enabled event requests...
      Found expected ClassPrepare request with the property: (first,a quick)
      Found expected ClassPrepare request with the property: (second,brown)
      Found expected ClassPrepare request with the property: (third,fox)
      Found expected ClassPrepare request with the property: (fourth,jumps)
      Found expected ClassPrepare request with the property: (fifth,over)
      Found expected ClassPrepare request with the property: (sixth,the lazy)
      Found expected ClassPrepare request with the property: (seventh,dog)

      Starting potential timed out section: waiting 2 minute(s) for debuggee's exit...
      Potential timed out section passed

      EventListener: caught VMDisconnectedException without preceded VMDisconnectEvent
      com.sun.jdi.VMDisconnectedException: Socket closed
              at com.sun.tools.jdi.TargetVM.send(TargetVM.java:264)
              at com.sun.tools.jdi.VirtualMachineImpl.sendToTarget(VirtualMachineImpl.java:816)
              at com.sun.tools.jdi.PacketStream.send(PacketStream.java:44)
              at com.sun.tools.jdi.JDWP$ThreadReference$Name.enqueueCommand(JDWP.java:3763)
              at com.sun.tools.jdi.JDWP$ThreadReference$Name.process(JDWP.java:3749)
              at com.sun.tools.jdi.ThreadReferenceImpl.name(ThreadReferenceImpl.java:79)
              at com.sun.tools.jdi.EventSetImpl$ThreadedEventImpl.toString(EventSetImpl.java:123)
              at clsprepreq001.handleEvent(clsprepreq001.java:191)
              at nsk.jdi.share.EventListener$EventHandlerQueue.dispatchEvent(EventListener.java:271)
              at nsk.jdi.share.EventListener.run(EventListener.java:189)

      nsk.jdi.share.Failure: com.sun.jdi.VMDisconnectedException: Socket closed
              at nsk.jdi.share.EventListener.run(EventListener.java:205)
      # ERROR: TEST FAILED
      test.pipe> Closing pipe socket
      Binder> Closing pipe server socket
      exit code = 97
      --------------------------------------------------------------------

      ======================================================================

            rfield Robert Field (Inactive)
            eugsunw Eug Eug (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: