This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Currently a JPDA thread can be suspended or resumed at any time. There is not possible to assure that certain operations will be performed in a suspended thread. (see e.g. issue #58769) This needs to be fixed.
See e.g. debuggerjpda/src/org/netbeans/modules/debugger/jpda/actions/PopToHereActionProvider.java:checkEnabled() or debuggerjpda/ant/src/org/netbeans/modules/debugger/projects/ToolTipAnnotation.java:run()
I have reproduced the bug #58769 on Win XP NB4.2 (200505231800). The VMDisconnectedException is thrown then stepping over. I'm reporting it here because this issue is marked as continuation of #58769 which is already closed. Steps to reproduce: 1) open attached file 2) set breakpoint on the line 38 (last command) 3) debug the file (it stops on the breakpoint) 4) step over (F8) Sometimes but quite often the exception is thrown: com.sun.jdi.VMDisconnectedException: connection is closed at com.sun.tools.jdi.TargetVM.send(TargetVM.java:274) at com.sun.tools.jdi.VirtualMachineImpl.sendToTarget(VirtualMachineImpl.java:929)
Created attachment 22281 [details] Exception
Created attachment 22282 [details] java file
First, it's necessary to resume the debuggee under lock, so that others can synchronize on it. Then we should also synchronize JPDAThread.resume() and suspend(). This is fixed now in trunk: /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/models/JPDAThreadImpl.java,v <-- JPDAThreadImpl.java new revision: 1.11; previous revision: 1.10 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/JPDADebuggerImpl.java,v <-- JPDADebuggerImpl.java new revision: 1.74; previous revision: 1.73 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/actions/StartActionProvider.java,v <-- StartActionProvider.java new revision: 1.14; previous revision: 1.13 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/actions/PopToHereActionProvider.java,v <-- PopToHereActionProvider.java new revision: 1.10; previous revision: 1.9 /cvs/debuggerjpda/src/org/netbeans/modules/debugger/jpda/util/Operator.java,v <-- Operator.java new revision: 1.38; previous revision: 1.37 Ideally when resuming, it should be performed under locks from all threads that are being resumed. Therefore I'm leaving this still open...
This should be fixed now already. Notification about thread resume is implemented. One can synchronize on the thread object to be sure that it can not be resumed at any time.
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.