From 65701ad2b430466dd4bd6e1df107f81c0f8ee9cb Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Mon, 23 May 2022 20:20:07 -0400 Subject: [release-branch.go1.17] misc/cgo/testsanitizers: use buffered channel in tsan12.go os/signal.Notify requires that "the caller must ensure that c has sufficient buffer space to keep up with the expected signal rate" as it does a nonblocking send when it receives a signal. The test currently using a unbuffered channel, which means it may miss the signal if the signal arrives before the channel receive operation. Fixes #53042. Updates #52998. Change-Id: Icdcab9396d735506480ef880fb45a4669fa7cc8f Reviewed-on: https://go-review.googlesource.com/c/go/+/407888 Reviewed-by: Ian Lance Taylor Reviewed-by: Bryan Mills Run-TryBot: Cherry Mui Reviewed-by: Cuong Manh Le TryBot-Result: Gopher Robot (cherry picked from commit 62e130226767a088ace196da90a774c9a9d14689) Reviewed-on: https://go-review.googlesource.com/c/go/+/408115 --- misc/cgo/testsanitizers/testdata/tsan12.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/misc/cgo/testsanitizers/testdata/tsan12.go b/misc/cgo/testsanitizers/testdata/tsan12.go index 3e767eee1f..0ef545d09b 100644 --- a/misc/cgo/testsanitizers/testdata/tsan12.go +++ b/misc/cgo/testsanitizers/testdata/tsan12.go @@ -22,7 +22,7 @@ import ( import "C" func main() { - ch := make(chan os.Signal) + ch := make(chan os.Signal, 1) signal.Notify(ch, syscall.SIGUSR1) if err := exec.Command("true").Run(); err != nil { -- cgit v1.2.3-54-g00ecf