Bug 575633

Summary: [GTK3] Hang in Display.syncExec() after Eclipse shutdown has started
Product: [Eclipse Project] Platform Reporter: Simeon Andreev <simeon.danailov.andreev>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: christian.dietrich.opensource
Version: 4.15   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=575616
Whiteboard:

Description Simeon Andreev CLA 2021-08-26 04:37:00 EDT
See bug 575616. For some reason the platform is disposing UI elements after the Display should have been disposed (but apparently wasn't). This lead to a hang, whereas it should result in an exception.

Reproduction steps are unclear, likely the UI and workspace state were broken.

Hang is between main thread and closing some bundle, after Eclipse shudown:


"Framework stop" #71 prio=6 os_prio=0 tid=0x00007f5f41c8a800 nid=0xc39e in Object.wait() [0x00007f52b3425000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:502)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:253)
	- locked <0x00007f5b889300f8> (a org.eclipse.swt.widgets.RunnableLock)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:146)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:6018)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:219)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:205)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:203)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:132)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:75)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:44)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:55)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:63)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:424)
	at org.eclipse.emf.ecore.util.EcoreEList.dispatchNotification(EcoreEList.java:249)
	at org.eclipse.emf.common.notify.impl.NotifyingListImpl.remove(NotifyingListImpl.java:713)
	at org.eclipse.emf.common.util.AbstractEList.remove(AbstractEList.java:456)
	at org.eclipse.emf.common.util.BasicEMap.remove(BasicEMap.java:1751)
	at org.eclipse.emf.common.util.BasicEMap.removeKey(BasicEMap.java:628)
	at org.eclipse.emf.common.util.BasicEMap$DelegatingMap.remove(BasicEMap.java:798)
	at org.eclipse.e4.ui.internal.workbench.OpaqueElementUtil.clearOpaqueItem(OpaqueElementUtil.java:50)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.clearOpaqueMenuItems(CompatibilityView.java:240)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityView.disposeSite(CompatibilityView.java:273)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.internalDisposeSite(CompatibilityPart.java:430)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.invalidate(CompatibilityPart.java:268)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.destroy(CompatibilityPart.java:417)
	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.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:1001)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:966)
	at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:462)
	at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:160)
	at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:82)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:106)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:69)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:186)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:171)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:171)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:171)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:171)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:102)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:144)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:973)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:151)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:234)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:140)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:132)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:231)
	at org.eclipse.osgi.container.Module.publishEvent(Module.java:493)
	at org.eclipse.osgi.container.Module.doStop(Module.java:651)
	at org.eclipse.osgi.container.Module.stop(Module.java:515)
	at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:207)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:220)
	at java.lang.Thread.run(Thread.java:748)

"main" #1 prio=6 os_prio=0 tid=0x00007f5f4004f800 nid=0xc168 in Object.wait() [0x00007f5f47d9d000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at org.eclipse.osgi.container.SystemModule.waitForStop(SystemModule.java:173)
	- locked <0x00007f53304c01d8> (a java.util.concurrent.atomic.AtomicReference)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle.waitForStop(EquinoxBundle.java:306)
	at org.eclipse.osgi.launch.Equinox.waitForStop(Equinox.java:198)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.shutdown(EclipseStarter.java:456)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:274)
	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:660)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1468)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1441)
Comment 1 Simeon Andreev CLA 2021-08-26 04:39:57 EDT
Probably reproducible with some SWT snippet, where Display event processing is done but the Display is not disposed yet.