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 92449 - Deadlock of Settings and Options
Summary: Deadlock of Settings and Options
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: Settings (show other bugs)
Version: 6.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords:
: 93415 94310 94407 95199 95936 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-01-12 15:22 UTC by Miloslav Metelka
Modified: 2007-11-05 13:42 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Thread dump of the deadlock (25.88 KB, text/plain)
2007-01-12 15:23 UTC, Miloslav Metelka
Details
thread dump (24.71 KB, text/plain)
2007-02-12 17:02 UTC, Jiri Prox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miloslav Metelka 2007-01-12 15:22:36 UTC
Manual build 070109.
After opening Tools->Options I've got the attached deadlock.
Comment 1 Miloslav Metelka 2007-01-12 15:23:15 UTC
Created attachment 37321 [details]
Thread dump of the deadlock
Comment 2 Vitezslav Stejskal 2007-01-14 22:24:12 UTC
Ugly, I've seen it too. It seems that it's happening only when you open
Tools-Options for the first time. It also seemed to help when I waited for a
while between opening the dialog and going to Editors category, but that could
be just my specific configuration.
Comment 3 Vitezslav Stejskal 2007-01-16 04:59:01 UTC
Should be fixed now.

Checking in src/org/netbeans/modules/editor/options/AllOptionsFolder.java;
/cvs/editor/src/org/netbeans/modules/editor/options/AllOptionsFolder.java,v  <--
 AllOptionsFolder.java
new revision: 1.39; previous revision: 1.38
done
Checking in src/org/netbeans/modules/editor/NbEditorKit.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorKit.java,v  <-- 
NbEditorKit.java
new revision: 1.100; previous revision: 1.99
done
Checking in apichanges.xml;
/cvs/editor/apichanges.xml,v  <--  apichanges.xml
new revision: 1.5; previous revision: 1.4
done
Checking in test/cfg-unit.xml;
/cvs/editor/test/cfg-unit.xml,v  <--  cfg-unit.xml
new revision: 1.16; previous revision: 1.15
done
Checking in nbproject/project.properties;
/cvs/editor/nbproject/project.properties,v  <--  project.properties
new revision: 1.27; previous revision: 1.26
done
Comment 4 Vitezslav Stejskal 2007-01-22 04:53:15 UTC
I've rolled back some of the changes, because they were causing problems with
settings initialization. See issue #92667 and issue #92912. We will have to come
up with a better fix.

Checking in src/org/netbeans/modules/editor/NbEditorKit.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorKit.java,v  <-- 
NbEditorKit.java
new revision: 1.101; previous revision: 1.100
done
Checking in test/cfg-unit.xml;
/cvs/editor/test/cfg-unit.xml,v  <--  cfg-unit.xml
new revision: 1.17; previous revision: 1.16
done
Comment 5 Miloslav Metelka 2007-01-29 13:11:27 UTC
*** Issue 93415 has been marked as a duplicate of this issue. ***
Comment 6 Vitezslav Stejskal 2007-02-05 11:32:50 UTC
*** Issue 94310 has been marked as a duplicate of this issue. ***
Comment 7 Vitezslav Stejskal 2007-02-08 23:40:41 UTC
This time hopefully a trouble-free fix.

Checking in src/org/netbeans/modules/editor/options/BaseOptions.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v  <-- 
BaseOptions.java
new revision: 1.139; previous revision: 1.138
done
Checking in src/org/netbeans/modules/editor/options/BasePrintOptions.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BasePrintOptions.java,v  <--
 BasePrintOptions.java
