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 192840 - Deadlock between JEditorPane$PageLoader and EDT
Summary: Deadlock between JEditorPane$PageLoader and EDT
Status: RESOLVED WONTFIX
Alias: None
Product: editor
Classification: Unclassified
Component: Painting & Printing (show other bugs)
Version: 7.0
Hardware: PC Windows XP
: P1 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-03 11:11 UTC by aquaglia
Modified: 2010-12-21 15:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (251.44 KB, text/plain)
2010-12-05 14:20 UTC, aquaglia
Details
Dump for build 201012090001 (253.81 KB, text/plain)
2010-12-09 13:40 UTC, aquaglia
Details
Stack trace tool dump (30.26 KB, text/plain)
2010-12-09 14:06 UTC, aquaglia
Details
dump201012100001.txt STACK TRACE TOOL (28.08 KB, text/plain)
2010-12-10 08:48 UTC, aquaglia
Details
IDE Freeze just tring to open a source file (37.23 KB, text/plain)
2010-12-13 06:14 UTC, heedles
Details

Note You need to log in before you can comment on or make changes to this bug.
Description aquaglia 2010-12-03 11:11:26 UTC
I have just switched from build 201012010001 to 201012030001 and  it keeps freezing after a short while.
It is unusable.
I will upload the dump later today.
Comment 1 Marian Mirilovic 2010-12-03 11:46:11 UTC
we can do nothing without thread-dump, please reopen once attached.
Comment 2 aquaglia 2010-12-05 14:20:29 UTC
Created attachment 103608 [details]
Thread dump

Thread dump uploaded.
Comment 3 Marian Mirilovic 2010-12-06 10:33:36 UTC
reassign for evaluation
Comment 4 Antonin Nebuzelsky 2010-12-07 14:34:30 UTC
Seems like a duplicate of issue 191717 fixed in the build from Dec/5.

Please, try a new daily build and reopen with a new thread dump (or a few of them taken with several seconds between them) if you encounter the same problem again. Thanks.

*** This bug has been marked as a duplicate of bug 191717 ***
Comment 5 aquaglia 2010-12-09 09:41:22 UTC
Hi, the bug you referenced says the fix would have been available from build *201012050001* but I am on that build and still have the problem.
Comment 6 Antonin Nebuzelsky 2010-12-09 13:19:23 UTC
Thanks for providing more information.

Please reopen with additional thread dumps (the provided one is only one snapshot of the threads in time and may not reveal all that is happening). Also tell us what you are doing in the IDE and what you have opened (projects, files in editor,...) when the problem appears.
Comment 7 aquaglia 2010-12-09 13:40:38 UTC
Created attachment 103860 [details]
Dump for build 201012090001

The problem is still there in lastest build 201012090001.
The IDE is unusable like this. Please help.
Comment 8 aquaglia 2010-12-09 13:43:45 UTC
Setting to P1 according to http://wiki.netbeans.org/BugPriorityGuidelines, section "crash or deadlock".
W/a is to use an external xml editor. There is no w/a in NetBeans itself.
Comment 9 Antonin Nebuzelsky 2010-12-09 13:50:37 UTC
Changing the report to P1 really does not help to have the problem resolved. I need what I asked above from you.

1. additional thread dumps

http://wiki.netbeans.org/GenerateThreadDump

2. tell me what you are doing in the IDE when the problem appears
Comment 10 aquaglia 2010-12-09 14:06:58 UTC
Created attachment 103866 [details]
Stack trace tool dump

I had missed your previous update, sorry.
I have uploaded a trace generated with the StackTrace tool.
Comment 11 aquaglia 2010-12-09 14:08:06 UTC
The stack trace I have just uploaded was generated after clicking on a struts-config.xml file.
NetBenas froze and never gave back control.
Comment 12 aquaglia 2010-12-09 14:13:01 UTC
Priority is set according to the NetBeans guidelines.
Comment 13 Antonin Nebuzelsky 2010-12-09 15:12:33 UTC
The last thread dump is showing a deadlock between

* AWT-EventQueue-0 which acquired AWTTreeLock for the painting and now is waiting for PriorityMutex in o.n.m.e.lib2.view.DocumentView.viewToModelChecked

and

* Timer-4 thread which has PriorityMutex acquired in o.n.m.e.lib2.view.ViewUpdates.checkRebuild and is waiting for AWTTreeLock for paiting

The use of PriorityMutex was introduced in
http://hg.netbeans.org/main/rev/c9a397f44346

(btw, besides fixing the deadlock, also the painting should probably be rescheduled from the other thread to AWT)

Reassigning to editor.
Comment 14 aquaglia 2010-12-10 08:48:33 UTC
Created attachment 103913 [details]
dump201012100001.txt STACK TRACE TOOL

Issue is still there in build 201012100001
Please fix this, it is very annoying:
- I have to kill the process 
- Restart NetBeans
- Use an external editor to edit xml files
Comment 15 heedles 2010-12-13 06:14:12 UTC
Created attachment 104001 [details]
IDE Freeze just tring to open a source file

I have been having issues with the nightly builds since early December, also on XP.  IDE freezes very quickly and has to be terminated with the task manager.  Often a simple cut of a single word causes the issue.  The two thread dumps in Dump201012120001InstantHang.txt were after a freeze just double clicking on a java source file on the project list.  Project scanning was still in process. An editor tab opened with the filename, but no text and no further repaints.  This has rendered the nightly build essentially useless.  Any work has to be done with 6.9.1
Comment 16 David Strupl 2010-12-13 10:35:51 UTC

*** This bug has been marked as a duplicate of bug 192548 ***
Comment 17 Jan Lahoda 2010-12-13 11:07:55 UTC
For the record, the first thread dump seems like a duplicate of bug #192653.
Comment 18 Miloslav Metelka 2010-12-21 13:58:52 UTC
This is Swing's own manifestation of the problem with JComponent.repaint() requesting AWT-tree-lock (as described in issue #192548).
See "Comment #2 From aquaglia" log with thread dump (asynchronous HTMLDocument's load by SwingWorker's thread):

"SwingWorker-pool-2-thread-1" daemon prio=6 tid=0x042f1c00 nid=0x1210 waiting for monitor entry [0x0b5ae000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at java.awt.Component.getLocationOnScreen(Component.java:1995)
        - waiting to lock <0x1893a8c0> (a java.awt.Component$AWTTreeLock)
        at javax.swing.SwingUtilities.convertPointToScreen(SwingUtilities.java:380)

owning HTMLDocument's write-lock (doing doc.fireInsertUpdate()) and calling
   java.awt.Component.repaint(Component.java:3221)
which (with the current jdk) leads to acquiring of AWT-tree-lock.

And this thread is deadlocked with

"AWT-EventQueue-0" prio=6 tid=0x04436000 nid=0x11ac in Object.wait() [0x06f7e000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x19e67a50> (a javax.swing.text.html.HTMLDocument)
        at java.lang.Object.wait(Object.java:504)
        at javax.swing.text.AbstractDocument.readLock(AbstractDocument.java:1387)

owning AWT-tree-lock and trying to acquire read-lock of HTMLDocument which blocks on the previous thread's ownership of write-lock on the same document. There is just JDK's own code involved so we should file an issue against JDK for this problem.
Comment 19 Miloslav Metelka 2010-12-21 15:33:24 UTC
Since this is basically a JDK issue I mark it as WONTFIX.