Skip to content

xed 3.8.9 hangs at startup when GTK4 is installed: Python plugins load Gtk-4.0 typelib into a GTK3 process #757

Description

@slawern

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

  1. Install GTK4 alongside GTK3. GTK4 does not need to be used by anything — its presence alone provides Gtk-4.0.typelib.
  2. Build/install xed with the libpeas Python 3 loader enabled.
  3. 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

Activity

  1. leigh123linux commented on Sep 12, 2026

    @leigh123linux
    Member

    The issue doesn't reproduce.

    leigh@mpd-pc:~/Desktop$ rpm -q xed gtk3 gtk4 python3 python3-gobject libpeas1-loader-python3 gtksourceview4 |sort
    gtk3-3.24.52-2.fc44.x86_64
    gtk4-4.22.4-2.fc44.x86_64
    gtksourceview4-4.8.4-11.fc44.x86_64
    libpeas1-loader-python3-1.36.0-13.fc44.x86_64
    python3-3.14.7-1.fc44.x86_64
    python3-gobject-3.56.3-1.fc44.x86_64
    xed-3.8.9-4.fc44.x86_64
    leigh@mpd-pc:~/Desktop$ xed
    leigh@mpd-pc:~/Desktop$ 
    

    https://src.fedoraproject.org/rpms/libpeas1/c/247a876ce08dc8cc7f56111ffd7fc8a9acefd4a8?branch=rawhide

    Maybe gentoo has broken libpeas or PyGObject

  2. slawern commented on Sep 12, 2026

    @slawern
    Author

    Would you mind running this one-liner on your box? It takes libpeas and xed out of the picture entirely — it's just PyGObject resolving the namespace:

    python3 -c "from gi.repository import Gtk; print(Gtk._version)"
    

    Here I get:

    <string>:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
    4.0
    

    Thanks for taking a look.

  3. leigh123linux commented on Sep 12, 2026

    @leigh123linux
    Member

    I get the same output

    $ python3 -c "from gi.repository import Gtk; print(Gtk._version)"
    <string>:1: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '4.0') before import to ensure that the right version gets loaded.
    4.0
    

    I have also tested libpeas-1.38.1, xed works fine.

    leigh@mpd-pc:~/Desktop/libpeas1/totem (rawhide)$ rpm -q xed gtk3 gtk4 python3 python3-gobject libpeas1-loader-python3 gtksourceview4 |sort
    gtk3-3.24.52-2.fc44.x86_64
    gtk4-4.22.5-2.fc44.x86_64
    gtksourceview4-4.8.4-11.fc44.x86_64
    libpeas1-loader-python3-1.38.1-1.fc44.x86_64
    python3-3.14.7-1.fc44.x86_64
    python3-gobject-3.56.3-1.fc44.x86_64
    xed-3.8.9-5.fc44.x86_64
    leigh@mpd-pc:~/Desktop/libpeas1/totem (rawhide)$ xed
    leigh@mpd-pc:~/Desktop/libpeas1/totem (rawhide)$ 
    
    
    leigh@mpd-pc:~/Desktop/libpeas1/totem (rawhide)$ ldd /bin/xed |grep peas
    	libpeas-1.0.so.1 => /lib64/libpeas-1.0.so.1 (0x00007fe5a668a000)
    	libpeas-gtk-1.0.so.1 => /lib64/libpeas-gtk-1.0.so.1 (0x00007fe5a7141000)
    
  4. leigh123linux commented on Sep 12, 2026

    @leigh123linux
    Member

    Maybe this is failing for some reason

    13f55ff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions