fix(linux): prevent appmenu GTK module startup stack overflow - #191
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.