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 64710 - Dead lock when enabling module
Summary: Dead lock when enabling module
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 5.x
Hardware: All All
: P1 blocker (vote)
Assignee: David Strupl
URL:
Keywords: THREAD
: 63482 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-20 09:30 UTC by Jiri Skrivanek
Modified: 2008-12-23 08:42 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump (27.46 KB, text/plain)
2005-09-20 09:30 UTC, Jiri Skrivanek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2005-09-20 09:30:23 UTC
Dead lock occured during commit validation suite. The test did the following:

- open Module Manager
- disable 'Data Files|Image' and wait until "Turning off modules...done."
message appears
- try to enable 'Data Files|Image' again but it got stuck

Build 20050919-1936, JDK1.4.2_09, Solaris Sparc 8.
Comment 1 Jiri Skrivanek 2005-09-20 09:30:45 UTC
Created attachment 24964 [details]
Thread dump
Comment 2 Marian Mirilovic 2005-09-20 10:04:26 UTC
Jirka,
this could be yours, please look at it.
Comment 3 Jesse Glick 2005-09-21 01:40:37 UTC
Not Jirka's.

Yarda do you know what is wrong here? I am not sure what lookup expects locking
order to be.
Comment 4 Jiri Rechtacek 2005-09-22 09:22:37 UTC
*** Issue 63482 has been marked as a duplicate of this issue. ***
Comment 5 Jiri Skrivanek 2005-09-22 15:02:34 UTC
Please, could you look at it in near future? It blocks commit validation often.
Sometimes even report is not sent to broken_builds but process is quietly killed
(e.g. 09:19 09/22/2005). I can easily reproduce it manually on Windows (repeat
to disable/enable image module). Thanks.
Comment 6 Jaroslav Tulach 2005-09-22 16:50:53 UTC
David, this is your deadlock due to lookup of ModuleFactory... 
Comment 7 David Strupl 2005-09-22 18:54:45 UTC
If it is due to my commit I will try to fix it. If I am not able to do so I will
reassign back to you.
Comment 8 David Strupl 2005-09-22 21:11:04 UTC
Checking in ProxyClassLoader.java;
/cvs/core/bootstrap/src/org/netbeans/ProxyClassLoader.java,v  <-- 
ProxyClassLoader.java
new revision: 1.21; previous revision: 1.20
done

Please verify.

BTW this call is also *very* suspicious:
org.openide.modules.InstalledFileLocator.getInstances(InstalledFileLocator.java:194)
Calling allInstances from withing a private lock is begging for problems. I
suggest to patch also InstalledFileLocator to call this without holding a lock
(and potentially lock only assigning the result if needs to be). It is generally
 much safer to call allInstances twice and synchronizde only assigning the
result ...
Comment 9 Jesse Glick 2005-09-22 21:18:39 UTC
I will patch InstalledFileLocator.java acc. to David's comments (thanks for tip!).
Comment 10 Jan Chalupa 2005-09-22 22:35:08 UTC
It seems that the commit validation on the continuous build of release50_beta
failed for the same reason. A beta fix candidate?
Comment 11 Marian Mirilovic 2005-09-22 23:02:46 UTC
I am not sure it could affect the users. I can't reproduce it by hand.

BTW: we have to fix it if it causes failing of commit validation, just to be
sure it won't happen during building of Beta.

So, 
David is it safe? 

Jirka, 
can you reproduce it manually? Is it reproducible only on Sol/SPARC?
Comment 12 Jesse Glick 2005-09-22 23:27:59 UTC
FYI:

committed     Up-To-Date  1.2        
openide/modules/src/org/openide/modules/InstalledFileLocator.java
Comment 13 Jan Chalupa 2005-09-23 05:52:27 UTC
Re "Is it reproducible only on Sol/SPARC?"

Commit validation locked for me on Windows at the same point the day before
yesterday. I suspect it was the same problem. I don't think it's Sol/SPARC specific.
Comment 14 Marian Mirilovic 2005-09-23 06:37:57 UTC
Ok, lets say this is beta stopper. 

David, or anybody from the core team, 
please prepare the patch for today's trunk build (we need to test it before
merge to beta branch).

Jirka , 
could you please verified in trunk (or continual build) ?

Thanks in advance.
Comment 15 David Strupl 2005-09-23 06:50:51 UTC
Marian sorry but I don't know what do you mean by "prepare the patch for today's
trunk build". The change is in the trunk since yesterday evening ...

To Honza: I assume the fix being pretty safe. It calls much less code under the
lock. The methods that are now called unsynchronized operate only on local data
so the risk of data corruption is IMHO very low (only if I overlooked
something). I suggest Jarda reviews the change before you commit it to the beta
branch.
Comment 16 Marian Mirilovic 2005-09-23 07:04:15 UTC
David:
You are right, the fix is there, but I think it can't be in the yesterday's
build (it was built after the fix was integrated, I think).
Don't worry, we can verify the fix in continual build, I hope ;)
Comment 17 Jaroslav Tulach 2005-09-23 07:18:12 UTC
I do not understand how you can believe fixing deadlocks without a test is 
useful... 
 
core/bootstrap/test/unit/src/org/netbeans/Deadlock64710Test.java,v  <--  
Deadlock64710Test.java 
initial revision: 1.1 
 
I had this ready for commit yesterday evening, but the CVS was locked by 
httpd... 
Comment 18 Jan Chalupa 2005-09-25 16:36:01 UTC
Commit validation on release50_beta deadlocked again. We should have put the fix
into the branch. Too late now, I'm afraid. :-(
Comment 19 Marian Mirilovic 2005-09-26 07:38:49 UTC
Well, does it mean : this isn't fixed in Beta branch ?
Comment 20 Jan Chalupa 2005-09-26 07:45:49 UTC
Sounds like it. You want a re-spin of the Beta bits?
Comment 21 Jan Chalupa 2005-09-26 07:55:03 UTC
Ok, we know this can occur during commit validation. Has anybody seen a user
report of this deadlock?
Comment 22 Jan Chalupa 2005-09-26 08:01:36 UTC
Ok, we know this can occur during commit validation. Has anybody seen a user
report of this deadlock?
Comment 23 Marian Mirilovic 2005-09-26 08:11:02 UTC
It hasn't been reported by real-user so far, so propose to let it fixed just in
trunk (not for Beta).