Bug 527545 - Cannot open a representation, it only opens an empty tab with no title ("Could not initialize class org.eclipse.draw2d.Cursors")
Summary: Cannot open a representation, it only opens an empty tab with no title ("Coul...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 5.0.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Pierre-Charles David CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2017-11-21 05:33 EST by Erwan Bousse CLA
Modified: 2020-08-09 08:27 EDT (History)
4 users (show)

See Also:


Attachments
Buggy eclipse configuration (678.44 KB, text/plain)
2017-11-21 05:33 EST, Erwan Bousse CLA
no flags Details
Working Eclipse configuration (GEMOC Studio) (373.32 KB, text/plain)
2017-11-21 05:34 EST, Erwan Bousse CLA
no flags Details
Sample program to try to reproduce the issue (1.76 MB, application/zip)
2018-02-12 06:58 EST, Pierre-Charles David CLA
no flags Details
The eclipse configuration used for running the wayland/x11 tests (432.51 KB, text/plain)
2018-05-08 04:51 EDT, Erwan Bousse CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erwan Bousse CLA 2017-11-21 05:33:57 EST
Created attachment 271569 [details]
Buggy eclipse configuration

OS: Fedora 27 x86_64
Eclipse installation: Oxygen + Sirius + a few components, all fully updated with default update sites (see attachment buggy-eclipse.txt for the complete configuration)


When I open any aird file, and try to open any representation, I only end up with an empty tab with no title (screenshot: https://user-images.githubusercontent.com/5868014/32561882-a0ac9878-c4ad-11e7-9d15-a507fdfdefd6.png)

More precisely, when trying to open a representation, the following warnings and errors pop:
==================================================================
(SWT:13180): Gtk-WARNING **: Negative content width -6 (allocation 1, extents 4x3) while allocating gadget (node toolbar, owner GtkToCould not initialize class org.eclipse.draw2d.Cursorsolbar)

(SWT:13180): Gtk-WARNING **: Negative content height -3 (allocation 1, extents 2x2) while allocating gadget (node toolbar, owner GtkToolbar)

(SWT:13180): Gtk-WARNING **: Negative content width -6 (allocation 1, extents 4x3) while allocating gadget (node toolbar, owner GtkToolbar)

(SWT:13180): Gtk-WARNING **: Negative content height -3 (allocation 1, extents 2x2) while allocating gadget (node toolbar, owner GtkToolbar)

!ENTRY org.eclipse.e4.ui.workbench 4 0 2017-11-21 11:04:14.754
!MESSAGE Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor' from bundle '1635'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.draw2d.Cursors
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:105)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:74)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:56)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer.createWidget(ContributedPartRenderer.java:129)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createWidget(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:666)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.safeCreateGui(PartRenderingEngine.java:772)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.access$0(PartRenderingEngine.java:743)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$2.run(PartRenderingEngine.java:737)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.createGui(PartRenderingEngine.java:721)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:104)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:40)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:212)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:36)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:201)
	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:52)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:60)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:173)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:620)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:584)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:768)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:401)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1187)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3261)
	at org.eclipse.ui.internal.WorkbenchPage.access$25(WorkbenchPage.java:3176)
	at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:3158)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3153)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3117)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3098)
	at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectUIServices$1.run(DiagramDialectUIServices.java:210)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
	at org.eclipse.sirius.common.ui.tools.api.util.EclipseUIUtil.displaySyncExec(EclipseUIUtil.java:336)
	at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectUIServices.openEditor(DiagramDialectUIServices.java:220)
	at org.eclipse.sirius.diagram.ui.business.internal.dialect.DiagramDialectUIServices.openEditor(DiagramDialectUIServices.java:181)
	at org.eclipse.sirius.ui.business.internal.dialect.DialectUIManagerImpl.openEditor(DialectUIManagerImpl.java:94)
	at org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.openRepresentations(OpenRepresentationsAction.java:109)
	at org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.access$1(OpenRepresentationsAction.java:96)
	at org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction$1.run(OpenRepresentationsAction.java:82)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:437)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:353)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:483)
	at org.eclipse.ui.internal.progress.ProgressManager$RunnableWithStatus.run(ProgressManager.java:1124)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.progress.ProgressManager.lambda$26(ProgressManager.java:1001)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:233)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:144)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:5439)
	at org.eclipse.ui.internal.progress.ProgressManager.runInUI(ProgressManager.java:1001)
	at org.eclipse.sirius.ui.tools.internal.actions.session.OpenRepresentationsAction.run(OpenRepresentationsAction.java:85)
	at org.eclipse.sirius.ui.tools.internal.views.common.navigator.OpenRepresentationListener.doubleClick(OpenRepresentationListener.java:40)
	at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:831)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:44)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:173)
	at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:828)
	at org.eclipse.jface.viewers.AbstractTreeViewer.handleDoubleSelect(AbstractTreeViewer.java:1459)
	at org.eclipse.ui.navigator.CommonViewer.handleDoubleSelect(CommonViewer.java:445)
	at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1258)
	at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:249)
	at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:247)
	at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:306)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5252)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1348)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4522)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4107)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1044)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	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:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1472)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.draw2d.Cursors
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite$ButtonCanvas.init(FlyoutPaletteComposite.java:1214)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite$ButtonCanvas.<init>(FlyoutPaletteComposite.java:1180)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite.createFlyoutControlButton(FlyoutPaletteComposite.java:265)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite.access$4(FlyoutPaletteComposite.java:264)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite$Sash.<init>(FlyoutPaletteComposite.java:745)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite.createSash(FlyoutPaletteComposite.java:291)
	at org.eclipse.gef.ui.palette.FlyoutPaletteComposite.<init>(FlyoutPaletteComposite.java:197)
	at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette.createPartControl(DiagramEditorWithFlyOutPalette.java:327)
	at org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor.createPartControl(DiagramDocumentEditor.java:1514)
	at org.eclipse.sirius.diagram.ui.tools.internal.editor.DDiagramEditorImpl.createPartControl(DDiagramEditorImpl.java:549)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.createPartControl(CompatibilityPart.java:151)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPartControl(CompatibilityEditor.java:99)
	at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:355)
	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:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:990)
	at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:955)
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	... 105 more
==================================================================

