]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: ignore signal 33 == SIGSETXID on GNU/Linux
authorIan Lance Taylor <iant@golang.org>
Fri, 27 Jul 2012 05:46:20 +0000 (22:46 -0700)
committerIan Lance Taylor <iant@golang.org>
Fri, 27 Jul 2012 05:46:20 +0000 (22:46 -0700)
When a cgo program calls setuid, setgid, etc., the GNU/Linux
pthread library sends signal SIGSETXID to each thread to tell
it to update its UID info.  If Go is permitted to intercept
the default SIGSETXID signal handler, the program will hang.

This patch tells the runtime package to not try to intercept
SIGSETXID on GNU/Linux.  This will be odd if a Go program
wants to try to use that signal, but it means that cgo
programs that call setuid, etc., won't hang.

Fixes #3871.

R=rsc, r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/6455050

src/pkg/runtime/signals_linux.h

index 345a6c5d11cc05d734b8316261a4fb0874146092..9c356700759fae5cc88830ae73fe1ef1e29625f1 100644 (file)
@@ -42,7 +42,7 @@ SigTab runtimeĀ·sigtab[] = {
        /* 30 */        N, "SIGPWR: power failure restart",
        /* 31 */        N, "SIGSYS: bad system call",
        /* 32 */        N, "signal 32",
-       /* 33 */        N, "signal 33",
+       /* 33 */        0, "signal 33", /* SIGSETXID; see issue 3871 */
        /* 34 */        N, "signal 34",
        /* 35 */        N, "signal 35",
        /* 36 */        N, "signal 36",