Skip to content

fix(linux): prevent appmenu GTK module startup stack overflow - #191

Merged
Lampese merged 1 commit into
Lampese:mainfrom
capaj:fix/176-linux-gtk-startup
Sep 30, 2026
Merged

Lampese merged 1 commit into
Lampese:mainfrom
capaj:fix/176-linux-gtk-startup

Conversation

@capaj

@capaj capaj commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #176.

Fix

Apply the reported appmenu-gtk-module workaround in the Linux main entry point, before Tauri/GTK initializes. Remove only that module from GTK_MODULES and GTK3_MODULES, preserving accessibility modules, unrelated entries, non-UTF-8 paths and GDK_BACKEND. Handle duplicate entries and library paths. Leave other platforms and native menu setup unchanged.

Environment mutation happens before application threads start; the filtering helper is pure. This disables the affected appmenu global-menu integration for the app and its child processes, not the desktop session. Explicit module loading through GTK settings or command-line options is outside this mitigation. The underlying upstream bug remains tauri-apps/muda#411.

Validation

Eight Rust unit tests and eight subprocess startup scenarios passed in GitHub Actions:
https://github.com/capaj/codex-switcher/actions/runs/35773558523

The startup tests compile the actual main.rs against an environment-reporting probe in place of Tauri and verify filtering happens before the library entry point. TypeScript syntax and git diff whitespace checks pass.

The full Tauri build and GUI startup on Ubuntu 26.04 GNOME/Wayland were not tested. Before release, verify launch and native/tray menus on the affected desktop.

Based directly on upstream main; independent of #190. No dependency or application-version changes.

Remove only appmenu-gtk-module entries from GTK_MODULES and GTK3_MODULES
at the Linux binary entry point, before Tauri initializes GTK. Preserve
accessibility modules, unrelated paths, non-UTF-8 values and the selected
GDK backend. Leave native menus and non-Linux startup unchanged.

Add pure Rust filtering tests and subprocess tests that compile the real
entry point against an environment probe, plus a dependency-free CI job.

Fixes Lampese#176
@Lampese Lampese added bug Something isn't working priority:P1 Address first: auth, data integrity, security, startup or release validation. area:linux Linux startup, native packages, AppImage and updater behavior. status:needs-review Maintainer review required; this label is not merge approval. status:needs-ci No check rollup is visible for the current PR head; validate before landing. labels Sep 30, 2026
@Lampese
Lampese merged commit cd4c02c into Lampese:main Sep 30, 2026
1 check passed
@Lampese Lampese removed status:needs-review Maintainer review required; this label is not merge approval. status:needs-ci No check rollup is visible for the current PR head; validate before landing. labels Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:linux Linux startup, native packages, AppImage and updater behavior. bug Something isn't working priority:P1 Address first: auth, data integrity, security, startup or release validation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.2.18 deb crashes on launch with stack overflow on Ubuntu 26.04 GNOME (appmenu-gtk-module + muda menu init)

2 participants