Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340113

Summary: CTabFolderRenderer exceptions opening regenerated file
Product: [Eclipse Project] Platform Reporter: Ed Willink <ed>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: major    
Priority: P3 CC: remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows Vista   
Whiteboard: stalebug
Attachments:
Description Flags
More traces none

Description Ed Willink CLA 2011-03-16 02:28:51 EDT
Created attachment 191278 [details]
More traces

M6:

I'm auto-generating Java files, so that a builder runs in the background and changes error markers.

When I open these files I get:


org.eclipse.swt.SWTException: Graphic is disposed
	at org.eclipse.swt.SWT.error(SWT.java:4209)
	at org.eclipse.swt.SWT.error(SWT.java:4124)
	at org.eclipse.swt.SWT.error(SWT.java:4095)
	at org.eclipse.swt.graphics.Image.getBounds(Image.java:1164)
	at org.eclipse.swt.custom.CTabFolderRenderer.drawUnselected(CTabFolderRenderer.java:1572)
	at org.eclipse.swt.custom.CTabFolderRenderer.draw(CTabFolderRenderer.java:539)
	at org.eclipse.swt.custom.CTabFolder.onPaint(CTabFolder.java:1717)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:262)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Composite.WM_PAINT(Composite.java:1463)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4564)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4946)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2523)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3713)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2697)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2661)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2495)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:592)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

giving me at least a broken workspace that needs a reset and if I try tyo open files again a locked up Eclipse.

Fuller Console Log attached.
Comment 1 Ed Willink CLA 2011-03-16 02:39:40 EDT
Reproducible.

Start Run-time Eclipse.
Open an autogenerated File for edit.
Open another file for edit that controls the auto-generation.
Edit and save the control file.
Run a launch config to regenerate the auto generated file with changed errors.
Select the autogenerated File tab.

Bang. UI lock up.
Comment 2 Ed Willink CLA 2011-03-16 03:23:06 EDT
(In reply to comment #1) 
> Bang. UI lock up.

Clarification:

Editor pane ceases to refresh.
File->Exit doesn't exit.

Views, Navigator, ToolBar functional.
Comment 3 Ed Willink CLA 2011-03-16 03:28:26 EDT
Also reproduces if autogenerated file is closed during regeneration, so there seems to be no workaround other than to restart Eclipse for every regeneration that changes markers. I guess I'll have to use Platform M5 for my EclipseCon tutorial.
Comment 4 Ed Willink CLA 2011-03-17 03:39:09 EDT
(In reply to comment #3)
> I guess I'll have to use Platform M5 for my EclipseCon tutorial.

Problem now exists on M5 too!

It would appear that like Bug 330482 there is an adverse interaction between SWT and M6 versions of some of Acceleo, Xtext, Operational QVT, OCL Examples that have overt editing functionality and just possibly EMF, EMF Compare, GMF, GEF that are also installed.
Comment 5 Ed Willink CLA 2011-03-17 05:42:26 EDT
More specific bug raised against Xtext in Bug 340287.

But should an Xtext malfunction be able to lock up all Editor panes?
Comment 6 Ed Willink CLA 2011-05-03 03:43:15 EDT
Ping. Is anyone looking at this?
Comment 7 Remy Suen CLA 2011-05-03 05:59:09 EDT
Do you change your editor's title images in your code or is it completely reliant on the one defined in the plugin.xml?
Comment 8 Ed Willink CLA 2011-05-03 11:48:43 EDT
I don't change anything; it's a standard Xtext editor window. But Xtext puts error markers on the editor tab. Bug 340287 is a related bug against Xtext. However even if Xtext is badly behaved, this bug is about the total loss of control in the editor panel and inability to exit Eclipse.
Comment 9 Remy Suen CLA 2011-05-03 17:36:12 EDT
(In reply to comment #4)
> It would appear that like Bug 330482 there is an adverse interaction between
> SWT and M6 versions of some of Acceleo, Xtext, Operational QVT, OCL Examples
> that have overt editing functionality and just possibly EMF, EMF Compare, GMF,
> GEF that are also installed.

If it's an Indigo M6 contribution then it's possible this was caused by bug 299314.

(In reply to comment #8)
> I don't change anything; it's a standard Xtext editor window.

I posed the question assuming you were an Xtext committer. This doesn't seem to be the case so I've asked those guys on bug 340287 instead.

> However even if Xtext is badly behaved, this bug is about the total loss of
> control in the editor panel and inability to exit Eclipse.

If they're doing what I think they're doing, then I suppose it's possible for SWT to not try to optimize its drawing routine if the previous image has already been disposed.
Comment 10 Lars Vogel CLA 2019-11-14 02:16:11 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.