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

Bug 499104

Summary: Workspace Becomes Corrupted
Product: [Eclipse Project] Platform Reporter: Ken Taylor <archon358>
Component: IDEAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: bsd, daniel_megert, loskutov
Version: 4.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows 8   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=459833
Whiteboard: stalebug

Description Ken Taylor CLA 2016-08-03 09:34:19 EDT
After using a workspace for some time (weeks, months), the workspace suddenly becomes corrupted and Eclipse cannot open it. This has occurred about half a dozen times over the last 2 yearts and 2 Eclipse releases (4.5, 4.4).  This causes a complete loss of the workspace, which leads to significant loss of productivity.  Workspace must be re-created from scratch.

After investigating, I found the following Exception (in <workspace>/.metadata/.log) that occurred when I last shutdown Eclipse.

!ENTRY org.eclipse.ui.workbench 4 0 2016-08-01 16:21:19.578
!MESSAGE An unexpected exception was thrown.
!STACK 0
java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
	at java.util.HashMap$ValueIterator.next(HashMap.java:1466)
	at org.eclipse.ui.internal.services.ServiceLocator.dispose(ServiceLocator.java:136)
	at org.eclipse.ui.internal.WorkbenchWindow.hardClose(WorkbenchWindow.java:1993)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:1600)
	at org.eclipse.ui.internal.WorkbenchWindow.access$16(WorkbenchWindow.java:1542)
	at org.eclipse.ui.internal.WorkbenchWindow$11.run(WorkbenchWindow.java:1628)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:1625)
	at org.eclipse.ui.internal.Workbench$14.run(Workbench.java:1189)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1171)
	at org.eclipse.ui.internal.Workbench.access$22(Workbench.java:1113)
	at org.eclipse.ui.internal.Workbench$19.run(Workbench.java:1454)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1451)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1424)
	at org.eclipse.ui.internal.handlers.QuitHandler.execute(QuitHandler.java:43)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	at sun.reflect.GeneratedMethodAccessor101.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:252)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:234)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:493)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:486)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:343)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:160)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4362)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1113)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4180)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3769)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:694)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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:380)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1488)


-- Configuration Details --
Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.jee.product)
Installed Features:
 org.eclipse.platform 4.6.0.v20160606-1342
Comment 1 Andrey Loskutov CLA 2016-08-03 10:09:38 EDT
Can you really correlate the broken workspace with the ConcurrentModificationException exception in ServiceLocator?
If yes, we can close this bug as a dup of bug 459833.

If not, please try to use 4.6 and see if this will fix your problem.
Comment 2 Brian de Alwis CLA 2016-08-03 10:45:48 EDT
He seems to be using 4.6, Andrey:

> -- Configuration Details --
> Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.jee.product)
> Installed Features:
>  org.eclipse.platform 4.6.0.v20160606-1342
Comment 3 Andrey Loskutov CLA 2016-08-03 10:50:41 EDT
(In reply to Brian de Alwis from comment #2)
> He seems to be using 4.6, Andrey:
> 
> > -- Configuration Details --
> > Product: Eclipse 4.6.0.20160613-1800 (org.eclipse.epp.package.jee.product)
> > Installed Features:
> >  org.eclipse.platform 4.6.0.v20160606-1342

I can't understand how then the stack of 4.6 contains this line:
ServiceLocator.dispose(ServiceLocator.java:136)
For 4.5 it would be OK.
Comment 4 Brian de Alwis CLA 2016-08-03 11:08:13 EDT
I don't get it either.  Ken: in 4.6, line 136 of ServiceLocator doesn't call next().   Indeed, the code was changed for 4.6 to avoid a ConcurrentModificationException like your report, such that there are no calls to next() in 4.6's ServiceLocator.   Your stack trace does align with 4.5.2.
Comment 5 Ken Taylor CLA 2016-08-03 11:09:30 EDT
The error was in 4.5 and 4.4.  I simply created the issue in 4.6, so you can ignore that aspect.
I'm pretty sure the exception is what caused the corrupted workspace but the only way to tell is to find out what exactly got corrupted and manually fix it and then try to open that workspace in Eclispe.
Comment 6 Ken Taylor CLA 2016-08-11 09:52:09 EDT
Update: I accidently launched the broken version, then realized my mistake and killed the Eclipse process.  Then Eclipse actually came up.  I tried this several times.  Seems like something wrong with the Eclipse launcher.  Is that some kind of service wrapper?  I updated that version and did a restart, problem remained.  I then did a complete shutdown and restart of Eclipse.  Now problem is gone.
Comment 7 Eclipse Genie CLA 2018-11-25 14:20:40 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.