Bug 211762 - ConcurrentModificationException initializing Java Tools
Summary: ConcurrentModificationException initializing Java Tools
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Jerome Lanneluc CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-03 10:21 EST by James Synge CLA
Modified: 2007-12-12 10:22 EST (History)
2 users (show)

See Also:
philippe_mulet: pmc_approved+


Attachments
Eclipse .log file, from start of session through failures (32.43 KB, text/plain)
2007-12-03 10:21 EST, James Synge CLA
no flags Details
Proposed fix (2.10 KB, patch)
2007-12-03 12:58 EST, Jerome Lanneluc CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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