Bug 211762

Summary: ConcurrentModificationException initializing Java Tools
Product: [Eclipse Project] JDT Reporter: James Synge <james.synge>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eric_jodet, philippe_mulet
Version: 3.3.1Flags: philippe_mulet: pmc_approved+
Target Milestone: 3.3.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Eclipse .log file, from start of session through failures
none
Proposed fix none

Description James Synge CLA 2007-12-03 10:21:53 EST
Created attachment 84323 [details]
Eclipse .log file, from start of session through failures

Build ID: M20070921-1145

I have a large workspace (521 projects, mostly plug-in projects, some features, some misc other projects).  Auto-build is disabled (have never built in this workspace, just use it for reading code).

Started eclipse today, and minimized.  After a while noticed an error dialog, and found the attached errors, which show concurrent hash map access by the main thread and the reconciler thread.

Both stack traces look similar to this (near the point of failure):

!ENTRY org.eclipse.ui.workbench 4 2 2007-12-03 09:52:40.488
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
java.util.ConcurrentModificationException: concurrent access to HashMap attempted by Thread[main,6,main]
	at java.util.HashMap.onEntry(HashMap.java:213)
	at java.util.HashMap.transfer(HashMap.java:632)
	at java.util.HashMap.resize(HashMap.java:622)
	at java.util.HashMap.addEntry(HashMap.java:994)
	at java.util.HashMap.put(HashMap.java:510)
	at org.eclipse.jdt.internal.core.util.Util.getSourceAttachmentProperty(Util.java:1093)
	at org.eclipse.jdt.internal.core.DeltaProcessingState.initializeRoots(DeltaProcessingState.java:240)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:717)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1797)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:785)
	at org.eclipse.jdt.core.JavaCore.setClasspathContainer(JavaCore.java:4519)
	at org.eclipse.jdt.internal.launching.JREContainerInitializer.initialize(JREContainerInitializer.java:69)
	at org.eclipse.jdt.internal.core.JavaModelManager.initializeContainer(JavaModelManager.java:2218)
	at org.eclipse.jdt.internal.core.JavaModelManager.getClasspathContainer(JavaModelManager.java:1546)
	at org.eclipse.jdt.core.JavaCore.getClasspathContainer(JavaCore.java:1571)

I'll attach a file with the relevant portion of the log (today's session).
Comment 1 Jerome Lanneluc CLA 2007-12-03 12:58:54 EST
Created attachment 84342 [details]
Proposed fix
Comment 2 Jerome Lanneluc CLA 2007-12-04 06:10:28 EST
Fix released for 3.4M4
Comment 3 Jerome Lanneluc CLA 2007-12-04 06:12:59 EST
The fix is trivial. Without it, there is a risk of
ConcurrentModificationException at startup which can prevent the reconciler from running.
Please approve for 3.3.2.
Comment 4 James Synge CLA 2007-12-04 10:38:44 EST
(In reply to comment #2)
> Fix released for 3.4M4

Thanks!
Comment 5 Philipe Mulet CLA 2007-12-05 07:08:36 EST
+1 for 3.3.2
Comment 6 Jerome Lanneluc CLA 2007-12-05 09:35:19 EST
Fix released for 3.3.2
Comment 7 Eric Jodet CLA 2007-12-12 10:22:17 EST
Verified for 3.4 M4 using build I20071211-0010