Open
Description
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"]
["one" "two"]
package main
import (
"flag"
"fmt"
"os"
)
func main() {
fmt.Printf("%q\n", os.Args)
flag.Parse()
fmt.Printf("%q\n", flag.Args())
}
/cc @dvyukov
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Triage Backlog