Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 233297 - TreeModelContentProvider appears to throw an AIOOB
Summary: TreeModelContentProvider appears to throw an AIOOB
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4.1   Edit
Assignee: Samantha Chan CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 232666 237792 238527 239691 239780 240364 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-21 14:15 EDT by Eric Moffatt CLA
Modified: 2008-09-27 01:08 EDT (History)
8 users (show)

See Also:


Attachments
patch (5.02 KB, patch)
2008-07-29 15:24 EDT, Darin Wright CLA
no flags Details | Diff
patch (2.45 KB, patch)
2008-07-30 10:35 EDT, Darin Wright CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Moffatt CLA 2008-05-21 14:15:41 EDT
Found in: I20080519-2000

I came across this while debugging for another scenario:

In a clean session, open the Error View
Fire up an inner (using Debug) and open the Help->Software Updates... dialog

I'm getting a very strange error occurred dialog on 'process model delta'...

Let me know if you need more help repro-ing...it doesn't seem to be a killer, just strange (and annoying since it kept kicking me back to the outer...;-).

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

Daemon System Thread [Finalizer thread] (Suspended (exception IOException))	

cause:

org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Index out of bounds)
	at org.eclipse.swt.SWT.error(SWT.java:3775)
	at org.eclipse.swt.SWT.error(SWT.java:3693)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3778)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3403)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2387)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2351)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2203)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:493)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:288)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:488)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:112)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:193)
	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:379)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:615)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:549)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:504)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1236)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1212)
Caused by: java.lang.IllegalArgumentException: Index out of bounds
	at org.eclipse.swt.SWT.error(SWT.java:3759)
	at org.eclipse.swt.SWT.error(SWT.java:3693)
	at org.eclipse.swt.SWT.error(SWT.java:3664)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:462)
	at org.eclipse.swt.widgets.TreeItem.getItem(TreeItem.java:732)
	at org.eclipse.jface.viewers.TreeViewer.replace(TreeViewer.java:500)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.reveal(TreeModelContentProvider.java:336)
	at org.eclipse.debug.internal.ui.viewers.model.TreeModelContentProvider.handleReveal(TreeModelContentProvider.java:319)
	at org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider.updateNodes(ModelContentProvider.java:882)
	at org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider.updateNodes(ModelContentProvider.java:884)
	at org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider.updateNodes(ModelContentProvider.java:884)
	at org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider.updateNodes(ModelContentProvider.java:884)
	at org.eclipse.debug.internal.ui.viewers.model.ModelContentProvider$9.runInUIThread(ModelContentProvider.java:833)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:94)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
	... 23 more
Comment 1 Darin Wright CLA 2008-05-21 17:04:10 EDT
*** Bug 232666 has been marked as a duplicate of this bug. ***
Comment 2 Samantha Chan CLA 2008-05-27 15:48:49 EDT
I am also seeing this problem while debugging PDE, as well as in our debugger that extends JDT.

When I saw this failure, it was during the launch sequence in our debugger.  When our debugger is launched,  the launch delegate removes the JDIDebugTarget from the view, shortly after the JDIDebugTarget has fired a suspend event.  I believe the suspend event causes the expand and select job to run.  When the viewer actually tries to select the stackframe, our launch has removed the target from the viewer, which causes this exception.

I haven't looked at this in detailed... just what I am suspecting.
Comment 3 Eric Moffatt CLA 2008-07-03 14:04:47 EDT
*** Bug 238527 has been marked as a duplicate of this bug. ***
Comment 4 Darin Wright CLA 2008-07-03 15:32:21 EDT
*** Bug 237792 has been marked as a duplicate of this bug. ***
Comment 5 Darin Wright CLA 2008-07-03 15:33:24 EDT
This is a good 3.4.1 candidate. The problem occurrs when revealing an element that has been filtered. In this case, a system thread is filtered, and a breakpoint has been hit in that thread.

The workaround is to turn off system thread filters.
Comment 6 Darin Wright CLA 2008-07-03 15:34:46 EDT
(and... if anyone can tell me how to hit a breakpoint in a system thread, please add the example to this bug... my quick tries to get it to work have failed... thanks)
Comment 7 Darin Wright CLA 2008-07-07 11:23:47 EDT
*** Bug 239691 has been marked as a duplicate of this bug. ***
Comment 8 Darin Wright CLA 2008-07-10 13:40:38 EDT
*** Bug 240364 has been marked as a duplicate of this bug. ***
Comment 9 Darin Wright CLA 2008-07-29 15:24:06 EDT
Created attachment 108688 [details]
patch

This patch re-inserts elements into the tree as they are expanded/revealed if the elements are filtered, but the filtered state has changed to "un-filtered".
Comment 10 Darin Wright CLA 2008-07-30 10:35:39 EDT
Created attachment 108750 [details]
patch

Corresponding patch to ShowSystemThreadsAction. The action no longer needs to "select" the system thread/frame on a suspend - but still needs to refresh the viewer on a resume to re-filter the system thread.
Comment 11 Darin Wright CLA 2008-07-30 10:37:15 EDT
Released fix to HEAD.
Comment 12 Darin Wright CLA 2008-07-30 12:24:43 EDT
Fix released to 3.4.1
Comment 13 Darin Wright CLA 2008-07-30 12:25:22 EDT
(Note, will be in next week's M-build, missied today's).

Please verify, Sam.
Comment 14 Pawel Piech CLA 2008-09-27 01:08:45 EDT
*** Bug 239780 has been marked as a duplicate of this bug. ***