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.
dev build 200809050201 1) Open Netbeans 2) In Windows Vista go to "Appearance Settings" -> "Effects" -> "Use the following method to smooth edges of screen fonts" and change from "ClearType" to "Standard" (or vice-versa) 3) Minimize and restore the Netbeans window 4) Netbeans hangs and must be killed This is probably related to issue 137845 which states that we must listen for anti-aliasing changes in the OS and respond accordingly
Sorry in step 2 you need to go to "Control Panel" -> "Windows Color and Appearance" before the rest of the items I listed. PS: SwingSet2 handles this perfectly, you can even see the font anti-aliasing setting changing in real-time.
I stand corrected, this has nothing to do with anti-aliasing. I can reproduce this hang 100% of the time simply by minimizing and restoring the window. I'm attaching a thread dump.
Created attachment 69166 [details] thread dump
build 1.6.0_10-rc-b28, Windows Vista 64-bit
reassigning to core for evaluation
reassigning to editor it seems that the AWT thread is locked - locked <0x0000000006eafeb8> (a java.lang.Class for org.netbeans.api.editor.EditorRegistry) at org.netbeans.api.editor.EditorRegistry$FocusL.focusGained(EditorRegistry.java:555) pchytil, could you try to reproduce on Vista?
I'm not sure why exactly the IDE deadlocked or if the threaddump actually shows a deadlock. But I tried to improve the situation by fixing EditorRegistry not to fire events when holding a lock. http://hg.netbeans.org/main/rev/1ede45ab9729
I am unable to reproduce it on 32bit Vista (I do not have 64bit Vista available for testing): Product Version: NetBeans IDE Dev (Build 200809050201) Java: 1.6.0_10-beta; Java HotSpot(TM) Client VM 11.0-b11 System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb) Userdir: C:\Users\Petr\.netbeans\dev I also played around with ClearType settings, but without any success.
Lukas why did you assign this to openide/editor? It does not seem to be deadlock. I would need more thread dumps to see if there is any change in AWT thread state. It could be some live lock that AWT thread does not free lock on org.netbeans.api.editor.EditorRegistry. At this moment I believe from thread dump that AWT thread is RUNNABLE. It looks like problem with gsf which waits for some locks. Passing back to editor.
I checked thread dump. Firing events from EditorRegistry out of lock should help in this case but it is not clear if it is real cause in this case. Reporter please generate more thread dumps and attach it here so I can check status of AWT thread. Thanks.
I discussed this with Hozna Lahoda and as he pointed out the deadlock is likely to be between 'AWT-EventQueue-1' and 'gsf module install' threads and involves class loading. The 'gsf module install' thread is loading o.n.napi.gsfret.source.Source, which accesses EditorRegistry from its static initializer. The two locks that are locked at this moment are JVM's lock for classloading and EditorRegistry.class. In the 'AWT-EventQueue-1' thread the EditorRegistry fires an event when holding the EditorRegistry.class lock. The event reaches o.n.napi.gsfret.source.support.OpenedEditors, which needs to access o.n.napi.gsfret.source.Source class. So, the 'AWT-EventQueue-1' thread locks the two above mentioned locks in the opposite order. I believe that my fix mentioned earlier in this issue resolves the problem. Gili, could you please try a newer build and confirm that the deadlock is really fixed? Thanks
I surprised that AWT thread state is RUNNABLE. It is weird.
I am surprised that AWT thread state is RUNNABLE. It is weird.
Yes, it looks weired. But since there is no lock for classloading explicitly mentioned in the stacktrace either the JVM probably does not detect the thread status correctly in this case.
Do you have a specific changeset handy? It would be good to look up what "golden" build it ended up in to make sure I don't download the wrong version.
Changeset was given by Vita above. It is http://hg.netbeans.org/main/rev/1ede45ab9729. Or do you need anything else? It modifies editor.lib2/src/org/netbeans/api/editor/EditorRegistry.java. It changes synchronization when events are fired.
Integrated into 'main-golden', will be available in build *200809081401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/1ede45ab9729 User: Vita Stejskal <vstejskal@netbeans.org> Log: #146336: trying to prevent a deadlock; EditorRegistry does not fire events when holding a lock
Works for me. Thanks guys!
*** Issue 146516 has been marked as a duplicate of this issue. ***
*** Issue 146761 has been marked as a duplicate of this issue. ***
*** Issue 147290 has been marked as a duplicate of this issue. ***