1
0
mirror of https://github.com/golang/go synced 2024-11-07 00:16:10 -07:00
go/misc/cgo
Bryan C. Mills 3c4c10ea8c misc/cgo: fix aliasing bugs in parallel tests that append to shared slices
These tests use a slice to represent the base C compiler command (with
flags). Appending to that slice can cause subtle aliasing bugs, such
as commands that silently corrupt the arguments of other concurrent
commands in parallel tests.

In this change, we explicitly reduce the capacity of the command slice
to force appends to it to always allocate unique new slices.

Fixes #49693

Change-Id: Ide466bf65f12cb6cead3dcba69f513cccb60a160
Reviewed-on: https://go-review.googlesource.com/c/go/+/383754
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-07 17:51:57 +00:00
..
errors misc/cgo: fix aliasing bugs in parallel tests that append to shared slices 2022-02-07 17:51:57 +00:00
fortran
gmp all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
life all: update references to symbols moved from io/ioutil to io 2021-04-05 17:51:15 +00:00
nocgo
stdio all: update references to symbols moved from io/ioutil to io 2021-04-05 17:51:15 +00:00
test misc/cgo/test: disable unhelpful GCC warning 2022-02-03 22:55:24 +00:00
testasan
testcarchive misc/cgo: fix aliasing bugs in parallel tests that append to shared slices 2022-02-07 17:51:57 +00:00
testcshared misc/cgo: fix aliasing bugs in parallel tests that append to shared slices 2022-02-07 17:51:57 +00:00
testgodefs cmd/cgo: for godefs, don't let field prefix removal cause duplicates 2021-09-16 23:56:28 +00:00
testplugin cmd/link: force eager binding when using plugins on darwin 2021-12-17 16:05:31 +00:00
testsanitizers src/runtime: mark asanread and asanwrite functions as NOSPLIT 2022-01-05 09:50:29 +00:00
testshared misc/cgo/testshared: increase size limit in size check 2021-12-15 20:19:05 +00:00
testsigfwd
testso all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
testsovar all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00
testtls all: gofmt more (but vendor, testdata, and top-level test directories) 2021-08-13 20:45:17 +00:00