Skip to content
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: 1.7Beta2 TestGoTestRaceInstallCgo fails on Darwin #16129

Closed
btracey opened this issue Jun 20, 2016 · 10 comments
Closed

cmd/go: 1.7Beta2 TestGoTestRaceInstallCgo fails on Darwin #16129

btracey opened this issue Jun 20, 2016 · 10 comments

Comments

@btracey
Copy link
Contributor

btracey commented Jun 20, 2016

I'm getting a similar error to #13214 but that issue has been marked fixed.

Trying to run all.bash on either tip or 1.7beta2. This continues to happen even after deleting $GOROOT/pkg

--- FAIL: TestGoTestRaceInstallCgo (2.37s)
    go_test.go:244: running testgo [tool -n cgo]
    go_test.go:259: standard output:
    go_test.go:260: /Users/brendan/gover/go/pkg/tool/darwin_amd64/cgo

    go_test.go:244: running testgo [test -race -i runtime/race]
    go_test.go:263: standard error:
    go_test.go:264: # runtime/race
        LLVM ERROR: Requested symbol index is out of range.
        collect2: fatal error: dsymutil returned 1 exit status
        compilation terminated.

    go_test.go:273: go [test -race -i runtime/race] failed unexpectedly: exit status 2
--- FAIL: TestCgoConsistentResults (0.59s)
    go_test.go:244: running testgo [build -o /var/folders/l6/mhj4qjrj4437b_lgfz9pm1rw0000gn/T/gotest539820656/cgotest1 cgotest]
    go_test.go:263: standard error:
    go_test.go:264: # cgotest
        LLVM ERROR: Requested symbol index is out of range.
        collect2: fatal error: dsymutil returned 1 exit status
        compilation terminated.

    go_test.go:273: go [build -o /var/folders/l6/mhj4qjrj4437b_lgfz9pm1rw0000gn/T/gotest539820656/cgotest1 cgotest] failed unexpectedly: exit status 2
FAIL
FAIL    cmd/go  36.867s
@btracey
Copy link
Contributor Author

btracey commented Jun 20, 2016

Huh. It happens on 1.6.2 as well which suggests it's something on my end, but I'm not sure what.

@ianlancetaylor
Copy link
Contributor

It looks like the problem is coming from the system dsymutil program. Did you update that recently?

Do cgo program works at all for you right now?

@ianlancetaylor ianlancetaylor added this to the Go1.7Maybe milestone Jun 20, 2016
@btracey
Copy link
Contributor Author

btracey commented Jun 23, 2016

Sorry for the delay. I can run cgo programs, specifically the tests pass in github.com/gonum/blas/cgo.

@btracey
Copy link
Contributor Author

btracey commented Jun 23, 2016

I don't think dysmutil has been modified. OSX reports the created/modified date as 3/12/16.

@btracey
Copy link
Contributor Author

btracey commented Jun 24, 2016

This error does actually cause problems: -race no longer works for me.

brendan:~/Documents/mygo/src/github.com/btracey/stackmc$ go test -race
# runtime/race
LLVM ERROR: Requested symbol index is out of range.
collect2: fatal error: dsymutil returned 1 exit status
compilation terminated.

I made sure I had the most updated version of xcode command line tools. I recompiled 1.4.3 (for $GOROOT_BOOTSTRAP), and now it at least gives some warnings. I get many errors of the form

ld: warning: object file (/Users/brendan/gover/goboot/go/pkg/obj/darwin_amd64/lib9.a(vseprint.o)) was built for newer OSX version (10.11) than being linked (10.6)

Deleting $GOROOT_BOOTSTRAP/pkg did not fix the problem.

There are a bunch of other websites that mention a similar problem with LLVM and the -mmacosx-version-min flag. I tried export GO_CCFLAGS=-mmacosx-version-min=10.11 before running make.bash in the go bootstrap version, but it did not fix the problem. I'm guessing that's the wrong flag to set, but I'm not sure which the right one is.

@btracey
Copy link
Contributor Author

btracey commented Jun 24, 2016

I tried on a different mac and the same problem didn't happen, so the specific problem is with my machine. However, on that machine when installing go1.4.3 I got TestCgoExternalThreadSIGPROF, which seems like a related error.

@ianlancetaylor
Copy link
Contributor

ianlancetaylor commented Jun 24, 2016

Do you have the same version of XCode installed on the machines that you tried?

@ianlancetaylor
Copy link
Contributor

You mention the GO_CCFLAGS environment variable, but the Go distribution does not support such a variable. You may be looking for CGO_LDFLAGS.

@btracey
Copy link
Contributor Author

btracey commented Jun 24, 2016

I was trying to find a way to pass -mmacosx-version-min to the c compiler when compiling go1.4.3. I don't think that's the purpose for CGO_LDFLAGS

@btracey btracey closed this as completed Jun 24, 2016
@btracey
Copy link
Contributor Author

btracey commented Jun 24, 2016

I see. I have something messed up with my environment variables. I had export CC=gcc-5 which is somehow interacting with clang poorly. Disabling that flag at least fixes the issue.

Sorry for the noise.

@golang golang locked and limited conversation to collaborators Jun 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants