Bug 576703 - e4 TrimBarRenderer causes EMF ConcurrentModificationException on platform startup
Summary: e4 TrimBarRenderer causes EMF ConcurrentModificationException on platform sta...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.15   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.22 M2   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-10-18 11:40 EDT by Eddie Galvez CLA
Modified: 2021-10-19 01:19 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eddie Galvez CLA 2021-10-18 11:40:28 EDT
This stack trace comes up in our Eclipse 4.20-based product on (clean) startup.

java.util.ConcurrentModificationException
	at org.eclipse.emf.common.util.AbstractEList$EIterator.checkModCount(AbstractEList.java:751)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.doNext(AbstractEList.java:699)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.next(AbstractEList.java:685)
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.processContents(SWTPartRenderer.java:70)
	at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarRenderer.processContents(TrimBarRenderer.java:109)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:673)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$1.run(PartRenderingEngine.java:544)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:528)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.processContents(WBWRenderer.java:688)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:673)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:765)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:730)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:714)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1083)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:654)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1462)
Comment 1 Andrey Loskutov CLA 2021-10-18 11:47:51 EDT
Regression from https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/152805, in particular this change:

https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/152805/7/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/SWTPartRenderer.java

Looks like the code inside the for loop can modify the container children over which we are iterating. I assume it worked before, because new elements were added to the end of the list.
Comment 2 Carsten Hammer CLA 2021-10-18 11:56:48 EDT
(In reply to Andrey Loskutov from comment #1)
> Regression from
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/152805, in
> particular this change:
> 
> https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/152805/7/bundles/
> org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/
> renderers/swt/SWTPartRenderer.java
> 
> Looks like the code inside the for loop can modify the container children
> over which we are iterating. I assume it worked before, because new elements
> were added to the end of the list.

Obviously the code was broken already before.
Just look at the comment in the code: this is *not* the correct place for this
Comment 3 Eclipse Genie CLA 2021-10-18 12:00:01 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/186610
Comment 4 Andrey Loskutov CLA 2021-10-18 12:01:57 EDT
(In reply to Carsten Hammer from comment #2)
> Obviously the code was broken already before.
> Just look at the comment in the code: this is *not* the correct place for
> this

Obviously that worked despite the comment, otherwise it wouldn't be reported *now*.
Comment 6 Eddie Galvez CLA 2021-10-18 13:29:06 EDT
Thank you! We should be picking up 4.22 shortly after it releases, it'll be good to have a clean error log on startup!
Comment 7 Andrey Loskutov CLA 2021-10-19 01:19:04 EDT
(In reply to Eddie Galvez from comment #6)
> Thank you! We should be picking up 4.22 shortly after it releases, it'll be
> good to have a clean error log on startup!

Would be great if you could verify the fix with this SDK build: https://download.eclipse.org/eclipse/downloads/drops4/I20211018-1800/

There could be other issues, we had lot of "foreach cleanups" in SDK, unfortunately.