From 208b7d85d73cbd166e207f0e062cccbdfbf52bb3 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sun, 30 Aug 2020 17:30:07 +0200 Subject: runtime: add special handling for signal 34 The musl libc uses signal 34 internally for setgid (similar to how glibc uses signal 32 and signal 33). For this reason, special handling is needed for this signal in the runtime. The gc implementation already handles the signal accordingly. As such, this commit intends to simply copy the behavior of the Google Go implementation to libgo. See https://go.dev/issues/39343 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/400594 --- libgo/go/runtime/signal_gccgo.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libgo/go') diff --git a/libgo/go/runtime/signal_gccgo.go b/libgo/go/runtime/signal_gccgo.go index 2eece68..82e6996 100644 --- a/libgo/go/runtime/signal_gccgo.go +++ b/libgo/go/runtime/signal_gccgo.go @@ -106,7 +106,8 @@ func getsig(i uint32) uintptr { if sigaction(i, nil, &sa) < 0 { // On GNU/Linux glibc rejects attempts to call // sigaction with signal 32 (SIGCANCEL) or 33 (SIGSETXID). - if GOOS == "linux" && (i == 32 || i == 33) { + // On musl signal 34 (SIGSYNCCALL) also needs to be treated accordingly. + if GOOS == "linux" && (i == 32 || i == 33 || i == 34) { return _SIG_DFL } throw("sigaction read failure") -- cgit v1.1