Discussion:
[nebula-dev] Gallery fix for SWTException
Justin Dolezy
2018-01-12 22:45:53 UTC
Permalink
Hi,

There’s a flaw in Gallery where “Widget is disposed” can be triggered; I can make this happen by scrolling a gallery with lots of items and then closing the view it’s being used in. Even easier to repro if using a ScrollingSmoother. Stack trace is below.

Fix is simple:

### Eclipse Workspace Patch 1.0
#P org.eclipse.nebula.widgets.gallery
diff --git src/org/eclipse/nebula/widgets/gallery/Gallery.java src/org/eclipse/nebula/widgets/gallery/Gallery.java
index 72d8c7f..e1b9881 100644
--- src/org/eclipse/nebula/widgets/gallery/Gallery.java
+++ src/org/eclipse/nebula/widgets/gallery/Gallery.java
@@ -1272,7 +1272,9 @@

protected class RedrawTimer implements Runnable {
public void run() {
- redraw();
+ if (!isDisposed()) {
+ redraw();
+ }
}
}

Hopefully this can be incorporated?

Regards,
Justin


org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Widget.error(Widget.java:800)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:589)
at org.eclipse.swt.widgets.Control.redraw(Control.java:2860)
at org.eclipse.nebula.widgets.gallery.Gallery$RedrawTimer.run(Gallery.java:1275)
at org.eclipse.swt.widgets.Display.runTimers(Display.java:4231)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3689)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1147)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1036)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at com.neckdiagrams.main.Application.start(Application.java:97)
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:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Jonah Graham
2018-01-13 12:35:10 UTC
Permalink
Hi Justin,

That looks great. Can you submit that as a gerrit so we can merge it
in? https://wiki.eclipse.org/Nebula/Contributions

Thanks
Jonah

~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com


On 12 January 2018 at 22:45, Justin Dolezy
Hi,
There’s a flaw in Gallery where “Widget is disposed” can be triggered; I can
make this happen by scrolling a gallery with lots of items and then closing
the view it’s being used in. Even easier to repro if using a
ScrollingSmoother. Stack trace is below.
### Eclipse Workspace Patch 1.0
#P org.eclipse.nebula.widgets.gallery
diff --git src/org/eclipse/nebula/widgets/gallery/Gallery.java
src/org/eclipse/nebula/widgets/gallery/Gallery.java
index 72d8c7f..e1b9881 100644
--- src/org/eclipse/nebula/widgets/gallery/Gallery.java
+++ src/org/eclipse/nebula/widgets/gallery/Gallery.java
@@ -1272,7 +1272,9 @@
protected class RedrawTimer implements Runnable {
public void run() {
- redraw();
+ if (!isDisposed()) {
+ redraw();
+ }
}
}
Hopefully this can be incorporated?
Regards,
Justin
org.eclipse.swt.SWTException: Widget is disposed
at org.eclipse.swt.SWT.error(SWT.java:4533)
at org.eclipse.swt.SWT.error(SWT.java:4448)
at org.eclipse.swt.SWT.error(SWT.java:4419)
at org.eclipse.swt.widgets.Widget.error(Widget.java:800)
at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:589)
at org.eclipse.swt.widgets.Control.redraw(Control.java:2860)
at
org.eclipse.nebula.widgets.gallery.Gallery$RedrawTimer.run(Gallery.java:1275)
at org.eclipse.swt.widgets.Display.runTimers(Display.java:4231)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3689)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1147)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1036)
at
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at com.neckdiagrams.main.Application.start(Application.java:97)
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:388)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
_______________________________________________
nebula-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from
this list, visit
https://dev.eclipse.org/mailman/listinfo/nebula-dev
Justin Dolezy
2018-01-16 20:15:39 UTC
Permalink
Got there in the end! For some reason couldn’t push via cmd line, getting this error:

remote: ERROR: [f91321a] invalid Change-Id line format in commit message footer
remote:
remote: Hint: A potential Change-IdChange-Id was found, but it was not in the footer (last paragraph) of the commit message.

Couldn’t find a correct url to curl download the commit-msg hook either. Fortunately it worked smoothly from the IDE though.

We’ve got another fix for a keyboard navigation problem too, will submit also so we’ll be able to ditch our locally built patches at last.

BTW, any idea when the next release will be? Can’t see dates on the downloads or releases pages, can only infer rough release dates from looking at the newest date on the bug list! Of course we can take snapshots until then, just curious.

Thanks,
Justin
Date: Sat, 13 Jan 2018 12:35:10 +0000
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="UTF-8"
Hi Justin,
That looks great. Can you submit that as a gerrit so we can merge it
in? https://wiki.eclipse.org/Nebula/Contributions <https://wiki.eclipse.org/Nebula/Contributions>
Thanks
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com <http://www.kichwacoders.com/>
Wim Jongman
2018-01-16 21:16:54 UTC
Permalink
Hi,

