Bug 571777 - UI "freeze" after exceptions under LazyStackRenderer.showTab
Summary: UI "freeze" after exceptions under LazyStackRenderer.showTab
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.17   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 4.20 M1   Edit
Assignee: Andrey Loskutov CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-03-08 08:48 EST by Andrey Loskutov CLA
Modified: 2021-03-08 15:43 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2021-03-08 08:48:37 EST
Regression from bug 317623: if any error happens inside org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showTab(MUIElement), Eclipse UI stops redrawing itself and for the user it looks like UI is frozen except menus.

We have got an issue reported by testers that after perspective switch UI stopped to respond. The error stack is similar to what I've put below. Independently why do we have CCE below, the LazyStackRenderer should restore redraw flag. I will push a patch.


!ENTRY org.eclipse.ui 4 0 2021-03-08 14:32:48.407
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.ClassCastException: BUG
	at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:106)
	at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.lambda$0(LazyStackRenderer.java:83)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.lambda$0(UIEventHandler.java:38)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:236)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:133)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5941)
	at org.eclipse.e4.ui.workbench.swt.DisplayUISynchronize.syncExec(DisplayUISynchronize.java:34)
	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:133)
	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.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:152)
	at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1)
	at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$3.lambda$0(PerspectiveSwitcher.java:537)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:74)
	at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$3.widgetSelected(PerspectiveSwitcher.java:535)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5831)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1427)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5092)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4570)
Comment 1 Eclipse Genie CLA 2021-03-08 08:54:45 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/177349
Comment 2 Eclipse Genie CLA 2021-03-08 08:54:46 EST
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/177350
Comment 3 Rolf Theunissen CLA 2021-03-08 09:06:46 EST
Of course, the setRedraw should always be in a try/finally block.

Would it be beneficial/possible to create API such that it is always used in a safe matter? Maybe, similar to the safe-runners all over the place.

w.r.t. the CCE, shouldn't "limbo" be a longer string (with namespace) to prevent collisions and shouldn't it be defined as a constant.