Description
On my system where both GTK3 and GTK4 are installed, xed hangs at startup and never shows a window. The process does not crash and produces no core dump.
It seems xed's bundled Python plugins import gi.repository.Gtk, Gdk and GtkSource without calling gi.require_version() for those namespaces. PyGObject then resolves each one to the highest available typelib — Gtk-4.0, Gdk-4.0 — and libgtk-4.so.1 is dlopen()ed into a process that already has libgtk-3.so.0 loaded.
Both libraries register GObject types under the same names. The second registration fails:
g_boxed_type_register_static: assertion 'g_type_from_name (name) == 0' failed
g_once_init_leave_pointer: assertion 'result != 0' failed
g_type_get_qdata: assertion 'node != NULL' failed
g_boxed_type_register_static() returns 0, so g_once_init_leave_pointer() aborts on its assertion before releasing the one-time initialization lock. Every subsequent g_once_init_enter() on that address blocks forever, which is the hang.
Steps to reproduce
- Install GTK4 alongside GTK3. GTK4 does not need to be used by anything — its presence alone provides
Gtk-4.0.typelib.
- Build/install xed with the libpeas Python 3 loader enabled.
- Run
xed from a terminal.
Expected behaviour
xed starts normally.
Actual behaviour
The three GLib assertion warnings above are printed, then the process hangs indefinitely. No window appears.
Evidence
Both GTK versions are mapped into the process:
$ xed & sleep 5; grep -E 'libgtk-(3|4)' /proc/$(pgrep -n xed)/maps | awk '{print $6}' | sort -u
/usr/lib64/libgtk-3.so.0.2420.32
/usr/lib64/libgtk-4.so.1.2000.4
Removing the libpeas Python loader makes xed start correctly:
$ mv /usr/lib64/libpeas-1.0/loaders/libpython3loader.so /usr/lib64/libpeas-1.0/loaders/libpython3loader.so.OFF
$ xed
(xed): libpeas-WARNING **: Failed to load module 'python3loader'
(xed): libpeas-WARNING **: Could not load plugin loader 'python3'
** (xed): WARNING **: Failed to load builtin plugin: Join Lines
** (xed): WARNING **: Failed to load builtin plugin: Text Size
** (xed): WARNING **: Failed to load builtin plugin: Open URI
xed then starts and works, minus the Python plugins.
Environment
- Gentoo Linux (systemd), Cinnamon on X11
- xed: 3.8.9
- GTK3:
libgtk-3.so.0.2420.32
- GTK4:
libgtk-4.so.1.2000.4
- libpeas: 1.38.1
- gtksourceview: 4 (
libgtksourceview-4.so.0.0.0)
- Python: 3.14
- PyGObject: 3.56.3
Description
On my system where both GTK3 and GTK4 are installed,
xedhangs at startup and never shows a window. The process does not crash and produces no core dump.It seems xed's bundled Python plugins import
gi.repository.Gtk,GdkandGtkSourcewithout callinggi.require_version()for those namespaces. PyGObject then resolves each one to the highest available typelib —Gtk-4.0,Gdk-4.0— andlibgtk-4.so.1is dlopen()ed into a process that already haslibgtk-3.so.0loaded.Both libraries register GObject types under the same names. The second registration fails:
g_boxed_type_register_static()returns 0, sog_once_init_leave_pointer()aborts on its assertion before releasing the one-time initialization lock. Every subsequentg_once_init_enter()on that address blocks forever, which is the hang.Steps to reproduce
Gtk-4.0.typelib.xedfrom a terminal.Expected behaviour
xed starts normally.
Actual behaviour
The three GLib assertion warnings above are printed, then the process hangs indefinitely. No window appears.
Evidence
Both GTK versions are mapped into the process:
Removing the libpeas Python loader makes xed start correctly:
xed then starts and works, minus the Python plugins.
Environment
libgtk-3.so.0.2420.32libgtk-4.so.1.2000.4libgtksourceview-4.so.0.0.0)