Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 158361 - [prefs] Thread safety problem in InstancePreferences
Summary: [prefs] Thread safety problem in InstancePreferences
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: DJ Houghton CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 180539 207168 275924 290189 293678 293680 321734 (view as bug list)
Depends on:
Blocks: 237793 293820 305998
  Show dependency tree
 
Reported: 2006-09-22 14:17 EDT by kate_bugzilla CLA
Modified: 2010-08-05 14:23 EDT (History)
9 users (show)

See Also:


Attachments
patch (4.72 KB, patch)
2008-06-12 11:40 EDT, DJ Houghton CLA
no flags Details | Diff
Fix for ProjectPreferences only (3.17 KB, patch)
2009-10-29 11:54 EDT, John Arthorne CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kate_bugzilla CLA 2006-09-22 14:17:08 EDT
Caused by: java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[Worker-2,5,main]
	at java.util.HashMap.onExit(HashMap.java:217)
	at java.util.HashMap.transfer(HashMap.java:514)
	at java.util.HashMap.resize(HashMap.java:500)
	at java.util.HashMap.addEntry(HashMap.java:800)
	at java.util.HashMap.put(HashMap.java:441)
	at java.util.HashSet.add(HashSet.java:209)
	at org.eclipse.core.internal.preferences.InstancePreferences.loaded(InstancePreferences.java:79)
	at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:308)
	at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:543)
	at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:662)

Looking at the code, it appears that access to the loadedNodes HashSet is not synchronized.
Comment 1 DJ Houghton CLA 2007-07-11 13:03:20 EDT
*** Bug 180539 has been marked as a duplicate of this bug. ***
Comment 2 DJ Houghton CLA 2007-10-23 10:44:43 EDT
*** Bug 207168 has been marked as a duplicate of this bug. ***
Comment 3 DJ Houghton CLA 2008-06-12 11:40:18 EDT
Created attachment 104708 [details]
patch

Patch to ensure all called to the static field are synchronized.
Comment 4 DJ Houghton CLA 2008-07-09 16:58:40 EDT
Released patch into 3.4 maintenance branch.
Branched org.eclipse.equinox.preferences and org.eclipse.core.resources projects.
Tagged projects with version R34x_v20080709 and updated map files.

Comment 5 DJ Houghton CLA 2008-07-09 16:59:44 EDT
oh, and I also updated the bundle versions for the prefs and core.resources bundles by +1.
Comment 6 John Arthorne CLA 2009-10-29 11:53:18 EDT
This fix wasn't sufficient.
Comment 7 John Arthorne CLA 2009-10-29 11:53:30 EDT
*** Bug 293680 has been marked as a duplicate of this bug. ***
Comment 8 John Arthorne CLA 2009-10-29 11:53:42 EDT
*** Bug 293678 has been marked as a duplicate of this bug. ***
Comment 9 John Arthorne CLA 2009-10-29 11:54:45 EDT
Created attachment 150837 [details]
Fix for ProjectPreferences only

Need to fix other copies as well.
Comment 10 DJ Houghton CLA 2009-10-30 14:18:45 EDT
Fixed in HEAD. Will be available in 3.6 M4.
Opened bug 293820 to track back-porting to previous releases.
Closing.
Comment 11 John Arthorne CLA 2009-12-04 09:20:45 EST
*** Bug 275924 has been marked as a duplicate of this bug. ***
Comment 12 John Arthorne CLA 2010-03-16 17:02:16 EDT
*** Bug 290189 has been marked as a duplicate of this bug. ***
Comment 13 John Arthorne CLA 2010-08-05 14:23:39 EDT
*** Bug 321734 has been marked as a duplicate of this bug. ***