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 149130

Summary: OperationSupportImpl fails to acquire ModuleManager.mutex
Product: platform Reporter: Jesse Glick <jglick>
Component: AutoupdateAssignee: Jiri Rechtacek <jrechtacek>
Status: RESOLVED FIXED    
Severity: blocker Keywords: RANDOM, TEST, THREAD
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
URL: http://deadlock.netbeans.org/hudson/job/NB-Core-Build/1482/testReport/org.netbeans.modules.autoupdate.services/UninstallDisabledTest/testSelf/
Issue Type: DEFECT Exception Reporter:
Attachments: proposed patch

Description Jesse Glick 2008-10-03 21:59:54 UTC
java.lang.IllegalThreadStateException: You are attempting to make changes to org.netbeans.ModuleManager@a2220f in a
property change callback. This is illegal. You may only make module system changes while holding a write mutex and not
inside a change callback. See #16328.
	at org.netbeans.ModuleManager.assertWritable(ModuleManager.java:226)
	at org.netbeans.ModuleManager.disable(ModuleManager.java:932)
	at
org.netbeans.modules.autoupdate.services.OperationSupportImpl$ForDirectDisable.doOperation(OperationSupportImpl.java:281)
	at org.netbeans.api.autoupdate.OperationSupport.doOperation(OperationSupport.java:67)
	at org.netbeans.modules.autoupdate.services.OperationsTestImpl.disableModule(OperationsTestImpl.java:402)
	at org.netbeans.modules.autoupdate.services.UninstallDisabledTest.testSelf(UninstallDisabledTest.java:64)

Indeed MM is being used without taking a lock first, contrary to its documentation.
Comment 1 Jiri Rechtacek 2008-10-06 11:25:58 UTC
I'll try to prepare a patch for that...
Comment 2 Jiri Rechtacek 2008-10-07 15:01:37 UTC
Created attachment 71292 [details]
proposed patch
Comment 3 Jiri Rechtacek 2008-10-23 15:23:05 UTC
Test UninstallDisabledTest throws this exception.
Comment 4 Jiri Rechtacek 2008-11-04 15:06:35 UTC
fixed in core-main/rev/1bbd0861d7db
Comment 5 Quality Engineering 2008-11-05 04:35:45 UTC
Integrated into 'main-golden', will be available in build *200811050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/1bbd0861d7db
User: Jiri Rechtacek <jrechtacek@netbeans.org>
Log: #149130: OperationSupportImpl fails to acquire ModuleManager.mutex