golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.83k stars 17.51k forks source link

runtime: TestGdbLoadRuntimeSupport fails on non intel platforms #9820

Open davecheney opened 9 years ago

davecheney commented 9 years ago

runtime.TestGdbLoadRuntimeSupport does not pass on linux/arm or linux/ppc64le. In both cases the error is the same

--- FAIL: TestGdbLoadRuntimeSupport (1.98s)
    runtime-gdb_test.go:59: warning: Missing auto-load scripts referenced in section .debug_gdb_scripts
        of file /tmp/go-build302202449/a.exe
        Use `info auto-load python-scripts [REGEXP]' to list them.
FAIL
FAIL    runtime 64.538s
davecheney commented 9 years ago

This is failing because in environments where $GOROOT is not deducible (golang.org/x/build/cmd/builder for example) we're substituting some default path.

From a working tree that one of my builders was building at the time:

[root@alarm bin]# readelf -x 20 /root/workspace/nacl-arm-cheney-e6fbce3596c1/go/bin/gofmt 

Hex dump of section '.debug_gdb_scripts':
  0x00000000 012f7573 722f6c6f 63616c2f 676f2f73 ./usr/local/go/s
  0x00000010 72632f72 756e7469 6d652f72 756e7469 rc/runtime/runti
  0x00000020 6d652d67 64622e70 7900              me-gdb.py.

If I had to guess, the linux builders which are passing have a copy of Go 1.4 in /usr/local/go and are using that for $GOBOOTSTRAP_ROOT

minux commented 9 years ago

Aha, that's because we set GOROOT_FINAL in builders.

bradfitz commented 9 years ago

No need to guess. Our builder environments are described with scripts to hermetically reproduce them. Just look in x/builder/env.

minux commented 9 years ago

Go 1.4's runtime-gdb.py is broken, so the reason why x86 builders are passing that test is definitely not because they are using Go 1.4 version of runtime-gdb.py.

Something else is happening that makes the runtime path correct despite the fact that we set GOROOT_FINAL.

(Or it is possible that only the old style builders set GOROOT_FINAL, and new style builders are not?)

davecheney commented 9 years ago

But why do we set it to /usr/local/go during a build that we know will be built in a working directory? On 10 Feb 2015 11:40, "Minux Ma" notifications@github.com wrote:

Aha, that's because we set GOROOT_FINAL in builders.

— Reply to this email directly or view it on GitHub https://github.com/golang/go/issues/9820#issuecomment-73622271.

minux commented 9 years ago

https://go.googlesource.com/build/+/master/cmd/builder/env.go#41

josharian commented 9 years ago

This is failing for me on OS X as well:

$ go test runtime -v -run=TestGdbLoadRuntimeSupport
=== RUN TestGdbLoadRuntimeSupport
--- FAIL: TestGdbLoadRuntimeSupport (0.25s)
    runtime-gdb_test.go:59: 
FAIL
exit status 1
FAIL    runtime 0.250s
rsc commented 9 years ago

I think we're not going to get to this for Go 1.5.