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/vendor/github.com/google/pprof/internal/binutils: TestObjFile failure #26584

Open
OSS542 opened this issue Jul 25, 2018 · 7 comments
Open
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@OSS542
Copy link

OSS542 commented Jul 25, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10.3 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

bash-3.2$ ld --version
GNU ld (GNU Binutils) 2.22

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jhart/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/jhart/go"
GORACE=""
GOROOT="/home/jhart/temp/temp/go"
GOTMPDIR=""
GOTOOLDIR="/home/jhart/temp/temp/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build636359804=/tmp/go-build -gno-record-gcc-switches"

What did you do?

cd temp
tar xf go1.4-bootstrap-20171003.tar.gz
cd go/src
export CGO_ENABLED=0
su
cd /var
mkdir tmp
chmod go+w tmp
exit
./make.bash
### Installed Go for linux/amd64 in /home/jhart/temp/go
### Installed commands in /home/jhart/temp/go/bin
unset CGO_ENABLED
export GOROOT_BOOTSTRAP=/home/jhart/temp/go
cd ../../
mkdir temp
cd temp
git clone https://go.googlesource.com/go
cd go
git describe --tags # go1.11beta1-226-ge161b1e
git checkout go1.10.3
cd src
./all.bash

What did you expect to see?

All tests should have been passed successfully

What did you see instead?

ok      cmd/trace       0.028s                                                                                                                                                                                     
--- FAIL: TestObjFile (0.17s)                                                                                                                                                                                      
        binutils_test.go:237: SourceLine for main: expect [{main /tmp/hello.c 3}]; got [{main  0}]                                                                                                                 
FAIL                                                                                                                                                                                                               
FAIL    cmd/vendor/github.com/google/pprof/internal/binutils    0.371s                                                                                                                                             
@agnivade
Copy link
Contributor

/cc @ianlancetaylor

@ianlancetaylor ianlancetaylor changed the title "go" binutils test failure when building from source using "bootstrap go" cmd/vendor/github.com/google/pprof/internal/binutils: TestObjFile failure Jul 25, 2018
@ianlancetaylor ianlancetaylor added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 25, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jul 25, 2018
@ianlancetaylor
Copy link
Contributor

CC @rauls5382

@ianlancetaylor
Copy link
Contributor

ld 2.22 is surprisingly old; it was released in 2011. I wonder if that could be causing this somehow.

@davecheney
Copy link
Contributor

davecheney commented Jul 25, 2018 via email

@michaelw
Copy link

michaelw commented Aug 27, 2018

also hitting this with ld 2.22, compiled from go-1.9. I can provide more info if it would be helpful.

@michaelw
Copy link

michaelw commented Aug 27, 2018

Note that go 1.9.4 seems to pass this test (same everything else)

[200925]% go tool dist test -run cmd/vendor/github.com/google/pprof/internal/binutils
##### Testing packages.
ok      cmd/vendor/github.com/google/pprof/internal/binutils    0.002s

ALL TESTS PASSED (some were excluded)
[200926]% go version
go version go1.9.4 linux/amd64

... which is because the TestObjFile code was introduced later.

Also note that #23888 seems related.

NexediGitlab pushed a commit to SlapOS/slapos that referenced this issue Nov 5, 2018
When ld version is too old (Debian 7 comes with version 2.2 which is too
old), golang testsuite fail with:

binutils_test.go:237: SourceLine for main: expect [{main /tmp/hello.c 3}]; got [{main  0}]

see also golang/go#26584
NexediGitlab pushed a commit to SlapOS/slapos that referenced this issue Nov 9, 2018
When ld version is too old (Debian 7 comes with version 2.2 which is too
old), golang testsuite fail with:

binutils_test.go:237: SourceLine for main: expect [{main /tmp/hello.c 3}]; got [{main  0}]

see also golang/go#26584

We explicitly use gcc 8.2, but what we need is gcc > 5.5 because of
golang/go#24046
When 8.2 (or newer) becomes the default SlapOS gcc, there should be no
problem in dropping the explicit version and using ${gcc:location} here.
@ianlancetaylor
Copy link
Contributor

I think the right fix is to check the binutils version and skip the test for a sufficiently old version. But this change should be made in the upstream sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

5 participants