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

Bug 247813

Summary: [Trim] LegacyAnimationFeedback dispose error : must ensure shell is not disposed
Product: [Eclipse Project] Platform Reporter: Laurent Marchal <lmarchal>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: lmarchal
Version: 3.4   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Laurent Marchal CLA 2008-09-18 07:52:04 EDT
Build ID: Version: 3.4.0 Build id: I20080617-2000

Steps To Reproduce:
Hard to reproduce happens sometimes when closing the workbench but easy to see that dispose() don't check if the shell is disposed before using it


More information:
eclipse.buildId=unknown
java.version=1.5.0_15
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=fr_FR
Framework arguments:  -product com.sma.ui.em.product
Command-line arguments:  -product com.sma.ui.em.product -data /home/bigup/.enterpriseManager -dev file:/home/bigup/Workspace/.metadata/.plugins/org.eclipse.pde.core/EnterpriseManager.product/dev.properties -os linux -ws gtk -arch x86


Error
Thu Sep 18 13:27:42 CEST 2008
Application error

org.eclipse.swt.SWTException: Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
at org.eclipse.swt.widgets.Display.release(Display.java:3087)
at org.eclipse.swt.graphics.Device.dispose(Device.java:237)
at com.sma.ui.application.Application.start(Application.java:54)
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:382)
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:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
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: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.SWT.error(SWT.java:3666)
at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:384)
at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1627)
at org.eclipse.ui.internal.LegacyAnimationFeedback.dispose(LegacyAnimationFeedback.java:87)
at org.eclipse.ui.internal.AnimationEngine$3.run(AnimationEngine.java:190)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)
at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
... 18 more
Comment 1 Eric Moffatt CLA 2008-09-22 14:59:17 EDT
Laurent, do you get this when closing while an animation is running (i.e. just after a 'maximize') or does it happen at other times as well ?
Comment 2 Laurent Marchal CLA 2008-09-22 15:32:38 EDT
Hi Eric !

It's clear i can reproduce this error when i exit the application while changing the maximized state of my editor or view (double click on the title).

but each time i try i get another one like :

Caused by: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.SWT.error(SWT.java:3666)
at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:384)
at org.eclipse.swt.widgets.Control.setBounds(Control.java:652)
at org.eclipse.ui.internal.LegacyAnimationFeedback.jobInit(LegacyAnimationFeedback.java:109)
at org.eclipse.ui.internal.AnimationEngine$2.run(AnimationEngine.java:169)
at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)

or

Caused by: org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:3777)
at org.eclipse.swt.SWT.error(SWT.java:3695)
at org.eclipse.swt.SWT.error(SWT.java:3666)
at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
at org.eclipse.swt.widgets.Widget.getDisplay(Widget.java:528)
at org.eclipse.jface.util.Geometry.toControl(Geometry.java:606)
at org.eclipse.ui.internal.LegacyAnimationFeedback.renderStep(LegacyAnimationFeedback.java:53)
at org.eclipse.ui.internal.AnimationEngine.updateDisplay(AnimationEngine.java:113)

But the first one i reported, i don't know from where it comes...

Laurent.


(In reply to comment #0)
> Build ID: Version: 3.4.0 Build id: I20080617-2000
> 
> Steps To Reproduce:
> Hard to reproduce happens sometimes when closing the workbench but easy to see
> that dispose() don't check if the shell is disposed before using it
> 
> 
> More information:
> eclipse.buildId=unknown
> java.version=1.5.0_15
> java.vendor=Sun Microsystems Inc.
> BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=fr_FR
> Framework arguments:  -product com.sma.ui.em.product
> Command-line arguments:  -product com.sma.ui.em.product -data
> /home/bigup/.enterpriseManager -dev
> file:/home/bigup/Workspace/.metadata/.plugins/org.eclipse.pde.core/EnterpriseManager.product/dev.properties
> -os linux -ws gtk -arch x86
> 
> 
> Error
> Thu Sep 18 13:27:42 CEST 2008
> Application error
> 
> org.eclipse.swt.SWTException: Failed to execute runnable
> (org.eclipse.swt.SWTException: Widget is disposed)
> at org.eclipse.swt.SWT.error(SWT.java:3777)
> at org.eclipse.swt.SWT.error(SWT.java:3695)
> at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3378)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3036)
> at org.eclipse.swt.widgets.Display.release(Display.java:3087)
> at org.eclipse.swt.graphics.Device.dispose(Device.java:237)
> at com.sma.ui.application.Application.start(Application.java:54)
> 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:382)
> 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:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:585)
> 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: org.eclipse.swt.SWTException: Widget is disposed
> at org.eclipse.swt.SWT.error(SWT.java:3777)
> at org.eclipse.swt.SWT.error(SWT.java:3695)
> at org.eclipse.swt.SWT.error(SWT.java:3666)
> at org.eclipse.swt.widgets.Widget.error(Widget.java:446)
> at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:384)
> at org.eclipse.swt.widgets.Shell.setVisible(Shell.java:1627)
> at
> org.eclipse.ui.internal.LegacyAnimationFeedback.dispose(LegacyAnimationFeedback.java:87)
> at org.eclipse.ui.internal.AnimationEngine$3.run(AnimationEngine.java:190)
> at
> org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:155)
> at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:133)
> ... 18 more
> 

Comment 3 Laurent Marchal CLA 2009-01-28 09:10:07 EST
Hello Eric,

I tried to create a RCP application based on the mail template + text editor to show the problem, but i can't reproduce it.

What is causing the problem, is that my application use editors to edit database informations, and every time an editor is opened, i open it maximized, and if all editors are closed, i hide the editor area.

When i exit the application, all editors are closed (so the editors are not maximized any more) and the 'unmaximize' animation takes place while the application exits.

Maybe i can't reproduce the problem, because the opening / closing operations are slower(database) than the text editor closing.

Anyway if the LegacyAnimationFeedback.dispose(LegacyAnimationFeedback.java:87) is run in an asyncAexec(), the dispose() method should just check if the the is disposed before calling  setVisible(false) on it.

I can attach the RCP app if you want to add more tests in it.

Regards.
Laurent.
Comment 4 Eric Moffatt CLA 2009-01-28 14:17:25 EST
Thanks for the info (and your efforts to help are truly appreciated!). I'm guessing that this may have been fixed by the fix for bug 251193 so that's why you can repro it (or were you still running it under 3.4?).
Comment 5 Laurent Marchal CLA 2009-01-29 06:15:21 EST
Yes i still have this bug with 3.4.1
Build id: M20080911-1700

But i saw that bug 251193 has been fixed in build I20081027-1300 after the 3.4.1 release so i will try with 3.4.2.

Thanks Eric.

*** This bug has been marked as a duplicate of bug 251193 ***
Comment 6 Eric Moffatt CLA 2009-01-29 15:49:07 EST
No problem. Feel free to re-open bug 251193 if this isn't working in your 3.4.2 build.