linuxmint / linuxmint/xed

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

Open
#757 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
551
Forks
115
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating xed's bundled Python plugins and the imports of gi.repository.Gtk, Gdk, and GtkSource; the issue identifies these imports as the startup path involved. Reproduce with GTK3 and GTK4 installed and the libpeas Python 3 loader enabled. Done means xed starts normally without hanging and the Python plugins load without bringing GTK4 into the GTK3 process.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.