Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341501 - [EditorMgmt] Workbench state reset on startup due to AIOOBE
Summary: [EditorMgmt] Workbench state reset on startup due to AIOOBE
Status: CLOSED DUPLICATE of bug 300970
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Paul Webster CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-31 11:13 EDT by Ayushman Jain CLA
Modified: 2011-06-06 03:01 EDT (History)
4 users (show)

See Also:


Attachments
attached log (8.86 KB, text/plain)
2011-04-05 06:16 EDT, Ayushman Jain CLA
no flags Details
.log file (598.26 KB, text/plain)
2011-04-05 09:54 EDT, Ayushman Jain CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ayushman Jain CLA 2011-03-31 11:13:45 EDT
Build id: I20110322-0800.

This nasty NPE sometimes shows up when I start up Eclipse, and the last use state of is lost completely, including open views, perspectives, open editors, etc. I'm only seeing this since I upgraded to I20110322-0800. I also get an AIOOBE in NavigationHistory.restoreState(..) and some Widget disposed too early exceptions in WorkbenchPartReference$1.widgetDisposed(..)

Stacktrace of NPE:

Error
Thu Mar 31 16:35:52 IST 2011
An unexpected exception was thrown.

java.lang.NullPointerException
at org.eclipse.ui.internal.WorkbenchPartReference.partPropertyChanged(WorkbenchPartReference.java:307)
at org.eclipse.ui.internal.WorkbenchPartReference$2.propertyChanged(WorkbenchPartReference.java:181)
at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:129)
at org.eclipse.team.internal.ui.synchronize.SynchronizeView.access$1(SynchronizeView.java:1)
at org.eclipse.team.internal.ui.synchronize.SynchronizeView$5.run(SynchronizeView.java:330)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4125)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3742)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)

--------------------------------------------------------------------

Stacktrace of AIOOBE

Error
Thu Mar 31 16:35:46 IST 2011
Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".

java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.ui.internal.NavigationHistory.restoreState(NavigationHistory.java:614)
at org.eclipse.ui.internal.WorkbenchPage.restoreState(WorkbenchPage.java:3369)
at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:2225)
at org.eclipse.ui.internal.Workbench.doRestoreState(Workbench.java:3682)
at org.eclipse.ui.internal.Workbench.access$32(Workbench.java:3624)
at org.eclipse.ui.internal.Workbench$60.run(Workbench.java:2324)
at org.eclipse.ui.internal.Workbench.runStartupWithProgress(Workbench.java:2021)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:2322)
at org.eclipse.ui.internal.Workbench.access$30(Workbench.java:2293)
at org.eclipse.ui.internal.Workbench$54.run(Workbench.java:2139)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:2083)
at org.eclipse.ui.internal.WorkbenchConfigurer.restoreState(WorkbenchConfigurer.java:183)
at org.eclipse.ui.application.WorkbenchAdvisor$1.run(WorkbenchAdvisor.java:781)


I don't know how to reproduce it. It just shows up sometimes even if I exited Eclipse properly the last time.
Comment 1 Paul Webster CLA 2011-04-04 07:27:28 EDT
Hi Ayushman, Could you please provide a complete log (attach) for one of the failure cases?  Especially interesting to us is everything from the !SESSION to the NPE.

PW
Comment 2 Ayushman Jain CLA 2011-04-05 06:16:01 EDT
Created attachment 192537 [details]
attached log

Attaching the complete log with the session info included.

This has the NPE, AIOOBE and Widget disposed too early exceptions.
Comment 3 Paul Webster CLA 2011-04-05 09:01:09 EDT
Sorry, I would like you to attach one complete log session from your <workspace>/.metadata/.log file.

Each new session starts with: !SESSION

PW
Comment 4 Ayushman Jain CLA 2011-04-05 09:54:59 EDT
Created attachment 192557 [details]
.log file

Sorry about that. I didn't attach the .log coz I thought it has too much noise. Attaching it now. You can look at the session info for 2011-03-31, when the problem occured.
Comment 5 Paul Webster CLA 2011-04-05 10:38:28 EDT
It's the AIOOBE that causes the call to Window.close() that generates the other exceptions.

PW
Comment 6 Paul Webster CLA 2011-04-05 10:50:28 EDT
org.eclipse.ui.internal.NavigationHistory.saveState(IMemento) writes out the information on close.  

It could get in this state if there's a NavigationHistoryEntry for an editor that's not in the list of editors (NavigationHistoryEditorInfo) when it saves state.

PW
Comment 7 Remy Suen CLA 2011-04-06 09:21:12 EDT
(In reply to comment #6)
> org.eclipse.ui.internal.NavigationHistory.saveState(IMemento) writes out the
> information on close.  
> 
> It could get in this state if there's a NavigationHistoryEntry for an editor
> that's not in the list of editors (NavigationHistoryEditorInfo) when it saves
> state.

Guess I'll have to take a look then.
Comment 8 Remy Suen CLA 2011-04-06 09:41:34 EDT
Ayushman, do you remember what kind of editors you had opened when you had shutdown? Only files in the workspace? Anything outside? Only Java and text editors?
Comment 9 Ayushman Jain CLA 2011-04-06 09:58:44 EDT
(In reply to comment #8)
> Ayushman, do you remember what kind of editors you had opened when you had
> shutdown? Only files in the workspace? Anything outside? Only Java and text
> editors?

Yeah, I only had Java and text editors open.

> It could get in this state if there's a NavigationHistoryEntry for an editor
> that's not in the list of editors (NavigationHistoryEditorInfo) when it saves
> state.

Reading this, is it possible that a compare editor was left open when I closed the workbench and this had a NavigationHistoryEntry but no corresponding NavigationHistoryEditorInfo?
Comment 10 Ayushman Jain CLA 2011-04-06 10:06:14 EDT
(In reply to comment #9)
> [..]
> Reading this, is it possible that a compare editor was left open when I closed
> the workbench and this had a NavigationHistoryEntry but no corresponding
> NavigationHistoryEditorInfo?

Saying that because compare editors are not persistent across sessions.
Comment 11 Srikanth Sankaran CLA 2011-06-06 02:49:47 EDT
I got the same problem with identical stack trace upon
upgrading to 3.7 RC4.
Comment 12 Dani Megert CLA 2011-06-06 03:01:12 EDT

*** This bug has been marked as a duplicate of bug 300970 ***