When the program below is run with the race detector enabled, it truncates the command-line arguments list at the "" argument. In particular, this prevents using a race-detector-enabled cmd/compile on ppc64le, because cmd/go typically passes -D "".
I only see this on linux/ppc64le. I'm not able to reproduce the issue on linux/amd64.
$ go run hi.go -- one two "" three four
["/tmp/go-build2867456842/b001/exe/hi" "--" "one" "two" "" "three" "four"]
["one" "two" "" "three" "four"]
$ go run -race hi.go -- one two "" three four
["/tmp/go-build2206806436/b001/exe/hi" "--" "one" "two"]
The race detector on ppc64le corrupts command-line arguments lists if
they contain an empty string, and cmd/go often generates compiler
argument lists containing `-D ""`. Since this is equivalent to not
specifying the `-D` flag at all, just do that. This allows using a
race-detector-enabled cmd/compile on ppc64le.
Trust: Matthew Dempsky <email@example.com>
Run-TryBot: Matthew Dempsky <firstname.lastname@example.org>
Reviewed-by: Bryan C. Mills <email@example.com>
Reviewed-by: Jay Conrod <firstname.lastname@example.org>
TryBot-Result: Go Bot <email@example.com>
Just a guess: on some architectures, TSAN may re-exec the program (e.g. with ASLR disabled because it wants a specific memory layout). That re-exec might eat args. Maybe you could strace it to see if it re-exec? What is the output of ulimit -a on the machine?