Thanks for the patch Justin! I have assigned the bug to you so that you
have the honor to close it. Please set it to resolved/fixed.

And thanks for stepping in Jonah. You did not release the code but feel
free to do so.

Justin, If you can please also update the NaN for the 1.5 release [2]
(March 15 [3]).

Cheers,

Wim

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=529842
[2] https://wiki.eclipse.org/Nebula/Releases/1.5.0/NaN
[3] https://projects.eclipse.org/projects/technology.nebula


On Tue, Jan 16, 2018 at 9:15 PM, Justin Dolezy <
Post by Justin Dolezy
remote: ERROR: [f91321a] invalid Change-Id line format in commit message footer
remote: Hint: A potential Change-IdChange-Id was found, but it was not in
the footer (last paragraph) of the commit message.
Couldn’t find a correct url to curl download the commit-msg hook either.
Fortunately it worked smoothly from the IDE though.
We’ve got another fix for a keyboard navigation problem too, will submit
also so we’ll be able to ditch our locally built patches at last.
BTW, any idea when the next release will be? Can’t see dates on the
downloads or releases pages, can only infer rough release dates from
looking at the newest date on the bug list! Of course we can take snapshots
until then, just curious.
Thanks,
Justin
Date: Sat, 13 Jan 2018 12:35:10 +0000
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="UTF-8"
Hi Justin,
That looks great. Can you submit that as a gerrit so we can merge it
in? https://wiki.eclipse.org/Nebula/Contributions
Thanks
Jonah
~~~
Jonah Graham
Kichwa Coders Ltd.
www.kichwacoders.com
_______________________________________________
nebula-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/nebula-dev
Justin Dolezy
2018-01-16 22:03:49 UTC
Permalink
Hi Wim,

Seems I’m rushing a bit - saw you wrote “close it”, but then forgot the later “resolved”.. Thanks for correcting!

