eclipse.platform.swt
eclipse.platform.swt copied to clipboard
SWT_GTK4=1 -> Eclipse start hangs in splash
According to @laeubi announcement, todays build should support GTK4
Tried if with SWT_GTK4=1 on latest Ubuntu and get hanging splash screen.
Log:
(java:40344): GLib-GObject-CRITICAL **: 07:03:49.805: cannot register existing type 'GdkEvent'
(java:40344): GLib-CRITICAL **: 07:03:49.805: g_once_init_leave: assertion 'result != 0' failed
(java:40344): GLib-GObject-CRITICAL **: 07:03:49.805: g_type_register_static: assertion 'parent_type > 0' failed
(java:40344): GLib-CRITICAL **: 07:03:49.805: g_once_init_leave: assertion 'result != 0' failed
@vogella please provide
- GTK Version
- OS + Version
- GLIBC Version
Eclipse SDK Version: 2025-03 (4.35) Build id: I20241127-1800 OS: Linux, v.6.8.0-49-generic, x86_64 / gtk 3.24.41 Java vendor: Ubuntu Java runtime version: 21.0.5+11-Ubuntu-1ubuntu124.04 Java version: 21.0.5
Hm; this says gtk 3.24.41...
@vogella Please note that SWT has been compiled with gtk 4 support but launcher isn't and this is most likely what fails for you. Use the launcher.jar and not executable for now (to uncover pending SWT problems).
Thanks @akurtakov, I interpreted the announcement email in the way that the executable should also work (as it mentioned Eclipse applications). Will retry with the JAR only.
You get the same issue with the splash screen when launching the IDE from within the SWT workspace. For whatever reason, SWT gets stuck in the gtk_init() method.
Bypassing the splash screen by either using the jar or -noSplash both work, except that the IDE then crashes while showing the workspace selection screen:
C [libswt-pi4-gtk-4968r2.so+0x414ca] Java_org_eclipse_swt_internal_gtk_OS_G_1OBJECT_1TYPE+0x0
j org.eclipse.swt.accessibility.AccessibleObject.sendEvent(ILjava/lang/Object;)V+1046
j org.eclipse.swt.accessibility.Accessible.sendEvent(ILjava/lang/Object;)V+17
j org.eclipse.jface.dialogs.TitleAreaDialog.updateMessage(Ljava/lang/String;)V+46
j org.eclipse.jface.dialogs.TitleAreaDialog.showMessage(Ljava/lang/String;Lorg/eclipse/swt/graphics/Image;Ljava/lang/String;)V+74
j org.eclipse.jface.dialogs.TitleAreaDialog.setMessage(Ljava/lang/String;I)V+98
j org.eclipse.jface.dialogs.TitleAreaDialog.setMessage(Ljava/lang/String;)V+3
j org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.createDialogArea(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+28
j org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+128
j org.eclipse.jface.window.Window.create()V+14
j org.eclipse.jface.dialogs.Dialog.create()V+1
j org.eclipse.jface.window.Window.open()I+23
Reason most likely being that the AccessibleObject hasn't been implemented for GTK4, so events are fired using a NULL handle.
https://github.com/eclipse-platform/eclipse.platform.swt/blob/cfa74b494291a25ec1b452ddfbddd92401ec0a43/bundles/org.eclipse.swt/Eclipse%20SWT%20Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java#L49-L51
Reason most likely being that the AccessibleObject hasn't been implemented for GTK4, so events are fired using a NULL handle.
@ptziegler do you think you can reproduce the problem in a standalone snippet?
@ptziegler do you think you can reproduce the problem in a standalone snippet?
That class isn't really trivial, so I'd first have to understand what exactly it does... but I suppose I can have a look.
Going back to the original problem of the Eclipse IDE getting stuck when calling gtk_init(): I think I figured out what's causing this problem...
In short: GTK3 and GTK4 must not be mixed! I'm almost certain that the native binaries of the Equinox launcher (which create the splash screen) are still compiled with GTK3. The GTK3 bindings are loaded when showing the splash screen, which then leads to a deadlock when loading the GTK4 bindings later on while starting the application.
Or to rephrase it: Until the Equinox launcher is migrated, the Eclipse IDE must be started with -noSplash when using SWT_GTK4=1
Reason most likely being that the AccessibleObject hasn't been implemented for GTK4, so events are fired using a NULL handle.
@ptziegler do you think you can reproduce the problem in a standalone snippet?
I've tried to reproduce the issue again, but without success. Perhaps there were local changes in my workspace that I overlooked? The IDE starts, albeit completely broken.
I created https://github.com/eclipse-equinox/equinox/issues/831
I consider this one done via https://github.com/eclipse-equinox/equinox/pull/1118 . Any problem one may still have - please open a dedicated issue so it can be investigated further.