{"record":{"id":"21eba245b4a053cf","repo":"wailsapp/wails","slug":"error-fixing-handler-for-signal-d-please-report-21eba2","errorCode":null,"errorMessage":"error fixing handler for signal %d, please report this issue to https://github.com/wailsapp/wails: %s\\n","messagePattern":"error fixing handler for signal (.+?), please report this issue to https://github\\.com/wailsapp/wails: (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"v3/pkg/application/linux_cgo.c","lineNumber":83,"sourceCode":"}\n\n// ============================================================================\n// Signal handling\n// ============================================================================\n\nstatic void fix_signal(int signum) {\n    struct sigaction st;\n\n    if (sigaction(signum, NULL, &st) < 0) {\n        goto fix_signal_error;\n    }\n    st.sa_flags |= SA_ONSTACK;\n    if (sigaction(signum, &st, NULL) < 0) {\n        goto fix_signal_error;\n    }\n    return;\nfix_signal_error:\n    fprintf(stderr, \"error fixing handler for signal %d, please \"\n            \"report this issue to \"\n            \"https://github.com/wailsapp/wails: %s\\n\",\n            signum, strerror(errno));\n}\n\nvoid install_signal_handlers(void) {\n#if defined(SIGCHLD)\n    fix_signal(SIGCHLD);\n#endif\n#if defined(SIGHUP)\n    fix_signal(SIGHUP);\n#endif\n#if defined(SIGINT)\n    fix_signal(SIGINT);\n#endif\n#if defined(SIGQUIT)\n    fix_signal(SIGQUIT);\n#endif","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/wailsapp/wails/blob/0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3/v3/pkg/application/linux_cgo.c#L65-L101","documentation":"The canonical copy of fix_signal in v3/pkg/application/linux_cgo.c, used by the default GTK4/WebKitGTK build: it adds SA_ONSTACK to inherited handlers (SIGCHLD, SIGHUP, SIGINT, SIGTERM, etc.) so that GTK/C code receiving a signal does not run on Go's growable stack, which would corrupt the runtime. The stderr message reports a sigaction failure with errno; execution proceeds, but that signal's handler runs on the normal stack, risking runtime corruption if it fires.","triggerScenarios":"sigaction failing under seccomp-restricted containers (EPERM) or with an invalid signal number (EINVAL); a supervisor having set SA_RESTORER/flags combos the kernel rejects on rewrite; unusual libc/kernel pairings in minimal images.","commonSituations":"v3 GTK4 apps in hardened Docker images; Flatpak/sandbox environments; NixOS with nonstandard glibc; message seen at startup alongside otherwise normal operation.","solutions":["Relax the container/sandbox policy so sigaction succeeds (e.g. default Docker seccomp allows it; custom profiles may not)","Verify the warning disappears with the app run outside the sandbox to confirm the environment as cause","If it persists outside sandboxes, collect signal number + errno and file an issue at https://github.com/wailsapp/wails","Monitor for real signal-delivery problems (hangs on SIGCHLD from child processes) since alternate-stack handling is what was lost"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use a seccomp profile that allows sigaction for GUI apps","Watch for follow-on symptoms (child-process SIGCHLD handling) since alternate-stack delivery is lost","File an issue at https://github.com/wailsapp/wails with the exact signal number and errno if it recurs in normal environments"],"tags":["linux","signals","gtk4","cgo","sandbox"],"backgroundTag":null,"analyzedSha":"0e754b1b40ba9044c2a1460e23b7c3de20fc5cf3","analyzedAt":"2026-08-15T14:17:36.034Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}