| Summary: | Shared area disappears and then Eclipse becomes unusable | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Remy Suen <remy.suen> | ||||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||||
| Status: | VERIFIED FIXED | QA Contact: | |||||||
| Severity: | critical | ||||||||
| Priority: | P3 | CC: | pwebster | ||||||
| Version: | 1.0 | Flags: | remy.suen:
review+
|
||||||
| Target Milestone: | 4.1 RC4 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Remy Suen
*** Bug 344621 has been marked as a duplicate of this bug. *** Got hit by this again after reproducing bug 347561. 1. Open the 'Debug' perspective. 2. Open the 'Team Synchronizing' perspective. 3. Open the 'Java' perspective. 4. Open the 'Team Synchronizing' perspective. 5. Open the 'Debug' perspective. 6. Open the 'History' view. 7. Detach the 'History' view. 8. Window > Reset Perspective > OK 9. Open the 'Java' perspective. 10. Open the 'Team Synchronizing' perspective. The shared area will now disappear. org.eclipse.swt.SWTException: Graphic is disposed at org.eclipse.swt.SWT.error(SWT.java:4277) at org.eclipse.swt.SWT.error(SWT.java:4192) at org.eclipse.swt.SWT.error(SWT.java:4163) at org.eclipse.swt.graphics.Image.getBounds(Image.java:1164) at org.eclipse.e4.ui.widgets.CTabFolderRenderer.computeSize(CTabFolderRenderer.java:246) at org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering.computeSize(CTabRendering.java:148) at org.eclipse.e4.ui.widgets.CTabFolderRenderer.computeSize(CTabFolderRenderer.java:224) at org.eclipse.e4.ui.workbench.renderers.swt.CTabRendering.computeSize(CTabRendering.java:152) at org.eclipse.e4.ui.widgets.CTabFolder.updateTabHeight(CTabFolder.java:3627) at org.eclipse.e4.ui.widgets.CTabFolder.setTopRight(CTabFolder.java:3395) at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.adjustTR(StackRenderer.java:405) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showElementRecursive(LazyStackRenderer.java:203) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showElementRecursive(LazyStackRenderer.java:258) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showElementRecursive(LazyStackRenderer.java:258) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showElementRecursive(LazyStackRenderer.java:258) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.showTab(LazyStackRenderer.java:137) at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:109) at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer$1.handleEvent(LazyStackRenderer.java:66) at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41) at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180) at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150) at org.eclipse.swt.widgets.Display.syncExec(Display.java:4681) at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:182) at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38) at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197) at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135) at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78) at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39) at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:81) at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58) at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:380) at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:135) at org.eclipse.e4.ui.model.application.ui.advanced.impl.PerspectiveStackImpl.setSelectedElement(PerspectiveStackImpl.java:1) at org.eclipse.e4.ui.workbench.addons.perspectiveswitcher.PerspectiveSwitcher$10.widgetSelected(PerspectiveSwitcher.java:348) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) Less mundane steps as follows. 1. Open the 'Debug' perspective. 2. Open the 'Team Synchronizing' perspective. 3. Open the 'Debug' perspective. 4. Activate the 'Tasks' view. 5. Window > Reset Perspective > OK 6. Open the 'Team Synchronizing' perspective. The shared area will now disappear. Introduced by the implementation of bug 318866. (In reply to comment #4) > 2. Open the 'Team Synchronizing' perspective. Note that this perspective has the 'Tasks' view there. > 4. Activate the 'Tasks' view. This creates the view and also causes updateImages(MPart) to be called, making all tab items with placeholders representing this view use the image returned by the workbench part's getTitleImage() image. > 5. Window > Reset Perspective > OK During the reset, it is determined that the 'Tasks' part is no longer needed (it is obscured in both the 'Debug' and 'Team Synchronizing' perspectives). As a result, it is destroyed and its representing image is also destroyed. Remember though that this image was used _all_ placeholders when step 4 happened above. > 6. Open the 'Team Synchronizing' perspective. The shared area will now > disappear. Now we try to switch to this other perspective but the 'Tasks' view that's in this perspective's tab folder is now using a destroyed image for its tab item (as explained above) and the whole thing blows up. Disposal trace from step 5 below: Thread [main] (Suspended (breakpoint at line 1042 in Image)) Image.destroy() line: 1042 Image(Resource).dispose() line: 66 URLImageDescriptor(ImageDescriptor).destroyResource(Object) line: 176 DeviceResourceManager.deallocate(Object, DeviceResourceDescriptor) line: 63 DeviceResourceManager(AbstractResourceManager).destroy(DeviceResourceDescriptor) line: 112 DeviceResourceManager(ResourceManager).destroyImage(ImageDescriptor) line: 227 TasksView(WorkbenchPart).dispose() line: 109 TasksView(ExtendedMarkersView).dispose() line: 617 CompatibilityView(CompatibilityPart).invalidate() line: 170 CompatibilityView(CompatibilityPart).destroy() line: 323 GeneratedMethodAccessor25.invoke(Object, Object[]) line: not available DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 MethodRequestor.execute() line: 56 InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 828 InjectorImpl.processAnnotated(Class<Annotation>, Object, Class<?>, PrimaryObjectSupplier, PrimaryObjectSupplier, ArrayList<Class<?>>) line: 808 InjectorImpl.uninject(Object, PrimaryObjectSupplier) line: 167 FieldRequestor(Requestor).uninject(Object, PrimaryObjectSupplier) line: 122 ContextObjectSupplier$ContextInjectionListener.update(IEclipseContext, int, Object[]) line: 69 TrackableComputationExt.update(ContextChangeEvent) line: 88 EclipseContext.removeListenersTo(Object) line: 439 ContextInjectionFactory.uninject(Object, IEclipseContext) line: 135 PartRenderingEngine.safeRemoveGui(MUIElement) line: 793 PartRenderingEngine.access$3(PartRenderingEngine, MUIElement) line: 728 PartRenderingEngine$8.run() line: 723 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 708 ElementReferenceRenderer.disposeWidget(MUIElement) line: 108 PartRenderingEngine.safeRemoveGui(MUIElement) line: 784 PartRenderingEngine.access$3(PartRenderingEngine, MUIElement) line: 728 PartRenderingEngine$8.run() line: 723 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 708 PartRenderingEngine.safeRemoveGui(MUIElement) line: 761 PartRenderingEngine.access$3(PartRenderingEngine, MUIElement) line: 728 PartRenderingEngine$8.run() line: 723 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 708 PartRenderingEngine.safeRemoveGui(MUIElement) line: 761 PartRenderingEngine.access$3(PartRenderingEngine, MUIElement) line: 728 PartRenderingEngine$8.run() line: 723 SafeRunner.run(ISafeRunnable) line: 42 PartRenderingEngine.removeGui(MUIElement) line: 708 PartRenderingEngine$1.handleEvent(Event) line: 137 UIEventHandler$1.run() line: 41 UISynchronizer(Synchronizer).syncExec(Runnable) line: 180 UISynchronizer.syncExec(Runnable) line: 150 Display.syncExec(Runnable) line: 4681 E4Application$1.syncExec(Runnable) line: 182 UIEventHandler.handleEvent(Event) line: 38 EventHandlerWrapper.handleEvent(Event, Permission) line: 197 EventHandlerTracker.dispatchEvent(EventHandlerWrapper, Permission, int, Event) line: 197 EventHandlerTracker.dispatchEvent(Object, Object, int, Object) line: 1 EventManager.dispatchEvent(Set, EventDispatcher, int, Object) line: 230 ListenerQueue.dispatchEventSynchronous(int, Object) line: 148 EventAdminImpl.dispatchEvent(Event, boolean) line: 135 EventAdminImpl.sendEvent(Event) line: 78 EventComponent.sendEvent(Event) line: 39 EventBroker.send(String, Object) line: 81 UIEventPublisher.notifyChanged(Notification) line: 58 PartSashContainerImpl(BasicNotifierImpl).eNotify(Notification) line: 380 PartSashContainerImpl(UIElementImpl).setToBeRendered(boolean) line: 290 WorkbenchPage.resetPerspective() line: 2937 Now that the cause has been identified, the steps can be shortened even further by taking the 'Team Synchronizing' perspective out of the equation. 1. Open the 'Debug' perspective. 2. Open the 'Java' perspective. 3. Open the 'Tasks' view. 4. Window > Reset Perspective > OK 5. Open the 'Debug' perspective. The shared area will now disappear. Created attachment 196837 [details]
Image update patch v1
The suggested patch records the original image that was used to represent the part prior to its construction, then during deconstruction we restore the original image to all representing elements so that any disposal of the previously set images by the workbench part will not affect the UI.
Created attachment 196923 [details]
Alternative patch...forces the image back to the 'original' before disposing a shared part
This is more e4-centric in that it will work even if it's an e4 RCP app that has been messing with the image.
It also has a fix for a defect in the StackRenderer that would only update the tabs for perspectives where the view has be rendered at least once. Before this fix and given the proposed scenario if you were to change the label of the part from 'Tasks' to 'Foo' only the label in the Java perspective would have changed, the tab for the Tasks view in the Debug perspective would still read 'Tasks'.
Remy, take a look... (In reply to comment #8) > Created attachment 196923 [details] > Alternative patch...forces the image back to the 'original' before disposing a > shared part This looks safe to me and the bug itself is critical enough to warrant a fix this late in the cycle given that the user has to restart Eclipse, +1. Committed in >20110601. Applied the patch. Updating milestone... Verified in I20110604-2201 |