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 50289 - Deadlock when activating/deactivating modules
Summary: Deadlock when activating/deactivating modules
Status: CLOSED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Jesse Glick
URL:
Keywords: THREAD
Depends on:
Blocks:
 
Reported: 2004-10-12 16:45 UTC by Roman Strobl
Modified: 2008-12-22 16:50 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
First thread dump (24.49 KB, text/plain)
2004-10-13 12:45 UTC, Roman Strobl
Details
Second thread dump (27.03 KB, text/plain)
2004-10-13 12:45 UTC, Roman Strobl
Details
Here is the correct thread dump with all info needed. (118.47 KB, text/plain)
2004-10-13 12:55 UTC, Roman Strobl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Strobl 2004-10-12 16:45:03 UTC
[Netbeans 200410111800; WinXP; JDK 1.5.0]

Deadlock occured everytime I was activating and 
deactivating modules in Tools->Options->System-
>Modules. Deadlock occures after 10-20 clicks on 
enable checkboxes. IDE freezes completely and 
has to be killed from task manager.

Reproducible on JDK 1.5.0_01-ea-b3. 

Reproducible on JDS as well, I can deadlock the 
IDE in JDS faster than in WinXP. Normal kill 
doesn't seem to work, kill -9 must be used.

To reproduce, just try to play with the modules 
settings, for me it always occured, sometimes 
earlier, sometimes later. I didn't find any 
dependence on time/activity, only it seems to 
happen more often when the request is complex 
(when it needs to evaluate dependencies). But it 
happens when clicking on a module without 
dependencies as well.
Comment 1 Jan Chalupa 2004-10-12 17:42:21 UTC
Roman, please provide a thread dump of the locked IDE:
http://qa.netbeans.org/bugzilla/generating-thread-dumps.html
Comment 2 Roman Strobl 2004-10-13 12:44:21 UTC
I attach two thread dumps I got from the console. The dumps are 
different before the freeze so if it would help I can generate some 
more. 
Comment 3 Roman Strobl 2004-10-13 12:45:04 UTC
Created attachment 18254 [details]
First thread dump
Comment 4 Roman Strobl 2004-10-13 12:45:25 UTC
Created attachment 18255 [details]
Second thread dump
Comment 5 Roman Strobl 2004-10-13 12:55:29 UTC
Created attachment 18257 [details]
Here is the correct thread dump with all info needed.
Comment 6 Jesse Glick 2004-10-13 17:56:32 UTC
Looks like a Lookup <-> InstalledFileLocator conflict; both need the
other.

I think I can make IFL avoid calling Lookup while holding a lock in
almost all circumstances.
Comment 7 Jesse Glick 2004-10-13 20:52:17 UTC
Have a patch which seems to work - at least, I do not see deadlocks
when turning modules on and off.
Comment 8 Roman Strobl 2004-10-14 09:42:58 UTC
I guess the patch wasn't applied before yesterday's daily build, was it?

I can reproduce the deadlock on last daily build. Maybe this will help
- I always reproduce it by opening Java and Web modules and
activate/deactivate the modules more or less in random. Maybe I'm not
as nice to Netbeans as I could be...
Comment 9 Jaroslav Tulach 2004-10-14 13:36:58 UTC
Btw. and off topic: Is not ModuleBean badly written? I see too much
request processors occupied by it. One would be enough, is it not?
Comment 10 Jesse Glick 2004-10-14 18:35:38 UTC
Of course not, the patch was not applied yet or I would have already
closed this.

To Yarda - I have a separate patch which reduces the RP usage to one
thread at a time.

I have been testing disabling and reenabling all modules and have not
seen the deadlock with the patch. (I have seen other problems.)
Comment 11 Jesse Glick 2004-10-14 18:42:26 UTC
Fix:

committed     Up-To-Date  1.8        
openide/src/org/openide/modules/InstalledFileLocator.java

Use one RP:

committed     Up-To-Date  1.34       
core/src/org/netbeans/core/ui/ModuleBean.java

Other fixes (besides for issue #50391):

committed   * Up-To-Date  1.8        
core/javahelp/src/org/netbeans/modules/javahelp/Installer.java
committed   * Up-To-Date  1.9        
httpserver/src/org/netbeans/modules/httpserver/HttpServerURLMapper.java
committed   * Up-To-Date  1.8         java/project/manifest.mf
committed   * Up-To-Date  1.4         projects/projectui/manifest.mf
Comment 12 Roman Strobl 2004-10-15 13:15:45 UTC
Tested on NB 200410141800 on JDS, during 20 minutes of activating and
deactivating modules no deadlock occurred.