Raised a bug (https://bugs.eclipse.org/bugs/show_bug.cgi?id=529912 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=529912>) for the other issue I mentioned and submitted to Gerrit, https://git.eclipse.org/r/#/c/115479/ <https://git.eclipse.org/r/#/c/115479/>

And just like buses that come in 3’s we’ve got another one. More serious this time as it causes a JVM/process crash/dump on Mac when exiting our app! Been plaguing us for a while but only recently focused on it recently as slowly getting closer to our major new release. This one’s in Grid though, will raise a bugzilla shortly and our guy who tracked it down will contribute a fix.

BTW, how often are the snapshot builds created? Are they automatic after Gerrits are merged? Would love to get a build with our fixes of course!

Will of course update the NaN as requested.

Cheers,
Justin
Message: 2
Date: Tue, 16 Jan 2018 22:16:54 +0100
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="utf-8"
Hi,
Thanks for the patch Justin! I have assigned the bug to you so that you
have the honor to close it. Please set it to resolved/fixed.
And thanks for stepping in Jonah. You did not release the code but feel
free to do so.
Justin, If you can please also update the NaN for the 1.5 release [2]
(March 15 [3]).
Cheers,
Wim
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=529842 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=529842>
[2] https://wiki.eclipse.org/Nebula/Releases/1.5.0/NaN <https://wiki.eclipse.org/Nebula/Releases/1.5.0/NaN>
[3] https://projects.eclipse.org/projects/technology.nebula <https://projects.eclipse.org/projects/technology.nebula>
Wim Jongman
2018-01-16 22:20:43 UTC
Permalink
Hi Justin,
Post by Justin Dolezy
Thanks for correcting!
Got your back!


BTW, how often are the snapshot builds created? Are they automatic after
Post by Justin Dolezy
Gerrits are merged? Would love to get a build with our fixes of course!
Snapshots are build whenever we release a patch [1]. So your change is
already out there.
Every Gerrit is also build and can be consumed from Jenkins [2].
Post by Justin Dolezy
Will of course update the NaN as requested.
Thanks!

Wim

[1] https://www.eclipse.org/nebula/downloads.php
[2]
https://hudson.eclipse.org/nebula/job/nebula.stable.gerrit/lastSuccessfulBuild/artifact/releng/org.eclipse.nebula.updatesite/target/repository/
Justin Dolezy
2018-01-17 20:03:34 UTC
Permalink
Hi Wim,

Two patches down, one to go!

https://bugs.eclipse.org/bugs/show_bug.cgi?id=529920 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=529920>

https://git.eclipse.org/r/#/c/115568/ <https://git.eclipse.org/r/#/c/115568/>

BTW, I've updated the NaN for those other two.

Many thanks,
Justin
Date: Tue, 16 Jan 2018 23:20:43 +0100
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="utf-8"
Hi Justin,
Post by Justin Dolezy
Thanks for correcting!
Got your back!
BTW, how often are the snapshot builds created? Are they automatic after
Post by Justin Dolezy
Gerrits are merged? Would love to get a build with our fixes of course!
Snapshots are build whenever we release a patch [1]. So your change is
already out there.
Every Gerrit is also build and can be consumed from Jenkins [2].
Post by Justin Dolezy
Will of course update the NaN as requested.
Thanks!
Wim
[1] https://www.eclipse.org/nebula/downloads.php <https://www.eclipse.org/nebula/downloads.php>
[2]
https://hudson.eclipse.org/nebula/job/nebula.stable.gerrit/lastSuccessfulBuild/artifact/releng/org.eclipse.nebula.updatesite/target/repository/ <https://hudson.eclipse.org/nebula/job/nebula.stable.gerrit/lastSuccessfulBuild/artifact/releng/org.eclipse.nebula.updatesite/target/repository/>
Wim Jongman
2018-01-17 20:55:56 UTC
Permalink
Hi Justin,

I can imagine why you saved this one for last! We need to consult with the
SWT team for a little more analysis.

Cheers,

Wim

On Wed, Jan 17, 2018 at 9:03 PM, Justin Dolezy <
Post by Justin Dolezy
Hi Wim,
Two patches down, one to go!
https://bugs.eclipse.org/bugs/show_bug.cgi?id=529920
https://git.eclipse.org/r/#/c/115568/
BTW, I've updated the NaN for those other two.
Many thanks,
Justin
Date: Tue, 16 Jan 2018 23:20:43 +0100
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="utf-8"
Hi Justin,
Thanks for correcting!
Got your back!
BTW, how often are the snapshot builds created? Are they automatic after
Gerrits are merged? Would love to get a build with our fixes of course!
Snapshots are build whenever we release a patch [1]. So your change is
already out there.
Every Gerrit is also build and can be consumed from Jenkins [2].
Will of course update the NaN as requested.
Thanks!
Wim
[1] https://www.eclipse.org/nebula/downloads.php
[2]
https://hudson.eclipse.org/nebula/job/nebula.stable.
gerrit/lastSuccessfulBuild/artifact/releng/org.eclipse.
nebula.updatesite/target/repository/
_______________________________________________
nebula-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe
from this list, visit
https://dev.eclipse.org/mailman/listinfo/nebula-dev
Justin Dolezy
2018-01-17 21:45:29 UTC
Permalink
Hi Wim,
Post by Wim Jongman
I can imagine why you saved this one for last!
Just the way it panned out - Slava only found the “culprit” whilst I was submitting the other changes, no intention of softening you up first for the final big hit lol 8o)

Hopefully the SWT team will come back fairly quickly.. if they want a self contained example that could be difficult though! Perhaps there’s an underlying issue in the SWT Cocoa port with GC memory deallocation..

Cheers,
Justin
Post by Wim Jongman
Date: Wed, 17 Jan 2018 21:55:56 +0100
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="utf-8"
Hi Justin,
I can imagine why you saved this one for last! We need to consult with the
SWT team for a little more analysis.
Cheers,
Wim
Wim Jongman
2018-01-17 21:53:59 UTC
Permalink
no intention of softening you up..
:D
if they want a self contained example that could be difficult though!
Did you ever try to create a snippet that reuses the same GC for e.g. 100k resize calculations and then close the main loop?

Cheers,

Wim
Justin Dolezy
2018-01-18 20:37:01 UTC
Permalink
Post by Wim Jongman
Did you ever try to create a snippet that reuses the same GC for e.g. 100k resize calculations and then close the main loop?
No, but we’re pretty confident that wouldn’t trigger it. Our repro steps all involve switching perspectives.

Two of them have fixed views each using a Grid. Could be there’s some unwanted interaction going on under the covers of the cached GC’s? Plus a third perspective uses GEF and draw2d does a fair amount of GC manipulation too..

If we quit without changing perspective then no crash!

Cheers,
Justin
Post by Wim Jongman
Date: Wed, 17 Jan 2018 21:53:59 +0000
Subject: Re: [nebula-dev] Gallery fix for SWTException
Content-Type: text/plain; charset="utf-8"
no intention of softening you up..
:D
if they want a self contained example that could be difficult though!
Did you ever try to create a snippet that reuses the same GC for e.g. 100k resize calculations and then close the main loop?
Cheers,
Wim
Loading...