fix(desktop): re-apply SA_ONSTACK to survive WebKitGTK JSC signal handler clobbering#351
Merged
Conversation
…untime Wails 2.11.0 installed SA_ONSTACK on signal handlers before gtk_init, which let WebKit's later signal install (without SA_ONSTACK) clobber it. Bump to Wails 2.12.0, which defers the fix to g_idle_add after gtk_init, AND add a linux-only background ticker that re-applies SA_ONSTACK on SIGSEGV/SIGBUS/etc. JavaScriptCore installs its GC/Wasm trap handlers lazily on first JS context creation — which can land after the one-shot idle pass — so a periodic re-fix is needed to be reliable on Ubuntu 24.04+ / libwebkit2gtk-4.1. Verified: nebi-desktop now boots, serves the embedded API for 30+ seconds of clicking around, and exits cleanly on window close.
Reference upstream Wails fix wailsapp/wails#5507 (closes wails#5506) so a future maintainer knows this Go-side ticker can be deleted once the Wails release containing that PR lands and we've bumped to it. Also add SIGUSR1 (JSC GC thread sync) to the fix list, matching the additional signal that the upstream PR fixes.
✅ Deploy Preview for nebi-docs canceled.
|
viniciusdc
approved these changes
May 26, 2026
viniciusdc
left a comment
Contributor
There was a problem hiding this comment.
Nice work, looked at the change good catch. I just ask to open a follow up issue after this gets merged so that we have a tracking issue open on our side as well to remove this once that PR lands.
3 tasks
aktech
pushed a commit
that referenced
this pull request
Jun 1, 2026
Build-only CI doesn't exercise runtime initialization, so issues like the WebKitGTK/JSC signal-handler SIGSEGV from #350/#351 — which only trips once the JS context lazy-inits — slip through. Add a post-build step on each OS that launches the artifact, waits 10s, and fails if it exited or crashed within that window: - Linux: xvfb-run + timeout, expect exit 124 (timed out still-running) - macOS: open Nebi.app, pgrep -x Nebi - Windows: Start-Process -PassThru, check HasExited Runs before release upload so a regression also gates v* tag releases. Adds xvfb to the Linux apt deps.
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 #350.
WebKitGTK's JavaScriptCore installs SIGSEGV/SIGBUS/SIGUSR1 handlers (for
GC thread suspension, write barriers, Wasm trap handling) without
SA_ONSTACK, which Go's runtime refuses to tolerate. Wails 2.12.0 added
a one-shot mitigation but JSC installs its handlers lazily on first JS
context creation — usually after that one-shot fix has already run.
This PR:
wails/v2from 2.11.0 → 2.12.0signal_fix_linux.go: a 50ms cgo ticker that re-applies SA_ONSTACK,doing explicitly what Go's runtime was doing accidentally via OS-thread
sigactioncalls (see issue [BUG] - nebi-desktop crashes on Linux/WebKitGTK (SA_ONSTACK fatal) since v0.10.5 #350 for the bisect that uncovered this)Verified on Ubuntu 26.04 LTS + libwebkit2gtk-4.1 v2.52.3.
Suggested follow-up: release after merge
The broken 0.10.5 and 0.11 linux-64 builds are being marked broken on
conda-forge via conda-forge/admin-requests#2104.
Once that lands,
pixi global install nebion linux-64 will resolve to0.10.4 (the last known-good release). Once this fix PR is merged we
should cut a new release (suggest 0.11.1 or 0.12) so linux-64
users get a current
nebi-desktopback rather than being pinned to0.10.4 indefinitely.
Removal of the workaround
Once wailsapp/wails#5507
ships in a tagged Wails release and we bump to it,
signal_fix_linux.gocan be deleted (the comment in that file documents this).