Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 357642

Summary: Bootstrap initialization not thread safe
Product: z_Archived Reporter: Tony Chen <chenzhh>
Component: EDTAssignee: Tim Wilson <tww>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: pharmon
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
boot stacktrace for the cocurrent error lasher: iplog+

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.