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

JDWP: Crash when disabling stepping on a zombie thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-svc
    • generic
    • generic

      We found a problem
      with deleting step requests in JDI in certain situations. The problem
      happens when you step off of the end of one thread, but there are other
      threads still running in the program. The step request that got added
      to do this ends up with a THREAD_STATUS_ZOMBIE thread status. When any
      step event actually occurs we will delete the step request that caused
      the event. In the above case we cannot delete that request, since this
      step event will never occur. We also have code before adding the next
      step request, which removes all the existing step requests
      (eventRequestManager.deleteEventRequests(eventRequestManager.stepRequests()))
      -- just in case any extra steps are still in the queue, which should
      cover the above situation. However, when this is executed in the above
      case, we get the following crash:
      "instruction at "0x503b10c9" referenced memory at "0x00000003", followed
      by the following exception trace:
      Exception occurred during event dispatching:
      com.sun.jdi.VMDisconnectedException
              at com.sun.tools.jdi.TargetVM.waitForReply(TargetVM.java:282)
              at
      com.sun.tools.jdi.VirtualMachineImpl.waitForTargetReply(VirtualMachin
      eImpl.java:781)
              at
      com.sun.tools.jdi.PacketStream.waitForReply(PacketStream.java:65)
              at
      com.sun.tools.jdi.JDWP$EventRequest$Clear.waitForReply(JDWP.java:5024
      )
              at
      com.sun.tools.jdi.JDWP$EventRequest$Clear.process(JDWP.java:5000)
              at
      com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.clear(Even
      tRequestManagerImpl.java:183)
              at
      com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.setEnabled
      (EventRequestManagerImpl.java:141)
              at
      com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.disable(Ev
      entRequestManagerImpl.java:134)
              at
      com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.delete(Eve
      ntRequestManagerImpl.java:121)
              at
      com.sun.tools.jdi.EventRequestManagerImpl.deleteEventRequests(EventRe
      questManagerImpl.java:593)
              at
      com.borland.jbuilder.debugger.DebugJavaProcess.step(DebugJavaProcess.
      java:334)
              at
      com.borland.jbuilder.debugger.DebugJavaProcess.stepOver(DebugJavaProc
      ess.java:300)
              at
      com.borland.jbuilder.debugger.DebugJavaProcessTracker.stepOver(DebugJ
      avaProcessTracker.java:599)
              at
      com.borland.jbuilder.debugger.DebuggerActions.stepOverInto_actionPerf
      ormed(DebuggerActions.java:88)
              at
      com.borland.jbuilder.debugger.DebuggerActions.access$1(DebuggerAction
      s.java:34)
              at
      com.borland.jbuilder.debugger.DebuggerActions$3.actionPerformed(Debug
      gerActions.java:104)
              at
      com.borland.primetime.ide.BrowserAction.actionPerformed(BrowserAction
      .java:125)
              at
      javax.swing.JComponent.processKeyBinding(JComponent.java:1685)
              at
      javax.swing.JComponent.processKeyBindings(JComponent.java:1708)
              at javax.swing.JComponent.processKeyEvent(JComponent.java:1610)
              at java.awt.Component.processEvent(Component.java:3014)
              at java.awt.Container.processEvent(Container.java:1015)
              at java.awt.Component.dispatchEventImpl(Component.java:2400)
              at java.awt.Container.dispatchEventImpl(Container.java:1060)
              at java.awt.Component.dispatchEvent(Component.java:2313)
              at
      java.awt.LightweightDispatcher.processKeyEvent(Container.java:1791)
              at
      java.awt.LightweightDispatcher.dispatchEvent(Container.java:1765)
              at java.awt.Container.dispatchEventImpl(Container.java:1047)
              at java.awt.Window.dispatchEventImpl(Window.java:749)
              at java.awt.Component.dispatchEvent(Component.java:2313)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:287)
              at
      java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
      1)
              at
      java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

      Exception occurred during event dispatching:
      com.sun.jdi.VMDisconnectedException: Descriptor not a socket: socket
      write error

              at com.sun.tools.jdi.TargetVM.send(TargetVM.java:271)
              at
      com.sun.tools.jdi.VirtualMachineImpl.sendToTarget(VirtualMachineImpl.
      java:777)
              at com.sun.tools.jdi.PacketStream.send(PacketStream.java:55)
              at
      com.sun.tools.jdi.JDWP$ThreadReference$SuspendCount.enqueueCommand(JD
      WP.java:4017)
              at
      com.sun.tools.jdi.JDWP$ThreadReference$SuspendCount.process(JDWP.java
      :4003)
              at
      com.sun.tools.jdi.ThreadReferenceImpl.suspendCount(ThreadReferenceImp
      l.java:161)
              at
      com.borland.jbuilder.debugger.DebugJavaProcess.resume(DebugJavaProces
      s.java:411)
              at
      com.borland.jbuilder.debugger.DebugJavaProcess.checkDebugEvents(Debug
      JavaProcess.java:229)
              at
      com.borland.jbuilder.debugger.DebugJavaProcess.actionPerformed(DebugJ
      avaProcess.java:662)
              at javax.swing.Timer.fireActionPerformed(Timer.java:147)
              at javax.swing.Timer$DoPostEvent.run(Timer.java:105)
              at
      javax.swing.SystemEventQueueUtilities.processRunnableEvent(SystemEven
      tQueueUtilities.java:399)
              at
      javax.swing.SystemEventQueueUtilities.access$0(SystemEventQueueUtilit
      ies.java:395)
              at
      javax.swing.SystemEventQueueUtilities$RunnableTarget.processEvent(Sys
      temEventQueueUtilities.java:436)
              at java.awt.Component.dispatchEventImpl(Component.java:2400)
              at java.awt.Component.dispatchEvent(Component.java:2313)
              at java.awt.EventQueue.dispatchEvent(EventQueue.java:287)
              at
      java.awt.EventDispatchThread.pumpOneEvent(EventDispatchThread.java:10
      1)
              at
      java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:92)
              at java.awt.EventDispatchThread.run(EventDispatchThread.java:83)

      If you have Primetime, you can reproduce this problem with the Welcome
      Project by putting a breakpoint in the file_exit event handler in
      WelcomeFrame, then just stepping through WelcomeApp, and stepping off of
      the last line of it. Then select File/Exit on the Welcome app's menu.
      After you hit the breakpoint, select "step over" -- boom.

            ghirschsunw Gordon Hirsch (Inactive)
            ghirschsunw Gordon Hirsch (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: