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 127298 - Deadlock while debugging nb
Summary: Deadlock while debugging nb
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2008-02-13 14:05 UTC by Petr Hejl
Modified: 2010-04-29 09:38 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
thread dump (16.25 KB, text/plain)
2008-02-13 14:06 UTC, Petr Hejl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hejl 2008-02-13 14:05:57 UTC
Deadlock occurred while debugging netbeans. Attaching thread dump.

Product Version: NetBeans IDE Dev (Build 200801280931)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-generic running on i386; UTF-8; en_US (nb)
Comment 1 Petr Hejl 2008-02-13 14:06:54 UTC
Created attachment 56604 [details]
thread dump
Comment 2 Petr Hejl 2008-02-13 14:08:54 UTC
When the debugged process was killed (-9). The debugging nb starts working logging the following:

WARNING [org.netbeans.api.java.source.JavaSource]: JavaSource.runUserActionTask called in AWT event thread by:
org.netbeans.api.java.source.JavaSource.runWhenScanFinished(JavaSource.java:778)
SEVERE
java.lang.InterruptedException
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:485)
        at java.awt.EventQueue.invokeAndWait(EventQueue.java:992)
        at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1323)
[catch] at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.getCurrentLineNumber(EditorContextImpl.java:403)
        at
org.netbeans.modules.debugger.jpda.ui.actions.ToggleBreakpointActionProvider.propertyChange(ToggleBreakpointActionProvider.java:100)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
        at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:347)
        at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.firePropertyChange(JPDADebuggerImpl.java:1392)
        at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.setState(JPDADebuggerImpl.java:1376)
        at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.finish(JPDADebuggerImpl.java:1116)
        at org.netbeans.modules.debugger.jpda.actions.StartActionProvider$4.run(StartActionProvider.java:274)
        at org.netbeans.modules.debugger.jpda.util.Operator$1.run(Operator.java:316)
        at java.lang.Thread.run(Thread.java:619)
Comment 3 Martin Entlicher 2008-02-13 14:11:34 UTC
AWT is blocked by java.
Comment 4 Martin Entlicher 2008-02-13 15:05:42 UTC
The InterruptedException is ignored in this case:
changeset:   67162:a9ae00bd5bd3
http://hg.netbeans.org/main/rev/a9ae00bd5bd3
Comment 5 Tomas Zezula 2008-02-13 17:46:02 UTC
OK the AWT is locked by java, I agree.
But why?
The at org.netbeans.modules.debugger.jpda.projects.EditorContextImpl.parseExpression(EditorContextImpl.java:1482)
acquires an java infrastructure lock and waits on VirtualMachineImpl.waitForTargetReply() - holding the lock, so
no one other can enter java infrastructure anymore.
Editor tries to acquire this lock - any call to runUserActionTask, runModificationTask will deadlock. The
runWhenScanFinished may be improved to end in this case without spinning, but it doesn't solve this problem
since any call to java infrastructure will cause the deadlock (runUserActionTask, runModificationTask) or service
refusal (runWhenScanFinished).
The debuger shouldn't do any IPC under java infrastrucure lock.
Comment 6 Martin Entlicher 2008-02-25 23:07:17 UTC
O.K. We need to assure that we will not call long tasks under shared user action task.
Comment 7 Martin Entlicher 2008-02-26 17:43:00 UTC
Fixed in trunk:
changeset:   69466:fe6f0a22b01b
http://hg.netbeans.org/main/rev/fe6f0a22b01b
Comment 8 Quality Engineering 2010-04-29 09:38:00 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.