new revision: 1.34; previous revision: 1.33
done
Checking in src/org/netbeans/modules/editor/options/OptionSupport.java;
/cvs/editor/src/org/netbeans/modules/editor/options/OptionSupport.java,v  <-- 
OptionSupport.java
new revision: 1.33; previous revision: 1.32
done
Checking in src/org/netbeans/modules/editor/NbEditorKit.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorKit.java,v  <-- 
NbEditorKit.java
new revision: 1.102; previous revision: 1.101
done
Checking in src/org/netbeans/modules/editor/EditorModule.java;
/cvs/editor/src/org/netbeans/modules/editor/EditorModule.java,v  <-- 
EditorModule.java
new revision: 1.124; previous revision: 1.123
done
Checking in src/org/netbeans/modules/editor/NbEditorSettingsInitializer.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorSettingsInitializer.java,v 
<--  NbEditorSettingsInitializer.java
new revision: 1.22; previous revision: 1.21
done
Checking in libsrc/org/netbeans/editor/Settings.java;
/cvs/editor/libsrc/org/netbeans/editor/Settings.java,v  <--  Settings.java
new revision: 1.63; previous revision: 1.62
done
Checking in test/cfg-unit.xml;
/cvs/editor/test/cfg-unit.xml,v  <--  cfg-unit.xml
new revision: 1.18; previous revision: 1.17
done
Checking in nbproject/project.xml;
/cvs/editor/nbproject/project.xml,v  <--  project.xml
new revision: 1.33; previous revision: 1.32
done
Comment 8 Marco Walther 2007-02-10 03:20:30 UTC
Unfortunately the latest fix broke the Schliemann LanguagesEditorKit:-(

That class has a constructor which gets the content type as parameter. But it 
has no time to initialize itself before you call getContentType() on it:-( So 
that function returns null and everything else is unhappy:-(
Comment 9 Vitezslav Stejskal 2007-02-10 09:09:59 UTC
My applogy. Hopefully a few things will be happy again :-).

Checking in NbEditorKit.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorKit.java,v  <-- 
NbEditorKit.java
new revision: 1.103; previous revision: 1.102
done
Checking in NbEditorSettingsInitializer.java;
/cvs/editor/src/org/netbeans/modules/editor/NbEditorSettingsInitializer.java,v 
<--  NbEditorSettingsInitializer.java
new revision: 1.23; previous revision: 1.22
done
Comment 10 Jiri Prox 2007-02-12 17:01:33 UTC
Another similar deadlock, I think it's related to this issue. Happens when
opening options and immediately when the dialog opens going to Editor tab
Comment 11 Jiri Prox 2007-02-12 17:02:27 UTC
Created attachment 38389 [details]
thread dump
Comment 12 Vitezslav Stejskal 2007-02-14 07:54:04 UTC
... a few more fixes. I've revised the synchronization model in
o.n.editor.Settings and done a few changes that will hopefully let MimeLookup
and Settings coexist until we get rid of the whole damn thing. The trunk build
seems to be working fine, but I might have broken something, so please be
patient and let me know. Just for the record here is the description from my commit:

#92449: fixing synchronization model in Settings and BaseOptions;
 - adding/removing settings initializers, filters and change listeners is not
synchronized on the same lock as reading/writing/initializing setting values
(i.e. Settings.class)
 - firing events from Settings class is done outside of synced sections
 - Settings.reset is asynchronous using a dedicated RequestProcessor
 - BaseOptions methods that initialize settings use the Settings'
read/write/init lock (i.e. Settings.class)
 - updating the deadlock test


Checking in src/org/netbeans/modules/editor/options/BaseOptions.java;
/cvs/editor/src/org/netbeans/modules/editor/options/BaseOptions.java,v  <-- 
BaseOptions.java
new revision: 1.141; previous revision: 1.140
done
Checking in src/org/netbeans/modules/editor/options/OptionSupport.java;
/cvs/editor/src/org/netbeans/modules/editor/options/OptionSupport.java,v  <-- 
OptionSupport.java
new revision: 1.34; previous revision: 1.33
done
Checking in libsrc/org/netbeans/editor/Settings.java;
/cvs/editor/libsrc/org/netbeans/editor/Settings.java,v  <--  Settings.java
new revision: 1.65; previous revision: 1.64
done
Checking in
test/unit/src/org/netbeans/modules/editor/options/BaseOptionsDeadlock92449Test.java;
/cvs/editor/test/unit/src/org/netbeans/modules/editor/options/BaseOptionsDeadlock92449Test.java,v
 <--  BaseOptionsDeadlock92449Test.java
new revision: 1.2; previous revision: 1.1
done
Comment 13 Vitezslav Stejskal 2007-02-14 07:54:44 UTC
*** Issue 95199 has been marked as a duplicate of this issue. ***
Comment 14 Dusan Balek 2007-02-14 10:31:44 UTC
*** Issue 94407 has been marked as a duplicate of this issue. ***
Comment 15 Vitezslav Stejskal 2007-02-19 21:25:44 UTC
*** Issue 95936 has been marked as a duplicate of this issue. ***
Comment 16 Vitezslav Stejskal 2007-02-19 21:26:25 UTC
There is more to come...
Comment 17 Vitezslav Stejskal 2007-02-19 23:47:51 UTC
Another bit fixed.

Checking in BaseKit.java;
/cvs/editor/libsrc/org/netbeans/editor/BaseKit.java,v  <--  BaseKit.java
new revision: 1.159; previous revision: 1.158
done