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 58336 - Deadlock of IDE at startup or expansion of project node
Summary: Deadlock of IDE at startup or expansion of project node
Status: CLOSED WORKSFORME
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 4.x
Hardware: PC Windows ME/2000
: P2 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: JDK_SPECIFIC
Depends on:
Blocks:
 
Reported: 2005-04-26 14:07 UTC by Jiri Kovalsky
Modified: 2008-12-22 23:39 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump of startup deadlock. (18.22 KB, text/plain)
2005-04-26 14:08 UTC, Jiri Kovalsky
Details
Thread dump of deadlock when project node was touched. (18.29 KB, text/plain)
2005-04-26 14:10 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2005-04-26 14:07:47 UTC
Pre-RC1 build #200504171930 of NetBeans 4.1
Windows 2000, JDK 1.4.2_02 build #03

Description:
============
Today I can't start IDE or use it on platform mentioned above in spite of using
it just fine last week. It always deadlocks - firstly at startup, now after
classpath is scanned and I tough project node. I will try to provide you with
more information as I find some. I only had one web project opened with few
files of different type (XML, DTD, Java, TAG, TLD or JSP). I am attaching full
thread dumps of startup and in-run deadlocks.

What I did:
===========
1. I started the IDE 6 days ago with empty userdir.
2. I created new sample web application project.
3. I generated files mentioned above and tested code completion, syntax
highlighting, generated handlers etc.
4. I closed the IDE and launched it today but it didn't even start.
5. Later it started fine but froze when I touched my web project node.
Comment 1 Jiri Kovalsky 2005-04-26 14:08:46 UTC
Created attachment 21869 [details]
Thread dump of startup deadlock.
Comment 2 Jiri Kovalsky 2005-04-26 14:10:55 UTC
Created attachment 21870 [details]
Thread dump of deadlock when project node was touched.
Comment 3 Marian Mirilovic 2005-04-26 14:15:30 UTC
Radek please look at this ....
Comment 4 Jiri Kovalsky 2005-04-26 14:56:21 UTC
I have some good news. My latest investigations show that it works fine in RC1
(#200504200735) and/or JDK 1.5.0_03 build #06. However, I can easily reproduce
the deadlock with my userdir in pre-RC1 and 1.4.2. Let me please know if you
want me to produce more thread dumps or attach the userdir or try another
build/Java platform.

===============================================================
  Build   |  JDK 1.4.2_02 build #03  |  JDK 1.5.0_03 build #06
----------+--------------------------+-------------------------
 Pre-RC1  |  Dead locks constantly   |  Works fine
   RC1    |  Works fine              |  Works fine
===============================================================
Comment 5 Jiri Kovalsky 2005-04-26 14:58:03 UTC
This issue is probably JDK specific.
Comment 6 rmatous 2005-04-26 15:47:34 UTC
Petr,please write up some comments why usage of Mutex.Privileged from
FileBasedFileSytem should stop its threads in wait.

Maybe I overlooked something, but I don't see any reason for that.
Comment 7 Petr Nejedly 2005-04-27 10:03:31 UTC
Mutex.Privileged expects you're careful enough to not forget to unlock it.

You have to very carefuly use the pattern of:
mp.enterXAccess();
try {
   ...
} finally {
  mp.exitXAccess();
}

If you fail to unlock it somewhere, it would be impossible to track it from the
thread dump. If you leak out the mp reference, noone can guarantee the behaviour.

In the dumps, I see just two threads trying to enter but noone holding the lock.
It can be exactly the case of missed exitXAccess(), maybe in older version
of the code (if not reproducible any more).
Comment 8 rmatous 2005-04-27 11:14:51 UTC
There were no fixes between pre-RC1 and RC1 that should affect it. Sorry, I have
even no idea where to put some logging, trace information or how to trap it at all. 

AFAIK to reproduce this problem, there is necessary to run Pre-RC1 NB on
J.Kovalsky's computer with its userdir, on JDK 1.4.2_02 build #03. 

I can't decide whether there might be problem in Mutex implementation. Petr,
please evaluate.
Comment 9 rmatous 2005-04-27 11:17:27 UTC
Jirka, please try to investigate. For example if there was possible to reproduce
it with your userdir on arbitrary machine - it could help.
Comment 10 Jiri Kovalsky 2005-04-27 13:06:45 UTC
Okay, I'm gonna deep dive into this problem ...
Comment 11 rmatous 2005-04-28 14:41:47 UTC
I don't know why those 2 threads are in wait. If there is no magic and this
report is right then probably must be problem somwere in Mutex. Reassigned to Petr.
Comment 12 Jiri Kovalsky 2005-04-28 14:48:49 UTC
After one more day spent on reproducing it elsewhere I agree with closing this
bug as invalid. I used JDK 1.4.2_02 build #03 to launch Pre-RC1 with the same
userdir and project on my notebook but couldn't invoke the bug again. I have to
admit that the computer where I first encountered the bug had some performance
problems and yesterday has finally crashed (memory failure) so I can't reproduce
it there any more. If you are sure your code is okay, I have no objections
against closing this defect.
Comment 13 Jiri Kovalsky 2005-04-28 14:52:27 UTC
Changing back component. Sorry for another mail ...
Comment 14 Marian Mirilovic 2005-04-28 14:54:10 UTC
Ok, WORKSFORME
Comment 15 Jiri Kovalsky 2005-04-28 15:04:03 UTC
Verifying then ...