Bug 428882 - Unhandled event loop exception when switching from Diagram to properties view
Summary: Unhandled event loop exception when switching from Diagram to properties view
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Diagram (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: dx stable
Keywords:
Depends on: 429464
Blocks:
  Show dependency tree
 
Reported: 2014-02-24 04:47 EST by Patrik Nandorf CLA
Modified: 2017-09-13 20:34 EDT (History)
4 users (show)

See Also:


Attachments
Screen recording where this happens (880.07 KB, application/x-shockwave-flash)
2014-02-24 04:57 EST, Patrik Nandorf CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Nandorf CLA 2014-02-24 04:47:10 EST
Sometimes when switching focus from the diagram to the properties view I get an Unhandled event loop exception and the diagram goes blank.



Stack trace:
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.IllegalArgumentException: Argument not valid)
	at org.eclipse.swt.SWT.error(SWT.java:4441)
	at org.eclipse.swt.SWT.error(SWT.java:4356)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:139)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4147)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3764)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1122)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1006)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:146)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:615)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:109)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:80)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:372)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:226)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Caused by: java.lang.IllegalArgumentException: Argument not valid
	at org.eclipse.swt.SWT.error(SWT.java:4422)
	at org.eclipse.swt.SWT.error(SWT.java:4356)
	at org.eclipse.swt.SWT.error(SWT.java:4327)
	at org.eclipse.swt.graphics.GC.setFont(GC.java:4404)
	at org.eclipse.draw2d.FigureUtilities.setFont(FigureUtilities.java:363)
	at org.eclipse.draw2d.FigureUtilities.getFontMetrics(FigureUtilities.java:59)
	at org.eclipse.gmf.tooling.runtime.directedit.locator.TextCellEditorLocator.relocate(TextCellEditorLocator.java:31)
	at org.eclipse.gef.tools.DirectEditManager.placeCellEditor(DirectEditManager.java:347)
	at org.eclipse.gef.tools.DirectEditManager.access$1(DirectEditManager.java:346)
	at org.eclipse.gef.tools.DirectEditManager$1.ancestorMoved(DirectEditManager.java:269)
	at org.eclipse.draw2d.AncestorHelper.fireAncestorMoved(AncestorHelper.java:104)
	at org.eclipse.draw2d.AncestorHelper.figureMoved(AncestorHelper.java:91)
	at org.eclipse.draw2d.Figure.fireFigureMoved(Figure.java:493)
	at org.eclipse.draw2d.Figure.setBounds(Figure.java:1521)
	at org.eclipse.draw2d.ScrollPaneSolver.solve(ScrollPaneSolver.java:122)
	at org.eclipse.draw2d.FigureCanvas.layoutViewport(FigureCanvas.java:325)
	at org.eclipse.draw2d.FigureCanvas.access$4(FigureCanvas.java:323)
	at org.eclipse.draw2d.FigureCanvas$3.notifyValidating(FigureCanvas.java:292)
	at org.eclipse.draw2d.UpdateManager.fireValidating(UpdateManager.java:143)
	at org.eclipse.draw2d.DeferredUpdateManager.performValidation(DeferredUpdateManager.java:214)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$ToggleUpdateManager.performValidation(DiagramGraphicalViewer.java:116)
	at org.eclipse.draw2d.DeferredUpdateManager.performUpdate(DeferredUpdateManager.java:190)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$ToggleUpdateManager.performUpdate(DiagramGraphicalViewer.java:106)
	at org.eclipse.draw2d.DeferredUpdateManager$UpdateRequest.run(DeferredUpdateManager.java:44)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:136)
	... 24 more
Comment 1 Patrik Nandorf CLA 2014-02-24 04:57:26 EST
Created attachment 240253 [details]
Screen recording where this happens
Comment 2 Camille Letavernier CLA 2014-02-26 09:45:44 EST
Side effect of Bug 402199 which has reappeared a few days ago.

When you switch to the properties view, the "create diagram" icons disappear from the toolbar. The toolbar is smaller and switches from 2-rows to 1-row. This causes Eclipse to re-layout all views, including the diagram itself, which triggers the diagram re-layout.

One of the consequences of this re-layout is that the editor for the Class' name needs to move, except that switching to the properties view closed it (The Text widget is disposed).

We can avoid this behavior by (re-)fixing Bug 402199, but the actual bug should also be fixed on GMF Tooling's side
Comment 3 Camille Letavernier CLA 2014-03-03 08:47:22 EST
This was due to an invalid merge, which reintroduced the former behavior, thus reverting the fix applied in Bug 420199

I've applied the fix again, which should avoid this issue.

However, this is not a full fix for this bug; it simply avoids one of the precondition for the GMF-Tooling class to fail.
Comment 4 Camille Letavernier CLA 2014-03-11 10:31:48 EDT
I reduce the severity from Major to Minor, as the symptoms have been solved. I leave the bug opened because the root cause is still here.
Comment 5 Toni Siljamäki CLA 2015-04-11 11:32:03 EDT
Which "root cause is still here" and how should it be solved/tested?
Comment 6 Patrik Nandorf CLA 2015-05-29 03:56:32 EDT
What is the status of the root cause of this?
Comment 7 Camille Letavernier CLA 2015-05-29 04:51:22 EDT
Bug 429464: TextCellEditorLocator sometimes tries to access a disposed text widget
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429464
Comment 8 Toni Siljamäki CLA 2017-09-13 20:34:53 EDT
Hello Florian, long time no see, I hope you are well. :)

This particular bug reported in 2014-02-24 was just switched from status ASSIGNED to status NEW. (?)

This bug is a bit similar to the older "out of handles" (unhandled event loop exception) Bug 384158, Bug 420561 and Bug 421412, which we earlier analyzed and agreed mainly is about lower-level Eclipse API protocol errors not being properly handled by Papyrus. (for its users)

Maybe you can find and utilize something similar to Wireshark to more deeply analyze and automatically detect such lower-level API protocol errors during automatic testing?

I think such learnings would be quite useful for the Eclipse platform and ecosystem as a whole.
Regards/Toni