Skip to content

fix(linux): Ctrl crash on newer distros and endless respawn with Python 3.14 (#179) - #180

Merged
noah-peeters merged 4 commits into
masterfrom
fix/appimage-system-libs
Oct 23, 2026
Merged

noah-peeters merged 4 commits into
masterfrom
fix/appimage-system-libs

Conversation

@noah-peeters

Copy link
Copy Markdown
Owner

Fixes #179. It covers both problems reported there.

1. Segfault on Ctrl/Alt on Ubuntu 26.04 (and Fedora 44, Arch)

PyInstaller bundled the build runner's (ubuntu-24.04) GLib, GTK3, X11 and libstdc++ into the AppImage. At runtime the user's own GVfs, GTK and Mesa plugins get loaded into the app. On newer distros those plugins need newer libs than the bundled ones. On Ubuntu 26.04, the first Ctrl press loads GVfs against the bundled GLib 2.80 and crashes with undefined symbol: g_variant_builder_init_static.

  • chimpstackr.spec: on Linux, drop those build-host libs from the bundle so the system's copies are used. The list is the bundled libs that the system's GIO/GVfs/GTK/Mesa plugins depend on. Libs that wheels vendor (hashed names) stay bundled. libgthread and libbz2 also stay, because openSUSE and Fedora don't provide them under the same name.
  • build.yml: fail the Linux build if GLib, GTK or libstdc++ get bundled again.

2. A local build keeps opening new windows forever (Python 3.14)

On Python 3.14 the default multiprocessing start method on Linux is forkserver. Because of that, numba's parallel-backend lock makes multiprocessing start its resource tracker by running sys.executable. In a frozen app that executable is ChimpStackr itself, so a second app started, then a third, and so on. CI builds use Python 3.11 (start method fork), so release builds weren't affected, but builds made with scripts/build_linux.sh on 26.04 were.

  • src/run.py, src/cli.py: call multiprocessing.freeze_support() first thing.

Testing

Run in amd64 Docker containers on Xvfb. The app was started, sent Ctrl, Ctrl, Ctrl+Z, Ctrl+Y and Ctrl+O (file dialog), then Escape. There was also a CLI --align stack of tests/low_res_images and an ldd check of every bundled .so.

Distro v0.3.5 This PR (CI artifact)
Ubuntu 26.04 (Xfce, as reported) segfault on first Ctrl OK. System GLib 2.88, GTK and GVfs load
Ubuntu 24.04 OK OK
Debian 13 survives, but GVfs fails to load (undefined symbol) OK, GVfs loads
Fedora 44 segfault on first Ctrl OK*
Arch segfault on first Ctrl OK*
openSUSE Tumbleweed — OK

* Under heavy parallel load in Docker, GTK's glycin image loader sometimes picks its bwrap sandbox, which can't run in an unprivileged container, and GTK then aborts on the file dialog icon. With GLYCIN_DISABLE_SANDBOX=1 it passes every time. On a real desktop bwrap works, so this is expected to be a container artifact. It hasn't been tested on real Fedora or Arch hardware.

For the spawn bug, I built master and this branch with Python 3.14.4 and PyInstaller 6.22.3 on Ubuntu 26.04, the same way build_linux.sh does:

  • master: 27 processes and 78 windows after 75 s, still growing.
  • This branch: 1 app plus 1 resource tracker, steady. The tracker exits with the app.

Unit tests: 92 passed.

Not covered: real hardware, Wayland sessions.

🤖 Generated with Claude Code

noah-peeters and others added 4 commits October 23, 2026 14:42
…ld host's

The AppImage bundled GLib, GTK3, X11 and libstdc++ from the ubuntu-24.04
build runner. On newer distros the user's own GVfs/GTK/Mesa plugins are
loaded into the app and need newer versions, so on Ubuntu 26.04 the first
Ctrl press loaded GVfs against the old GLib and segfaulted
(undefined symbol g_variant_builder_init_static).

Drop those host libs from the PyInstaller bundle on Linux and fail the CI
build if they come back. Wheel-vendored libs (hashed names) stay bundled.

Fixes #179

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efault

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Python 3.14 the default start method on Linux is forkserver, so numba's
parallel backend lock makes multiprocessing start its resource tracker by
re-running sys.executable. In a PyInstaller build that is the app itself,
which opened another ChimpStackr, which did the same, endlessly (reported
in #179 for a build made with scripts/build_linux.sh on Ubuntu 26.04).

freeze_support() lets PyInstaller run the helper and exit instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noah-peeters
noah-peeters merged commit baf4bde into master Oct 23, 2026
10 checks passed
@noah-peeters
noah-peeters deleted the fix/appimage-system-libs branch October 23, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keyboard input crashes

1 participant