]> Cypherpunks.ru repositories - gostls13.git/commitdiff
misc/cgo/testsanitizers: buffer the signal channel in TestTSAN/tsan11
authorBryan C. Mills <bcmills@google.com>
Fri, 27 May 2022 15:42:59 +0000 (11:42 -0400)
committerGopher Robot <gobot@golang.org>
Fri, 27 May 2022 15:58:52 +0000 (15:58 +0000)
This fix is analogous to the one in CL 407888.

'go vet' catches the error, but it is not run on this file because the
file is (only) compiled when running testsanitizers/TestTSAN.

Fixes #53113.

Change-Id: I74f7b7390a9775ff00a06214c1019ba28846dd11
Reviewed-on: https://go-review.googlesource.com/c/go/+/409094
Auto-Submit: Bryan Mills <bcmills@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>

misc/cgo/testsanitizers/testdata/tsan11.go

index 70ac9c8ae2cf5ed8d480165c3a030ec8845a14fc..189e10f699797c33bbbe3b26d8b0d27a91dd9c98 100644 (file)
@@ -45,7 +45,7 @@ static void register_handler(int signo) {
 import "C"
 
 func main() {
-       ch := make(chan os.Signal)
+       ch := make(chan os.Signal, 1)
        signal.Notify(ch, syscall.SIGUSR2)
 
        C.register_handler(C.int(syscall.SIGUSR1))