Bug 123100 - [debug] Variables view causes "widget is disposed" error
Summary: [debug] Variables view causes "widget is disposed" error
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: cdt-debug-inbox@eclipse.org CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-09 09:36 EST by Chad Barnes CLA
Modified: 2020-09-04 15:23 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chad Barnes CLA 2006-01-09 09:36:01 EST
-We are using MinGW gdb.
-We are connecting the debugger to a running process

At a breakpoint, when browsing the variables, an error dialog appears:

  Title: Replace children
Message: error

The following .log entry is generated:

!ENTRY org.eclipse.ui 4 0 2006-01-09 07:53:01.36
!MESSAGE Widget is disposed
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
	at org.eclipse.swt.SWT.error(SWT.java:2942)
	at org.eclipse.swt.SWT.error(SWT.java:2865)
	at org.eclipse.swt.SWT.error(SWT.java:2836)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:395)
	at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:297)
	at org.eclipse.swt.widgets.TreeItem.getItems(TreeItem.java:590)
	at org.eclipse.jface.viewers.TreeViewer.getChildren(TreeViewer.java:329)
	at org.eclipse.debug.internal.ui.views.RemoteTreeViewer.access$3(RemoteTreeViewer.java:1)
	at org.eclipse.debug.internal.ui.views.RemoteTreeViewer$3.run(RemoteTreeViewer.java:400)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1201)
	at org.eclipse.debug.internal.ui.views.RemoteTreeViewer.replace(RemoteTreeViewer.java:392)
	at org.eclipse.debug.internal.ui.views.variables.VariablesViewer.replace(VariablesViewer.java:144)
	at org.eclipse.debug.internal.ui.views.RemoteTreeContentManager$1.runInUIThread(RemoteTreeContentManager.java:214)
	at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:93)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3057)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2716)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
	at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
	at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
	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.core.launcher.Main.invokeFramework(Main.java:334)
	at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
	at org.eclipse.core.launcher.Main.run(Main.java:973)
	at org.eclipse.core.launcher.Main.main(Main.java:948)

The variables view is affected by the "children" of the expanded node being drawn at the same level as the expanded node (not beneath the node, as they should).

This was not a problem with Eclipse 3.1.0 and CDT 3.0.  But, it is now a problem with Eclipse 3.1.1 and CDT 3.0.

Thanks,

Chad Barnes
Rockwell Collins, Inc.
Comment 1 Chad Barnes CLA 2006-01-09 10:37:46 EST
Upgrading to CDT 3.0.1 seemed to resolve the issue.
Comment 2 Nobody - feel free to take it CLA 2007-11-19 18:47:26 EST
We are seeing a similar issue with CDT 4.0, in our case resulting in an error dialog 'Asynchronous viewer update'.  The key to reproducing this for us is a situation where a local variable comes in and out of scope while stepping through a while loop.  In this case, intermittently, the StructuredViewer.elementMap member ends up with an entry containing a disposed widget.  As far as I can tell, this isn't a valid state, but the code is complex and I am unable to determine how this state is possible.  We are working around the problem by adding a guard to AbstractTreeViewer.internalFindItem(TreePath):

    if (!widget.isDisposed() && widget instanceof Item)