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 143726 - Deadlock on startup of NB
Summary: Deadlock on startup of NB
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
: 143730 143738 143749 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-13 10:12 UTC by Petr Cyhelsky
Modified: 2008-08-21 15:40 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
threaddump generated via VisualVM (33.96 KB, text/plain)
2008-08-13 10:14 UTC, Petr Cyhelsky
Details
tread dump (22.97 KB, text/plain)
2008-08-18 12:24 UTC, Ivan Sidorkin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2008-08-13 10:12:02 UTC
Product Version: NetBeans IDE Dev (Build 200808130201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)

Observed: I experienced deadlock at startup of NB. From the thread dump it seems that
org.netbeans.modules.db.mysql.impl.ServerNodeProvider might be responsible - please see the attached threaddump. This
may be in relation with fixing of Issue #129573 and Issue #143048.
Comment 1 Petr Cyhelsky 2008-08-13 10:14:12 UTC
Created attachment 67227 [details]
threaddump generated via VisualVM
Comment 2 Petr Cyhelsky 2008-08-13 10:33:04 UTC
This deadlock occurs every time NB starts with empty userdir.
Comment 3 Marian Mirilovic 2008-08-13 10:38:07 UTC
info from issue 143730 :
Product Version         = NetBeans IDE Dev (Build 200808130201)
  Operating System        = Linux version 2.6.24-19-generic running on amd64
  Java; VM; Vendor        = 1.6.0_10-rc; Java HotSpot(TM) 64-Bit Server VM 11.0-b13; Sun Microsystems Inc.
  Runtime                 = Java(TM) SE Runtime Environment 1.6.0_10-rc-b26

- download full zip distro
- unzip and run with Userdir & JDK switches
- after start the whole IDE is frozen forever .. with "Registering the Java DB databases" in progress line. 
It happened for me  3 from 4 times I started IDE. I haven\t seen such problems before (with Beta...).
can't reproduce with previous daily build (200808121401)
Comment 4 Marian Mirilovic 2008-08-13 10:38:33 UTC
*** Issue 143730 has been marked as a duplicate of this issue. ***
Comment 5 Petr Blaha 2008-08-13 14:35:04 UTC
*** Issue 143749 has been marked as a duplicate of this issue. ***
Comment 6 David Vancouvering 2008-08-13 15:17:24 UTC
I'm on it.
Comment 7 David Vancouvering 2008-08-13 16:54:34 UTC
Thanks for the thread dump.  It looks as though the problem is that one thread is doing a lookup that ultimately wants
to initialize ServerNodeProvider

"Asynch children creator org.openide.nodes.AsynchChildren@19431dc" daemon prio=2 tid=0x04181400 nid=0xf18 waiting for
monitor entry [0x301cf000..0x301cfd80]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.netbeans.modules.db.mysql.impl.ServerNodeProvider.getDefault(ServerNodeProvider.java:79)
	- waiting to lock <0x1fc9b160> (a java.lang.Class for org.netbeans.modules.db.mysql.impl.ServerNodeProvider)

The problem is another thread in the midst of a lookup is in the initializer for ServerNodeProvider, and this
initializer is *also* doing a Lookup (to get the list of Installation implementations):
"Asynch children creator org.openide.nodes.AsynchChildren@19431dc" daemon prio=2 tid=0x0417e800 nid=0xc70 in
Object.wait() [0x2d07e000..0x2d07fb80]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	- waiting on <0x07cbdce0> (a org.openide.util.RequestProcessor$Task)
	at java.lang.Object.wait(Object.java:485)
	at org.openide.util.Task.waitFinished(Task.java:130)
	- locked <0x07cbdce0> (a org.openide.util.RequestProcessor$Task)
	at org.openide.util.RequestProcessor$Task.waitFinished(RequestProcessor.java:756)
	at org.openide.loaders.FolderLookup$Dispatch.waitFinished(FolderLookup.java:295)
	at org.openide.loaders.FolderLookup$ProxyLkp.beforeLookup(FolderLookup.java:411)
	at org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:645)
	at org.openide.util.lookup.ProxyLookup$R.beforeLookup(ProxyLookup.java:664)
	at org.openide.util.lookup.ProxyLookup$R.myBeforeLookup(ProxyLookup.java:653)
	at org.openide.util.lookup.ProxyLookup$R.computeResult(ProxyLookup.java:518)
	at org.openide.util.lookup.ProxyLookup$R.allInstances(ProxyLookup.java:489)
	at org.openide.util.Lookup.lookupAll(Lookup.java:245)
	at org.netbeans.modules.db.mysql.impl.InstallationManager.getInstallations(InstallationManager.java:79)
	at org.netbeans.modules.db.mysql.impl.InstallationManager.detectInstallation(InstallationManager.java:115)
	at org.netbeans.modules.db.mysql.impl.ServerNodeProvider.findAndRegisterInstallation(ServerNodeProvider.java:113)
	at org.netbeans.modules.db.mysql.impl.ServerNodeProvider.findAndRegisterMySQL(ServerNodeProvider.java:102)
	at org.netbeans.modules.db.mysql.impl.ServerNodeProvider.<init>(ServerNodeProvider.java:86)
	at org.netbeans.modules.db.mysql.impl.ServerNodeProvider.getDefault(ServerNodeProvider.java:80)
	- locked <0x1fc9b160> (a java.lang.Class for org.netbeans.modules.db.mysql.impl.ServerNodeProvider)

So I guess the lesson is, don't do a lookup in a class initializer that is also invoked by Lookup. 

Comment 8 David Vancouvering 2008-08-13 17:06:33 UTC
Fixed with changeset 1852c8e203e1
Comment 9 David Vancouvering 2008-08-14 15:20:00 UTC
*** Issue 143738 has been marked as a duplicate of this issue. ***
Comment 10 Ivan Sidorkin 2008-08-18 12:22:52 UTC
reproduced with NetBeans IDE Dev (Build 200808170243)
Comment 11 Ivan Sidorkin 2008-08-18 12:24:34 UTC
Created attachment 67690 [details]
tread dump
Comment 12 Petr Cyhelsky 2008-08-18 12:42:27 UTC
To me it seems it is different deadlock - the threaddump seems to be almost the same as in Issue #144233
Comment 13 David Vancouvering 2008-08-18 19:46:34 UTC
This is a different stack trace, and I agree it looks like Issue 144233. Closing this issue again, please add your
vote/cc to 144233.
Comment 14 Petr Cyhelsky 2008-08-21 15:40:52 UTC
verified on:
Product Version: NetBeans IDE Dev (Build 200808210201)
Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b14
System: Windows Vista version 6.0 running on x86; Cp1250; cs_CZ (nb)