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 198141

Summary: Netbeans 7.0 hangs. Possible complex deadlock.
Product: editor Reporter: neilwightman <neilwightman>
Component: Painting & PrintingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED FIXED    
Severity: normal CC: dathyrius, gorrus, jskrivanek, mmirilovic, piotrandzel
Priority: P1 Keywords: THREAD
Version: 7.0   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: TXT thread dump
TDUMP thread dump

Description neilwightman 2011-04-27 14:58:21 UTC
Created attachment 107975 [details]
TXT thread dump

I have problems with Netbeans 7.0 RC1 + Netbeans 7.0 released version.

After using Netbeans for some time the UI hangs.

The Awt thread gets stuck a the 
org.netbeans.modules.editor.lib2.highlighting.ReadOnlyFilesHighlighting.checkFileStatus(ReadOnlyFilesHighlighting.java:131) 
line and never returns.  I waited over 30 mins at lunch.

See attached thread dump files.
Comment 1 neilwightman 2011-04-27 14:59:03 UTC
Created attachment 107976 [details]
TDUMP thread dump

Both attachments were created by attaching jvisualvm.exe to the process.
Comment 2 David Strupl 2011-04-28 19:18:24 UTC
Milo, can you please have a look? Seems like the problem is in 
"Pending refresh" daemon prio=2 tid=0x5ad27400 nid=0xf00 in Object.wait() [0x0895f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:485)
	at javax.swing.text.AbstractDocument.readLock(AbstractDocument.java:1372)
	- locked <0x2bc9cc40> (a org.netbeans.modules.editor.NbEditorDocument)
	at org.netbeans.editor.BaseDocument.render(BaseDocument.java:1419)
	at org.netbeans.modules.editor.lib2.highlighting.ProxyHighlightsContainer.layerChanged(ProxyHighlightsContainer.java:229)
	at org.netbeans.modules.editor.lib2.highlighting.ProxyHighlightsContainer.access$200(ProxyHighlightsContainer.java:66)
	at org.netbeans.modules.editor.lib2.highlighting.ProxyHighlightsContainer$LayerListener.highlightChanged(ProxyHighlightsContainer.java:256)
	at org.netbeans.spi.editor.highlighting.support.AbstractHighlightsContainer.fireHighlightsChange(AbstractHighlightsContainer.java:113)
	at org.netbeans.modules.editor.lib2.highlighting.ReadOnlyFilesHighlighting.updateFileReadOnly(ReadOnlyFilesHighlighting.java:142)
	at org.netbeans.modules.editor.lib2.highlighting.ReadOnlyFilesHighlighting.fileAttributeChanged(ReadOnlyFilesHighlighting.java:173)
	- locked <0x2be26d68> (a org.netbeans.modules.editor.lib2.highlighting.ReadOnlyFilesHighlighting)


While having locked ReadOnlyFilesHighlighting it is trying to lock document. On the other hand AWT EDT has document locked and is trying to lock ReadOnlyFilesHighlighting.
Comment 3 Miloslav Metelka 2011-04-30 09:33:25 UTC
Fixed.
http://hg.netbeans.org/jet-main/rev/dc3f76a045fb
Comment 4 Miloslav Metelka 2011-04-30 09:33:34 UTC
*** Bug 197886 has been marked as a duplicate of this bug. ***
Comment 5 Quality Engineering 2011-05-02 16:26:34 UTC
Integrated into 'main-golden', will be available in build *201105021133* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dc3f76a045fb
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #198141 - Netbeans 7.0 hangs. - Deadlock between document and FS lock in ReadOnlyFilesHighlighting.
Comment 6 David Strupl 2011-05-06 08:13:03 UTC
Shouldn't this one be marked as fixed? Thanks.
Comment 7 Jaromir Uhrik 2011-05-16 12:56:21 UTC
According to the code it seems that the fix is all right so I am marking as Verified to make sure that the fix appears in the patch1.
Comment 8 Miloslav Metelka 2011-05-16 15:55:39 UTC
In release70_fixes:
dc3f76a045fb transplanted to d5665f14eac7
plus increase of spec. versions:
3f29344bf2a8

For the list of included fixed bugs please check
http://wiki.netbeans.org/NetBeans70PatchesInfo
Comment 9 Marian Mirilovic 2011-05-17 07:19:48 UTC
*** Bug 198594 has been marked as a duplicate of this bug. ***
Comment 10 Jaromir Uhrik 2011-05-20 08:09:02 UTC
Verified in patch1 the same way as in the trunk.
Comment 11 Miloslav Metelka 2011-05-23 08:42:48 UTC
*** Bug 198712 has been marked as a duplicate of this bug. ***