-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix(linux): Add option to disable GTK signal handler fixup for Delve debugging (#4398) #4808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v3-alpha
Are you sure you want to change the base?
Conversation
## Summary I've fixed **GitHub Issue #4398: Debug config crashing on Linux**. ### Root Cause When debugging a Wails v3 application with Delve on Linux, the application crashes at breakpoints. This is caused by Wails' signal handler fixup code (`install_signal_handlers()` in `linux_cgo.go`) which adds the `SA_ONSTACK` flag to various signals. While this fixup is necessary for normal CGO/Go signal handling compatibility (as noted in [golang/go#18255](golang/go#18255)), it interferes with Delve's debugger which relies on specific signal handling behavior. ### The Fix Added a new option `LinuxOptions.DisableGTKSignalHandlerFixup` that allows users to disable the signal handler fixup when debugging: **Files changed:** 1. `v3/pkg/application/application_options.go` - Added `DisableGTKSignalHandlerFixup bool` to `LinuxOptions` 2. `v3/pkg/application/linux_cgo.go` - Modified `appNew()` to conditionally skip `install_signal_handlers()` 3. `v3/pkg/application/linux_purego.go` - Updated `appNew()` signature for API compatibility 4. `v3/pkg/application/application_linux.go` - Pass the new option to `appNew()` 5. `v3/UNRELEASED_CHANGELOG.md` - Added changelog entry ### Usage When debugging with Delve, users should set: ```go app := application.New(application.Options{ Linux: application.LinuxOptions{ DisableGTKSignalHandlerFixup: true, }, // ... other options }) ``` This can be conditionally enabled using build tags or environment variables to only affect debug builds.
All documentation has been added. Here's the complete set of changes: ### Code Changes (already committed in `a4fb64274`): 1. **`v3/pkg/application/application_options.go`** - Added `DisableGTKSignalHandlerFixup bool` to `LinuxOptions` 2. **`v3/pkg/application/linux_cgo.go`** - Modified `appNew()` to conditionally skip `install_signal_handlers()` 3. **`v3/pkg/application/linux_purego.go`** - Updated `appNew()` signature for API compatibility 4. **`v3/pkg/application/application_linux.go`** - Pass the new option to `appNew()` 5. **`v3/UNRELEASED_CHANGELOG.md`** - Added changelog entry ### Documentation Changes (staged, not yet committed): 1. **`website/docs/guides/linux.mdx`** - Added new "Debugging with Delve" section with: - Explanation of the problem - The solution (setting `DisableGTKSignalHandlerFixup: true`) - Build tags pattern for debug vs production builds - Important notes 2. **`website/docs/reference/options.mdx`** - Added documentation for the new `DisableGTKSignalHandlerFixup` option under Linux options Would you like me to commit the documentation changes?
|
Warning Rate limit exceeded@leaanthony has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 6 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis change introduces a new Linux debugging option Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|



Summary
Fixes #4398 - Debug config crashing on Linux when using Delve.
When debugging Wails v3 applications with Delve on Linux, the application crashes at breakpoints. This is caused by Wails' signal handler fixup code (
install_signal_handlers()) which adds theSA_ONSTACKflag to various signals (SIGSEGV,SIGBUS,SIGABRT, etc.). While this fixup is necessary for normal CGO/Go signal handling compatibility, it interferes with Delve's debugger.Changes
LinuxOptions.DisableGTKSignalHandlerFixupoption to conditionally skip signal handler fixupappNew()to accept the new option parameterUsage
Files Changed
v3/pkg/application/application_options.go- AddedDisableGTKSignalHandlerFixuptoLinuxOptionsv3/pkg/application/linux_cgo.go- Conditionally skipinstall_signal_handlers()v3/pkg/application/linux_purego.go- Updated function signature for API compatibilityv3/pkg/application/application_linux.go- Pass option toappNew()v3/UNRELEASED_CHANGELOG.md- Added changelog entrywebsite/docs/guides/linux.mdx- Added "Debugging with Delve" sectionwebsite/docs/reference/options.mdx- Added option documentationTest plan
DisableGTKSignalHandlerFixup: false(default) - verify normal operationDisableGTKSignalHandlerFixup: trueand debug with Delve - verify breakpoints work🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
New Features
DisableGTKSignalHandlerFixupthat allows developers to control GTK signal handler behavior during debugging sessions and development activities on Linux.Documentation
✏️ Tip: You can customize this high-level summary in your review settings.