signal: remove SIGURG from default-ignore list#2744
Open
badoriie wants to merge 1 commit into
Open
Conversation
Go 1.14+ uses SIGURG to implement asynchronous goroutine preemption (runtime/signal_unix.go). With SIGURG silently ignored, Go's runtime cannot preempt goroutines cooperatively, leading to a 'fatal: bad g in signal handler' crash on startup. Removing SIGURG from the default-ignore list lets it fall through to the default POSIX disposition (ignored for processes that haven't installed a handler), while allowing Go's runtime_sigInstall to register its own handler correctly.
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.
Problem
SIGURGis currently in iSH's default-ignore list inkernel/signal.c:Go 1.14+ uses
SIGURGto implement asynchronous goroutine preemption (runtime/signal_unix.go). When a Go program callssignal.Notifyor the runtime installs its ownSIGURGhandler viaruntime_sigInstall, iSH's default-ignore classification prevents proper handler registration.The result is a hard crash on startup:
The workaround is to set
GODEBUG=asyncpreemptoff=1before launch, which disables Go's async preemption entirely — a significant runtime regression.Fix
Remove
SIGURG_from the ignore list. Its POSIX default disposition is already "ignored" for processes that haven't installed a handler, so removing it from this list has no effect on programs that don't useSIGURG. It only allows programs like Go to successfully install their own handler.Impact
GODEBUG=asyncpreemptoff=1SIGURG