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 28035 - DEADLOCK during startup (Can't start ide)
Summary: DEADLOCK during startup (Can't start ide)
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 3.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: mslama
URL:
Keywords: RANDOM, THREAD
Depends on:
Blocks:
 
Reported: 2002-10-16 06:42 UTC by dmladek
Modified: 2008-12-23 10:50 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
FullThreadDump with deadlock in JNI (10.23 KB, text/plain)
2002-10-16 06:44 UTC, dmladek
Details
Patch (27.43 KB, application/octet-stream)
2002-10-17 15:49 UTC, mslama
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2002-10-16 06:42:21 UTC
>Log Session: Støeda, 16. øíjen 2002 7:31:05 CEST
>System Info:
  Product Version       = NetBeans IDE Dev (Build
200210160100)
  IDE Versioning        = IDE/1 spec=3.13
impl=200210160100
  Operating System      = Linux version 2.4.18
running on i386
  Java; VM; Vendor      = 1.4.1; Java HotSpot(TM)
Client VM 1.4.1-b21; Sun Microsystems Inc.
  Java Home             =
/usr/java/j2sdk1.4/sun/jdk1.4.1/jre
  System Locale; Encod. = cs_CZ; ISO-8859-2
  Home Dir; Current Dir = /home.local/danielm;
/DISKS/storage3/forte/NBdev-last/netbeans/bin
  IDE Install; User Dir =
/home.local/danielm/NBdev-last;
/home.local/danielm/.netbeans/dev
=====================================================================

I took today the latest available nbdev build and
executed with "new" user dir (so nothing could be
wrong from previous work)
But ide freez and I made Thread Dump.


Found one Java-level deadlock:
=============================
"AWT-EventQueue-0":
  waiting to lock monitor 0x8087b7c (object
0x4a524838, a java.lang.Class)
  in JNI, which is held by "main"
"main":
  waiting to lock monitor 0x8087e1c (object
0x44a09678, a java.awt.Component$AWTTreeLock),
  which is held by "AWT-EventQueue-0"

Java stack information for the threads listed above:
===================================================
"AWT-EventQueue-0":
        at
sun.awt.motif.MWindowPeer.pDispose(Native Method)
        at
sun.awt.motif.MComponentPeer.disposeImpl(MComponentPeer.java:451)
        at
sun.awt.motif.MWindowPeer.disposeImpl(MWindowPeer.java:133)
        at
sun.awt.motif.MComponentPeer.dispose(MComponentPeer.java:465)
        at
java.awt.Component.removeNotify(Component.java:5557)
        - locked <0x44a09678> (a
java.awt.Component$AWTTreeLock)
        at
java.awt.Container.removeNotify(Container.java:2069)
        - locked <0x44a09678> (a
java.awt.Component$AWTTreeLock)
        at
java.awt.Window$1$DisposeAction.run(Window.java:539)
        at java.awt.Window.dispose(Window.java:552)
        at
org.netbeans.core.Splash$1.run(Splash.java:80)
        at
java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
        at
java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
        at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
        at
java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
"main":
        at
java.awt.Container.getComponents_NoClientCode(Container.java:256)
        - waiting to lock <0x44a09678> (a
java.awt.Component$AWTTreeLock)
        at
java.awt.Container.getComponents(Container.java:248)
        at
javax.swing.SortingFocusTraversalPolicy.enumerateCycle(SortingFocusTraversalPolicy.java:156)
        at
javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:87)
        at
javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:331)
        at
javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:143)
        at
javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:391)
        at
java.awt.Window.isFocusableWindow(Window.java:1410)
        at sun.awt.motif.MWindowPeer.pShow(Native
Method)
        at
sun.awt.motif.MWindowPeer.toFront(MWindowPeer.java:140)
        at java.awt.Window.toFront(Window.java:623)
        at
org.netbeans.core.Splash.showSplash(Splash.java:70)
        at
org.netbeans.core.Main.showSplashAgain(Main.java:484)
        at
org.netbeans.core.NonGui.run(NonGui.java:433)
        at org.netbeans.core.Main.run(Main.java:237)
        at
org.openide.TopManager.initializeTopManager(TopManager.java:126)
        - locked <0x4a3a54b8> (a java.lang.Class)
        at
org.openide.TopManager.getDefault(TopManager.java:87)
        at org.netbeans.core.Main.start(Main.java:389)
        at
org.netbeans.core.TopThreadGroup.run(TopThreadGroup.java:81)
        at java.lang.Thread.run(Thread.java:536)

Found 1 deadlock.



I'm gonna attach FTD.
Comment 1 dmladek 2002-10-16 06:44:59 UTC
Created attachment 7665 [details]
FullThreadDump with deadlock in JNI
Comment 2 dmladek 2002-10-16 06:53:13 UTC
After killing java processes (doesn't work standart CTR+C)  ide
started without problems (I continueed with just created user dir).
Then I tried it with deleting user dir and everything was still OK.

I'd like to mentioned that I'm running SMP kernel 2.4.18(2CPU)

Comment 3 Marian Mirilovic 2002-10-16 09:21:50 UTC
[nb_dev](20021016) - unreproducible

Dan is it reproducible ? 
Try more than once run with clear userdir, thanks.

It seems like Splash screen, who is owner ? 
Comment 4 dmladek 2002-10-16 11:29:42 UTC
No, it isn't reproductable. At least it didn't happen again during
my 3 attempts (hope that it is enough, I can't be restarting the ide
whole day:)
Comment 5 mslama 2002-10-17 15:40:48 UTC
I tried to replane call of show() and toFront() to AWT thread in
Splash.showSplash() to avoid this deadlock. I will prepare attachment
with patch.
Comment 6 mslama 2002-10-17 15:49:44 UTC
Created attachment 7691 [details]
Patch
Comment 7 mslama 2002-10-17 15:54:05 UTC
Patch logs some output to console (also call stack) - it is OK. I will
remove it as I will commit it. I tested it on Linux JDK 1.3.1, JDK
1.4.1. Please test it on Windows and Solaris. (Just to be sure, it
should not cause any problem.)
Comment 8 dmladek 2002-10-18 06:43:15 UTC
OK. But problem is that this bug is unreporductable...so how we get to
know that this patch helps ('cause I haven't met this deadlock since I
reported it). But anyway...I'm gonna to use it:-)
Comment 9 dmladek 2002-10-18 06:49:52 UTC
One more thing:
Is it neccesseary for testing the fix always start ide with clear user
settings? Or I could use continuesly my projects (which I preffer).
Thanks
Comment 10 mslama 2002-10-18 09:03:09 UTC
I am sure that patch solves deadlock. Code from main thread which
caused deadlock between main and AWT thread is now performed in AWT
thread. I just wanted to make sure that moving code to AWT thread does
not cause any other trouble. AFAIK deadlock happened when hide and new
show was mixed, it could happen only durign first user start with
empty user dir in case that Import Wizard is not displayed. Because
now is IW displayed again from Wed (16 Oct) I propose to use build
from Mon (14 Oct), Tue (15 Oct) to test patch.
Comment 11 mslama 2002-10-18 12:43:31 UTC
Fixed in trunk. Call of show() and toFront() is replanned to AWT
thread to avoid deadlock.

Modified:
core/src/org/netbeans/core/Splash.java r.1.69
Comment 12 pzajac 2002-10-23 10:26:59 UTC
verified