Fix "application exiting with {Code:0 Signo:27}" during boot.

2aa9514a06 skips SIGURG, but later code expects
the sigchans array contains consecutive signal numbers.

PiperOrigin-RevId: 300793450
This commit is contained in:
Ting-Yu Wang
2020-03-13 11:26:45 -07:00
committed by gVisor bot
parent 28d26d2c4f
commit f458a325e9
+3 -2
View File
@@ -83,12 +83,13 @@ func StartSignalForwarding(handler func(linux.Signal)) func() {
// for their handling.
var sigchans []chan os.Signal
for sig := 1; sig <= numSignals+1; sig++ {
sigchan := make(chan os.Signal, 1)
sigchans = append(sigchans, sigchan)
// 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))
}
// Start up our listener.