Note that I had reported an issue against UML Designer ( https://github.com/ObeoNetwork/UML-Designer/issues/975 ), but it turns out that the problem occurs in any recent Eclipse Modeling with Sirius installed, so the problem is definitely bigger than just UML Designer.


Note that the problem does _not_ occur on some other eclipse installation (see next attachment working-eclipse.txt for the complete configuration)
Comment 1 Erwan Bousse CLA 2017-11-21 05:34:22 EST
Created attachment 271570 [details]
Working Eclipse configuration (GEMOC Studio)
Comment 2 Erwan Bousse CLA 2017-11-21 05:40:17 EST
I have just tested with the latest Sirius nightly build (5.1.1.201711161001), and the problem unfortunately still occurs.
Comment 3 Pierre-Charles David CLA 2017-11-24 08:55:33 EST
Hi. It's deep enough below Sirius that it probably comes from somewhere else.

The initialization of org.eclipse.draw2d.Cursors which fails instanciates several org.eclipse.swt.graphics.Cursor, which includes toolkit-specific code. That smells suspiciously like an SWT/Gtk issue, in particular because one difference between your working and non-working configuration is that the working one uses Gtk2 (which is older, but much more stable with SWT), and the non-working one uses Gtk3 (SWT on Gtk3 has lots of bugs).

From the working configuration: org.eclipse.swt.internal.gtk.version=2.24.31
From the non-working one: org.eclipse.swt.internal.gtk.version=3.22.26

Can you try running the non-working version forcing the use of Gtk2 to see if this is indeed the issue? This can be done by setting the environment variable SWT_GTK3 to 0 for the Eclipse install, or directly in the eclipse.ini by adding:

--launcher.GTK_version
2

(this should be added before the --launcher.appendVmargs line).
Comment 4 Pierre-Charles David CLA 2017-11-24 09:00:09 EST
Note that a very similar stack can be seen at https://pastebin.com/B4FwKjtM (thanks Google!), where it appears in Papyrus. Definitly not something Sirius-specific.
Comment 5 Pierre-Charles David CLA 2017-11-25 05:15:05 EST
I can actually reproduce it under Ubuntu 17.10, using Oxygen.1a as platform, when enabling Gtk3 (org.eclipse.swt.internal.gtk.version=3.22.25). 

When forcing the use of Gtk2, the problem goes away (org.eclipse.swt.internal.gtk.version=2.24.31 in my case, the same version as in the working "GEMOC" configuration).
Comment 6 Erwan Bousse CLA 2017-11-27 04:51:52 EST
I can confirm that enforcing GTK 2 does solve the problem. Thanks for having a look at this issue!

Since this is not Sirius' fault, should I open an issue somewhere else regarding the problem with GTK3?
Comment 7 Pierre-Charles David CLA 2017-11-27 09:49:41 EST
In theory I guess it could be GEF, but it's more probably SWT itself.

Note that I can't reproduce it on my work machine, which is on a plain Debian 9 (stretch), using org.eclipse.swt.internal.gtk.version=3.22.11. My previous message where I mentioned I could reproduce it was on my personal PC which is using Ubuntu 17.10.

If could be caused by some change between Gtk 3.22.11 and 3.22.26, but one other possible explanation is X11 vs Wayland. On my work machine (where it works), I'm using plain old X11, but Ubuntu 17.10 defaults to Wayland, and I believe Fedora 27 does too.

Is the buggy configuration running under Wayland or X11? Apparently the following command is the best way to know:

  loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type
Comment 8 Erwan Bousse CLA 2017-12-07 07:26:50 EST
I am running wayland at the moment, maybe I can try on X11 as well in the next days.
Comment 9 Pierre-Charles David CLA 2018-02-12 06:58:15 EST
Created attachment 272643 [details]
Sample program to try to reproduce the issue

I tried creating a small program isolating the code that seems to cause problems, but I don't have easy access to a Wayland-based system at the moment so can not reproduce the failure. Not sure if the program is "correct", i.e. would really trigger the failure under a real Wayland display.
Comment 10 Erwan Bousse CLA 2018-05-08 04:33:37 EDT
Since I encountered the problem again, I've finally run some more tests using your small program. 

Here are the results:

- X11 + GTK2: OK
- X11 + GTK3: OK
- Wayland + GTK2: OK
- Wayland + GTK3: Problem

Here is the log that I obtain when your program crashes in the last case:

Gdk-Message: 10:25:58.422: Unable to load sizing from the cursor theme
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.SWT.error(Unknown Source)
	at org.eclipse.swt.graphics.Cursor.<init>(Unknown Source)
	at bugzilla527545.Main.main(Main.java:119)

So you were right: the problem does only occur when GTK3 is combined with a Wayland session, for some reason!
Comment 11 Erwan Bousse CLA 2018-05-08 04:51:40 EDT
Created attachment 273960 [details]
The eclipse configuration used for running the wayland/x11 tests

These tests were made using Fedora 28 with Gtk3 3.22.30, and with the attached Eclipse configuration.
Comment 12 Pierre-Charles David CLA 2018-05-08 05:11:38 EDT
Thank you for investigating further. I'll try to isolate a small reproduction scenario (which does not involve installing/running Sirius) before moving this to Platform/SWT, but probably not this week.
Comment 13 Leonard Janis Robert König CLA 2020-08-09 08:27:25 EDT
This should probably be moved to
https://bugs.eclipse.org/bugs/buglist.cgi?component=SWT&list_id=19838961&product=Platform&resolution=---

The attachment https://bugs.eclipse.org/bugs/attachment.cgi?id=272643 still reproduces the bug w/o depending on Sirius.  I could also confirm this being only an issue with GDK_BACKEND=wayland and STW_GTK3=1, if the backend is forced to x11 or GTK2 the issue does not occur.

Another program having this issue is https://sourceforge.net/p/tuxguitar/