New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: go test -S repeated symbols for darwin #20976
Comments
I can't reproduce the issue on my darwin machine,
Note: i'm not running the latest release of osx, so i'm also not running the latest version of xcdeo
This might be relevant. |
My system is running: $ system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: macOS 10.12.5 (16F73)
Kernel Version: Darwin 16.6.0 Maybe that's why? |
I'm running the same:
Output:
|
Do you have XCode installed, @bradleyfalzon? I do not: $ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin |
No, pretty vanilla workstation:
All output: https://gist.github.com/bradleyfalzon/3be20a61b0567d23e0d7dd027a4ea512 |
Well ... there has to be something different. What's your |
|
Have you installed go by downloading the installer?
|
I just installed Go from scratch using the pkg installer but I still can reproduce the issue. |
Yes, it's using https://storage.googleapis.com/golang/go1.8.3.darwin-amd64.pkg It's just that and your source code installed today. I had to create $GOPATH/{src,pkg,bin} myself. |
I can reproduce this, however I'm wondering about |
I meant this is not a bug. |
It seems like you are mistakenly writing the output two times, to the same file. First pass is interrupted after 2 functions and then there's a full disassembly written to the file. |
So, this is not a bug if the initial report is correct. EDIT: I am using zsh. It seems that |
Nice. My shell says "bash: out.text2: ambiguous redirect":
|
Are you really writing literally |
The desired effect comes from command >x 2>&1 in the one true shell. This modem noise burst says put stdout to x, and make 2 a dup of 1. But what you have written makes little sense to me beyond saying, "this is a mistake". |
After some extra investigation this is clearly a weird behavior on the zsh side. |
For those interested in more details, it seems A simple program that shows the behavior: package main
import (
"fmt"
"os"
)
func main() {
out := ""
for i := 0; i < 1000; i++ {
out += "stderr"
}
fmt.Fprintln(os.Stdout, "stdout")
fmt.Fprintln(os.Stderr, out)
} |
What did you do?
I ran the benchmark defined in this code with
-gcflags "-S"
in order to see the generated assembly.I ran the benchmark with the command:
The output contains the definition of
BenchmarkDiv
anddiv
twice, and their content differs.See full output here.
What did you expect to see?
I expected to see each symbol defined only once in the output.
What did you see instead?
Two slightly different definitions of the same functions
div
andBenchmarkDiv
.Does this issue reproduce with the latest release (go1.8.3)?
Yes, but only with darwin. Tried running the same with linux on Docker with
golang:1.8.3
and everything worked correctly.System details
The text was updated successfully, but these errors were encountered: