From 2aa9514a06a5e34894e606d508ac2df53b082c74 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Wed, 11 Mar 2020 09:49:06 -0700 Subject: runsc: don't redirect SIGURG which is used by Go's runtime scheduler Go 1.14+ sends SIGURG to Ms to attempt asynchronous preemption of a G. Since it can't guarantee that a SIGURG is only related to preemption, it continues to forward them to signal.Notify (see runtime.sighandler). When runsc is running a container, there are three processes: a parent process and two children (sandbox and gopher). A parent process sets a signal handler for all signals and redirect them to the container init process. This logic should ignore SIGURG signals. We already ignore them in the Sentry, but it will be better to not notify about them when this is possible. PiperOrigin-RevId: 300345286 --- pkg/sentry/sighandling/sighandling.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkg/sentry') diff --git a/pkg/sentry/sighandling/sighandling.go b/pkg/sentry/sighandling/sighandling.go index ba1f9043d..959ef7217 100644 --- a/pkg/sentry/sighandling/sighandling.go +++ b/pkg/sentry/sighandling/sighandling.go @@ -83,6 +83,10 @@ func StartSignalForwarding(handler func(linux.Signal)) func() { // for their handling. var sigchans []chan os.Signal for sig := 1; sig <= numSignals+1; sig++ { + // SIGURG is used by Go's runtime scheduler. + if sig == int(linux.SIGURG) { + continue + } sigchan := make(chan os.Signal, 1) sigchans = append(sigchans, sigchan) signal.Notify(sigchan, syscall.Signal(sig)) -- cgit v1.2.3