Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 360198 - ConcurrentModificationException during framework snapshot
Summary: ConcurrentModificationException during framework snapshot
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Framework (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.7.2   Edit
Assignee: Thomas Watson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 03:34 EDT by Rich Ellis CLA
Modified: 2011-10-07 13:07 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Ellis CLA 2011-10-07 03:34:30 EDT
Build Identifier: 3.7.0.v20110613

I have seen this ConcurrentModificationException a few times, it appears that the framework is not protected against other threads setting system properties while taking a snapshot of them.

Caused by: java.util.ConcurrentModificationException
	at java.util.Hashtable$HashIterator.next(Hashtable.java:192)
	at java.util.Hashtable.putAll(Hashtable.java:785)
	at org.eclipse.osgi.framework.internal.core.FrameworkProperties.internalGetProperties(FrameworkProperties.java:82)
	at org.eclipse.osgi.framework.internal.core.FrameworkProperties.setProperties(FrameworkProperties.java:95)
	at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:63)
	at org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:37)
	at org.eclipse.osgi.launch.Equinox.init(Equinox.java:178)
	at org.eclipse.osgi.internal.composite.CompositeImpl.findCompanionFramework(CompositeImpl.java:64)
	at org.eclipse.osgi.internal.composite.CompositeBase.<init>(CompositeBase.java:37)
	at org.eclipse.osgi.internal.composite.CompositeImpl.<init>(CompositeImpl.java:37)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.createBundle(AbstractBundle.java:83)
	at org.eclipse.osgi.framework.internal.core.Framework.createAndVerifyBundle(Framework.java:717)
	at org.eclipse.osgi.framework.internal.core.Framework.installWorkerPrivileged(Framework.java:930)
	... 39 more

Reproducible: Sometimes

Steps to Reproduce:
I haven't been able to reproduce this on demand, but it should be possible by setting a system property while the FrameworkProperties.internalGetProperties is running.
Comment 1 Thomas Watson CLA 2011-10-07 13:03:11 EDT
We should synchronize on the System Properties object while we are calling putAll. Fixed in master for Juno release:

http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=1942955bea5b662738e7511a90704d16852ed272

Leaving open for 3.7.2 fix.