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 125518 - Deadlock while debugging
Summary: Deadlock while debugging
Status: CLOSED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: Martin Entlicher
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-17 20:00 UTC by Torbjorn Norbye
Modified: 2010-04-29 09:37 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Deadlock thread dump (35.10 KB, text/plain)
2008-01-17 20:01 UTC, Torbjorn Norbye
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2008-01-17 20:00:48 UTC
I was debugging and suddenly the IDE froze. I grabbed a thread dump which I will attach next. There are a lot of
debugging-related threads doing things with the source model or documents. The AWT thread gets locked trying to acquire
a write lock so somebody is holding a readlock while waiting. I'm not sure if it's the debugger but from the threads it
looks like a promising place to start looking.

This is on a trunk build fresh as of yesterday, on Ubuntu Linux:

Product Version: NetBeans IDE Dev (Build 080116)
Java: 1.6.0_03; Java HotSpot(TM) Client VM 1.6.0_03-b05
System: Linux version 2.6.22-14-386 running on i386; UTF-8; en_US (nb)
Userdir: /home/tor/.netbeans/dev
Comment 1 Torbjorn Norbye 2008-01-17 20:01:52 UTC
Created attachment 55220 [details]
Deadlock thread dump
Comment 2 Peter Pis 2008-01-21 12:44:57 UTC
This issue is considered to be a stopper for M1. Could you please evaluate this issue ASAP?
Comment 3 Martin Entlicher 2008-01-21 14:11:31 UTC
In the thread dump, I do not see anything important blocked by debugger.
AWT is waiting at javax.swing.text.AbstractDocument.writeLock(). Someone is likely reading from or writting into the
document, but it's not apparent who is it and where is it blocked.

Can someone from editor evaluate this?
Comment 4 Petr Nejedly 2008-01-21 14:31:21 UTC
AWT waits for document write lock.

The thread "ToolTip-Evaluator" (nid=0x4768) holds the document read lock (from the frame
NbToolTip$Request.run(NbToolTip.java:399)) and is waiting for the JavaSource to process its request.

JavaSource is currently processing "Debugger operator thread" (nid=0x46c0), which is runnable, but probably blocked
somewhere deep in JDI or remote process.

Document needs to be accessible, nobody should keep it locked for extended periods of time.
Comment 5 Martin Entlicher 2008-01-21 15:01:02 UTC
O.K. Thanks for the evaluation Petre, the document read lock is not visible in the dump, it's not a standard monitor.
The problem seems to be in "Debugger operator thread", but that's running. It does not looks like a deadlock, but just a
temporarily frozen AWT.
Comment 6 Martin Entlicher 2008-01-21 15:07:52 UTC
Tor, do you have any steps to reproduce this?
How long did you wait before you've generated the thread-dump?
Comment 7 Marian Mirilovic 2008-01-22 10:43:12 UTC
Martin, Tor any progress ? 
Jirka, could you help with reproducing this issue ? Thanks in advance.
Comment 8 Martin Entlicher 2008-01-22 14:55:36 UTC
I will change the code not to call JDI methods, that connect to remote VM inside the JavaSource task.
That should help.
Comment 9 Martin Entlicher 2008-01-22 15:09:32 UTC
Hopefully fixed in trunk, please verify...

/shared/data/ccvs/repository/debuggerjpda/src/org/netbeans/modules/debugger/jpda/ExpressionPool.java,v  <-- 
ExpressionPool.java
new revision: 1.6; previous revision: 1.5
Comment 10 Quality Engineering 2010-04-29 09:37:44 UTC
Verified ... and Closing all issues resolved into NetBeans 6.7 and earlier.