This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 434840 - [Trim] Widget disposed exception after closing Heap Status; window trims broken on resize
Summary: [Trim] Widget disposed exception after closing Heap Status; window trims brok...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.4 RC1   Edit
Assignee: Eric Moffatt CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-14 07:38 EDT by Markus Keller CLA
Modified: 2014-05-16 08:55 EDT (History)
2 users (show)

See Also:
pwebster: review+


Attachments
Screenshot (37.21 KB, image/png)
2014-05-14 07:38 EDT, Markus Keller CLA
no flags Details
alternative fix (1.56 KB, patch)
2014-05-14 12:04 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2014-05-14 07:38:36 EDT
Created attachment 243078 [details]
Screenshot

4.4M7 and I20140513-2000, was OK in 4.4M6 and up to I20140325-0830

- new workspace, close Welcome
- Preferences > General: enable "Show heap status"
- right-click the heap status trim item, and choose "Close"
=> First SWTException in log.

- resize the workbench window
=> Window trims, title bar, and menu bar are gone.
=> Menus show up below the toolbar if you move the mouse there. 
=> Many redraw issues

The Eclipse versions that exhibit this bug show a drag handle (vertical dots) on the left of the heap status item.

!ENTRY org.eclipse.ui 4 0 2014-05-14 13:12:20.029
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
        at org.eclipse.swt.SWT.error(SWT.java:4441)
        at org.eclipse.swt.SWT.error(SWT.java:4356)
        at org.eclipse.swt.SWT.error(SWT.java:4327)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:476)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348)
        at org.eclipse.swt.widgets.Control.getSize(Control.java:1573)
        at org.eclipse.e4.ui.widgets.ImageBasedFrame.drawFrame(ImageBasedFrame.java:154)
        at org.eclipse.e4.ui.widgets.ImageBasedFrame$1.paintControl(ImageBasedFrame.java:66)
        at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:230)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1085)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1070)
        at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1592)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4667)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5024)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1152)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1033)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
        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:379)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1438)

!ENTRY org.eclipse.ui 4 0 2014-05-14 13:12:47.001
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.swt.SWTException: Widget is disposed
        at org.eclipse.swt.SWT.error(SWT.java:4441)
        at org.eclipse.swt.SWT.error(SWT.java:4356)
        at org.eclipse.swt.SWT.error(SWT.java:4327)
        at org.eclipse.swt.widgets.Widget.error(Widget.java:476)
        at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:348)
        at org.eclipse.swt.widgets.Control.getSize(Control.java:1573)
        at org.eclipse.e4.ui.widgets.ImageBasedFrame.computeSize(ImageBasedFrame.java:142)
        at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.computeSize(TrimBarLayout.java:158)
        at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.access$0(TrimBarLayout.java:157)
        at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout$TrimLine.addControl(TrimBarLayout.java:42)
        at org.eclipse.e4.ui.workbench.renderers.swt.TrimBarLayout.computeSize(TrimBarLayout.java:118)
        at org.eclipse.swt.widgets.Composite.computeSize(Composite.java:234)
        at org.eclipse.e4.ui.workbench.renderers.swt.TrimmedPartLayout.layout(TrimmedPartLayout.java:140)
        at org.eclipse.swt.widgets.Composite.updateLayout(Composite.java:1290)
        at org.eclipse.swt.widgets.Composite.WM_SIZE(Composite.java:1701)
        at org.eclipse.swt.widgets.Canvas.WM_SIZE(Canvas.java:462)
        at org.eclipse.swt.widgets.Decorations.WM_SIZE(Decorations.java:1810)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4685)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5024)
        at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
        at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
        at org.eclipse.swt.widgets.Control.WM_WINDOWPOSCHANGED(Control.java:5492)
        at org.eclipse.swt.widgets.Canvas.WM_WINDOWPOSCHANGED(Canvas.java:468)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4698)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5024)
        at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
        at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5024)
        at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2544)
        at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
        at org.eclipse.swt.widgets.Control.windowProc(Control.java:4705)
        at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:339)
        at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1626)
        at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2075)
        at org.eclipse.swt.widgets.Display.windowProc(Display.java:5024)
        at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
        at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3759)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1152)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1033)
        at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
        at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:135)
        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:379)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:233)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
        at org.eclipse.equinox.launcher.Main.main(Main.java:1438)
Comment 1 Eric Moffatt CLA 2014-05-14 09:10:10 EDT
This was because the close action was arbitrarily just disposing its control (rather than its 'frame'). Here's a Gerrit that just calls the WBW#showHeapStatus.

  https://git.eclipse.org/r/26519
Comment 2 Paul Webster CLA 2014-05-14 09:16:42 EDT
Lars, can you please review?

PW
Comment 3 Lars Vogel CLA 2014-05-14 09:22:26 EDT
(In reply to Paul Webster from comment #2)
> Lars, can you please review?
> 
> PW

Will do.
Comment 4 Lars Vogel CLA 2014-05-14 09:46:33 EDT
(In reply to Eric Moffatt from comment #1)
> This was because the close action was arbitrarily just disposing its control
> (rather than its 'frame'). Here's a Gerrit that just calls the
> WBW#showHeapStatus.
> 
>   https://git.eclipse.org/r/26519

I think we also need to reset the preference value for showing the the heap status. Test case: Hide the HeapStatus and check the preference value afterwards.
Comment 5 Markus Keller CLA 2014-05-14 12:03:20 EDT
(In reply to Lars Vogel from comment #4)
> I think we also need to reset the preference value for showing the the heap
> status. Test case: Hide the HeapStatus and check the preference value
> afterwards.

That's an old thing -- already like this in 3.8. Maybe the intention was that "Close" is just temporary or for that specific window, and that the preference should control what's shown on startup? But I agree it's strange.

What's more scary is that we suddenly get an exception and a broken window for something that worked fine before. Couldn't the same thing happen with a trim item contribution from a third party?
Comment 6 Markus Keller CLA 2014-05-14 12:04:11 EDT
Created attachment 243095 [details]
alternative fix
Comment 7 Eric Moffatt CLA 2014-05-14 12:51:26 EDT
The original fix is the correct way to get us back to having behavior that's better than the current 3.x scenario for the same command.

Markus, your fix does cover the widget isDisposed cases but would still leave the model in an invalid state (a MToolControl with TBR==true and visible==true but with a disposed widget). The 'showHeapStatus' method correctly cleans up the model state...please go with the original patch...
Comment 8 Eric Moffatt CLA 2014-05-14 14:20:23 EDT
On Paul's advice I've revised the original patch to include some checks that should prevent the IBF from spewing exceptions should a similar situation occur. I tested this by working against the original failures until I got no exceptions then added that code to the original patch...
Comment 10 Lars Vogel CLA 2014-05-14 15:47:28 EDT
I think the issue that the preference value is incorrect from my Gerrit review  has not been solved. (it still says the head monitor is visible even though it is closed)

Is this another bug report?
Comment 11 Paul Webster CLA 2014-05-14 16:12:07 EDT
(In reply to Lars Vogel from comment #10)
> I think the issue that the preference value is incorrect from my Gerrit
> review  has not been solved. (it still says the head monitor is visible even
> though it is closed)
> 
> Is this another bug report?

Yes, you can open another bug report like that.  It's always been that way, and we'll need to do some digging to find out if it's deliberate.  That's for post-Luna

PW
Comment 12 Dani Megert CLA 2014-05-16 08:55:10 EDT
Verified in I20140515-1230.