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 240442 - FeaturesOffDemandTest deadlocks often on module system shutdown
Summary: FeaturesOffDemandTest deadlocks often on module system shutdown
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 8.0
Hardware: All All
: P2 normal (vote)
Assignee: Jaroslav Tulach
Depends on:
Reported: 2014-01-14 10:01 UTC by Jaroslav Tulach
Modified: 2015-08-02 05:56 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:

Thread dump after the deadlock (19.63 KB, text/plain)
2014-01-14 10:01 UTC, Jaroslav Tulach

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2014-01-14 10:01:58 UTC
Created attachment 143932 [details]
Thread dump after the deadlock

Caused by

changeset:   2c66d674a840
user:        Jaroslav Tulach <>
date:        Tue Nov 05 10:59:42 2013 +0100
summary:     Cannot enable module if one does not have write lock on the module manager. Demonstrates when OSGi module is enabled lazily

Comment 1 Jaroslav Tulach 2014-01-14 11:49:06 UTC
Can you please review following change

It seems the easiest way to deal with the deadlock (that so far occurred only in a test). The change also brings the API of Mutex.Privileged closer to JDK's Lock, so I hope it is non-controversial.

I've integrated the change to see if it stabilizes the ergonomics build (failed at least five times in a week due to the problem), but I am ready to apply your comments before pushing to main-silver.
Comment 2 Jaroslav Tulach 2014-01-18 15:53:15 UTC
The build of ergonomics seems more stable after the change. Five successful runs, two test failures but none related to this deadlock. I think we should proceed with integration.
Comment 3 Quality Engineering 2014-01-19 02:11:11 UTC
Integrated into 'main-silver', will be available in build *201401190001* on (upload may still be in progress)

User: Jaroslav Tulach <>
Log: Issue #240442 can best be solved by waiting only a limited time (e.g. 10s) and then giving up. Adding neccessary methods to Mutex.Privileged.
Comment 4 craiggarrett 2015-07-29 12:17:21 UTC
Jaroslav Tulach, I wish you had used a non-zero timeout value in the other calls to sleep, as I am experiencing NetBeans lockup on startup. This is happening on the Swing thread via the call, line 1257:

enter(mutexMode, t, 0);
Comment 5 Jaroslav Tulach 2015-08-02 05:56:13 UTC
Is your thread dump the same one as the one attached? E.g. Or is it slightly different? Please attach it.