-
Notifications
You must be signed in to change notification settings - Fork 18.6k
Open
Labels
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Milestone
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
NeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.compiler/runtimeIssues related to the Go compiler and/or runtime.Issues related to the Go compiler and/or runtime.
Type
Projects
Status
Triage Backlog