Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357642 - Bootstrap initialization not thread safe
Summary: Bootstrap initialization not thread safe
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tim Wilson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-14 11:06 EDT by Tony Chen CLA
Modified: 2017-02-23 14:14 EST (History)
1 user (show)

See Also:


Attachments
boot stacktrace for the cocurrent error (1.19 KB, patch)
2011-09-14 11:08 EDT, Tony Chen CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tony Chen CLA 2011-09-14 11:06:17 EDT
When two threads try to initialize SystemIREnvironment, it is possible to run into Bootstrap.initializeClasses() together, and may lead to java.util.ConcurrentModificationException. After this error happen, mof will be in an error state and can not be used. (Bootstrap.loaded = true, but some fields is not actually loaded )


Caused by: java.util.ConcurrentModificationException
	at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:64)
	at org.eclipse.edt.mof.impl.InternalEObject.init(InternalEObject.java:132)
	at org.eclipse.edt.mof.impl.EClassImpl.initialize(EClassImpl.java:276)
	at org.eclipse.edt.mof.impl.Bootstrap.newEClass(Bootstrap.java:643)
	at org.eclipse.edt.mof.impl.Bootstrap.getParameterClass(Bootstrap.java:262)
	at org.eclipse.edt.mof.impl.Bootstrap.createFunctionClass(Bootstrap.java:499)
	at org.eclipse.edt.mof.impl.Bootstrap.getFunctionClass(Bootstrap.java:256)
	at org.eclipse.edt.mof.impl.Bootstrap.initializeClasses(Bootstrap.java:87)
	at org.eclipse.edt.mof.impl.Bootstrap.doIt(Bootstrap.java:76)
	at org.eclipse.edt.mof.impl.Bootstrap.initialize(Bootstrap.java:29)
	at org.eclipse.edt.compiler.SystemIREnvironment.<init>(SystemIREnvironment.java:18)


The scenario lead to this error is when user starts EDT in an existing workspace and some open EGL files. The Builder job and ProblemReconciler job will both start in background. Sometimes, they hit the Mof initialization problem.
Comment 1 Tony Chen CLA 2011-09-14 11:08:04 EDT
Created attachment 203344 [details]
boot stacktrace for the cocurrent error
Comment 2 Paul Harmon CLA 2011-11-09 11:22:11 EST
I have made the initializeClasses() method synchronized, so that only 1 process can get into it at a time.
Comment 3 Tony Chen CLA 2011-11-15 20:58:23 EST
Close it.