]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
runtime: add special handling for signal 34
authorA. Wilcox <AWilcox@Wilcox-Tech.com>
Sun, 30 Aug 2020 15:30:07 +0000 (17:30 +0200)
committerIan Lance Taylor <iant@golang.org>
Mon, 18 Apr 2022 22:16:35 +0000 (15:16 -0700)
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

gcc/go/gofrontend/MERGE
libgo/go/runtime/signal_gccgo.go
libgo/mksigtab.sh

index bcb526c85b91444cee253e5496b0ae748250f816..eeff61d82f8fec10c08f4f8f0bca25ca670ed5e0 100644 (file)
@@ -1,4 +1,4 @@
-62fc90f52da2f52cbe3b4f10e560dc6aa59baeb5
+8336fe4a5da68d9188dfbc4fb647ccbbe4d60ba4
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 2eece687e35bebb95b454c66ee60213bae0a7a73..82e6996ab7e30b7de9dbe1e346a1aec9da41643a 100644 (file)
@@ -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")
index 11e4ec436bd893202ebca4c685d41b9ea50b1ce8..cdf6fcd823fbc8a3cf33c3d2d21bebdc580ec513 100644 (file)
@@ -95,10 +95,12 @@ checksig _SIGLOST '   {_SigNotify, "SIGLOST: resource lost (Sun); server died (G
 
 # Special handling of signals 32 and 33 on GNU/Linux systems,
 # because they are special to glibc.
+# Signal 34 is additionally special to Linux systems with musl.
 if test "${GOOS}" = "linux"; then
-    SIGLIST=$SIGLIST"_32__33_"
+    SIGLIST=$SIGLIST"_32__33__34_"
     echo '     32: {_SigSetStack + _SigUnblock, "signal 32"}, /* SIGCANCEL; see issue 6997 */'
     echo '     33: {_SigSetStack + _SigUnblock, "signal 33"}, /* SIGSETXID; see issues 3871, 9400, 12498 */'
+    echo '     34: {_SigSetStack + _SigUnblock, "signal 34"}, /* musl SIGSYNCCALL; see issue 39343 */'
 fi
 
 if test "${GOOS}" = "aix"; then