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.

Bug 58827 - Add synchronization for changes of JPDA thread state
Summary: Add synchronization for changes of JPDA thread state
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: THREAD
Depends on:
Blocks: 58769 58781 92508
  Show dependency tree
 
Reported: 2005-05-12 14:01 UTC by Martin Entlicher
Modified: 2010-04-29 09:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Exception (1.08 KB, text/plain)
2005-05-24 10:49 UTC, Jiri Prox
Details
java file (896 bytes, text/plain)
2005-05-24 10:50 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2005-05-12 14:01:15 UTC
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.
Comment 1 Martin Entlicher 2005-05-12 14:04:30 UTC
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()
Comment 2 Jiri Prox 2005-05-24 10:48:24 UTC
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)
Comment 3 Jiri Prox 2005-05-24 10:49:41 UTC
Created attachment 22281 [details]
Exception
Comment 4 Jiri Prox 2005-05-24 10:50:23 UTC
Created attachment 22282 [details]
java file
Comment 5 Martin Entlicher 2005-06-02 14:34:48 UTC
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...

Comment 6 Martin Entlicher 2007-03-22 23:18:19 UTC
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.
Comment 7 Quality Engineering 2010-04-29 09:22:39 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.