Bug 579442 - SWT/GTK Freeze
Summary: SWT/GTK Freeze
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-28 04:35 EDT by Hauke Fuhrmann CLA
Modified: 2022-03-28 09:23 EDT (History)
4 users (show)

See Also:


Attachments
small example application (84.18 KB, application/x-zip-compressed)
2022-03-28 04:35 EDT, Hauke Fuhrmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hauke Fuhrmann CLA 2022-03-28 04:35:24 EDT
Created attachment 288305 [details]
small example application

We have a 24/7 application where users open and close SWT/GTK Windows.

We encounter a freeze of a SWT/GTK Window while opening a window. We created a minimal example in a open/close-loop which seems to reproduce the problem. The symptom is that when trying to open the window, the window frame is visible but the content just shows what was in the background at that point of time. You can still move the windows around, but closing is no longer possible and nothing of the whole application is refreshed. There is no error message or stacktrace visible.

We reproduced this with

SWT Versions: 3.118.0 (Eclipse 4.22), 3.16.0 (Eclipse 4.19)

GTK 3.24.14, xserver-xorg 1.20.8, libx11-6 1.6.9

Frozen after 11.000 or 32.000 window openings (with a delay of 200ms) the crash occured after about 40min or 2h, so you need a bit patience to reproduce it, but it eventually happens all the time.
Comment 1 Hauke Fuhrmann CLA 2022-03-28 06:15:10 EDT
We also reproduced on GTK 3.22
Comment 2 Hauke Fuhrmann CLA 2022-03-28 07:45:12 EDT
Here is a stack trace after the freeze

RUNNABLE	-	org.eclipse.swt.internal.gtk3.GTK3.gtk_main_iteration_do(Native Method)
org.eclipse.swt.widgets.Shell.setVisible(Shell.java:2942)
org.eclipse.e4.ui.workbench.addons.cleanupaddon.CleanupAddon.subscribeVisibilityChanged(CleanupAddon.java:190)
jdk.internal.reflect.GeneratedMethodAccessor281.invoke(Unknown Source)
java.base@11.0.5/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.5/java.lang.reflect.Method.invoke(Method.java:566)
org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler$$Lambda$571/0x00000008008eb840.run(Unknown Source)
org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
org.eclipse.swt.widgets.Display.syncExec(Display.java:6012)
org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
org.eclipse.e4.ui.internal.di.UIEventObjectSupplier$UIEventHandler.handleEvent(UIEventObjectSupplier.java:64)
org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:228)
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:133)
org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
org.eclipse.e4.ui.model.application.ui.impl.UIElementImpl.setVisible(UIElementImpl.java:361)
de.scheidtbachmann.ibs.client.ui.windowregistry.internal.WindowPositioningHandler.showWindow(WindowPositioningHandler.java:456)
de.scheidtbachmann.ibs.client.ui.windowregistry.internal.WindowPositioningHandler.bringToTopWithHighlight(WindowPositioningHandler.java:413)
de.scheidtbachmann.ibs.client.ui.windowregistry.internal.WindowServiceImpl.open(WindowServiceImpl.java:165)
de.scheidtbachmann.ibs.client.ui.menu.internal.handlers.OpenE4WindowHandler.execute(OpenE4WindowHandler.java:94)
jdk.internal.reflect.GeneratedMethodAccessor388.invoke(Unknown Source)
java.base@11.0.5/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.5/java.lang.reflect.Method.invoke(Method.java:566)
org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
org.eclipse.e4.ui.workbench.renderers.swt.DirectContributionItem.executeItem(DirectContributionItem.java:133)
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:449)
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:475)
org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$$Lambda$853/0x0000000800b30440.handleEvent(Unknown Source)
org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
org.eclipse.swt.widgets.Display.sendEvent(Display.java:5895)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1515)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1541)
org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1303)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot$2.run(AbstractSWTBot.java:190)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$5.doRun(UIThreadRunnable.java:222)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.run(UIThreadRunnable.java:76)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.asyncExec(UIThreadRunnable.java:224)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.asyncExec(AbstractSWTBot.java:656)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:175)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:153)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:142)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.notify(AbstractSWTBot.java:132)
org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu$1.run(SWTBotMenu.java:88)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable$5.doRun(UIThreadRunnable.java:222)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.run(UIThreadRunnable.java:76)
org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable.asyncExec(UIThreadRunnable.java:224)
org.eclipse.swtbot.swt.finder.widgets.AbstractSWTBot.asyncExec(AbstractSWTBot.java:656)
org.eclipse.swtbot.swt.finder.widgets.SWTBotMenu.click(SWTBotMenu.java:74)
jdk.internal.reflect.GeneratedMethodAccessor469.invoke(Unknown Source)
java.base@11.0.5/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.5/java.lang.reflect.Method.invoke(Method.java:566)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.ReflectionUtils$Call.invoke(ReflectionUtils.java:120)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.ReflectionUtils.invokeAction(ReflectionUtils.java:73)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:264)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:271)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:271)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:271)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:271)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.executeCommand(RemoteControlServlet.java:271)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet.lambda$1(RemoteControlServlet.java:184)
de.scheidtbachmann.gp.graphics.remotecontrol.internal.RemoteControlServlet$$Lambda$1339/0x0000000800ee1440.call(Unknown Source)
de.scheidtbachmann.gp.graphics.remotecontrol.swtbot.AbstractSWTRootObjectProvider.call(AbstractSWTRootObjectProvider.java:50)
de.scheidtbachmann.gp.graphics.remotecontrol.swtbot.AbstractSWTRootObjectProvider.lambda$0(AbstractSWTRootObjectProvider.java:41)
de.scheidtbachmann.gp.graphics.remotecontrol.swtbot.AbstractSWTRootObjectProvider$$Lambda$1318/0x0000000800ee6040.run(Unknown Source)
org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5101)
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4584)
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:168)
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
java.base@11.0.5/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base@11.0.5/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
java.base@11.0.5/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base@11.0.5/java.lang.reflect.Method.invoke(Method.java:566)
app//org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
app//org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
app//org.eclipse.equinox.launcher.Main.run(Main.java:1467)
app//org.eclipse.equinox.launcher.Main.main(Main.java:1440)
Comment 3 Hauke Fuhrmann CLA 2022-03-28 08:21:30 EDT
The application uses an embedded Swing component. It seems that the issue is relevant to the Swing Look-and-feel: It could be reproduced with the GTK LaF and Metal LaF, but not with the Windows LaF and Motif LaF.
Comment 4 Nikita Nemkin CLA 2022-03-28 09:23:58 EDT
I wonder, do you need SWT_AWT for graphics only or do you need the full AWT/Swing stack?

It's pretty easy to arrange a Graphics2D context on top of an SWT Image and all the threading and windowing problems inherent to SWT_AWT could be sidestepped.