Skip to content

compile/arm64: go test fail for arm64 #37181

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

Closed
darmac opened this issue Feb 12, 2020 · 7 comments
Closed

compile/arm64: go test fail for arm64 #37181

darmac opened this issue Feb 12, 2020 · 7 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@darmac
Copy link

darmac commented Feb 12, 2020

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

[root@Estuary-CentOS8 src]# ../bin/go version
go version go1.13.7 linux/arm64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
[root@Estuary-CentOS8 src]# ../bin/go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/xiaojun/src/go/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/xiaojun/src/go/go/pkg/tool/linux_arm64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/xiaojun/src/go/go/src/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build284526559=/tmp/go-build -gno-record-gcc-switches"

What did you do?

prepare for bootstrap

cd /home/xiaojun/
wget https://dl.google.com/go/go1.8.7.linux-arm64.tar.gz
tar xvf go1.8.7.linux-arm64.tar.gz
export GO_BOOTSTRAP=/home/xiaojun/go

build go1.13.7 and runtest

git clone https://github.com/golang/go.git
cd go/src
git checkout go1.13.7
./all.bash

What did you expect to see?

It's expected the result:

ALL TESTS PASSED

What did you see instead?

##### ../misc/cgo/testshared
--- FAIL: TestTrivialExecutable (3.92s)
    shared_test.go:41: executing ../../bin/trivial (trivial executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestDivisionExecutable (0.95s)
    shared_test.go:41: executing ../../bin/division (division executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestCgoExecutable (1.72s)
    shared_test.go:41: executing ../../bin/execgo (cgo executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestGopathShlib (4.52s)
    shared_test.go:41: executing ../../bin/exe (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestTwoGopathShlibs (5.26s)
    shared_test.go:41: executing ../../bin/exe2 (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestThreeGopathShlibs (7.82s)
    shared_test.go:41: executing ../../bin/exe3 (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestABIChecking (4.47s)
    shared_test.go:885: exe failed, but without line "abi mismatch detected between the executable and lib"; got output:
--- FAIL: TestImplicitInclusion (2.22s)
    shared_test.go:41: executing ../../bin/implicitcmd (running executable linked against library that contains same package as it) failed signal: segmentation fault (core dumped):
--- FAIL: TestInterface (3.16s)
    shared_test.go:41: executing ../../bin/iface (running type/itab uniqueness tester) failed signal: segmentation fault (core dumped):
--- FAIL: TestGlobal (2.40s)
    shared_test.go:41: executing ../../bin/global (global executable) failed signal: segmentation fault (core dumped):
shared_test.go:72: executing go test -installsuffix=5577006791947779410 -linkshared -test.short sync/atomic failed exit status 1:
FAIL    misc/cgo/testshared     58.393s
FAIL
2020/02/11 15:25:25 Failed: exit status 1
2020/02/11 15:25:25 FAILED
@randall77
Copy link
Contributor

git clone https://github.com/golang/go.git

In which directory did you run this? If it was /home/xiaojun, then you just installed the two Go releases on top of each other. That's not going to work.
...but maybe not? I would be surprised that it got this far if that's what you did.

@erifan
Copy link

erifan commented Feb 12, 2020

I guess you want to build go1.13.7 with go1.8.7 ? I tried this process but all tests passed. In addition, you should set GOROOT_BOOTSTRAP instead of GO_BOOTSTRAP. You also need to set go1.8.7 as GOROOT and add it to PATH.

@randall77
Copy link
Contributor

I guess you want to build go1.13.7 with go1.8.7 ? I tried this process but all tests passed. In addition, you should set GOROOT_BOOTSTRAP instead of GO_BOOTSTRAP.

Right.

You also need to set go1.8.7 as GOROOT and add it to PATH.

That should not be necessary.

@darmac
Copy link
Author

darmac commented Feb 12, 2020

Yes, I want use go1.8.7 to compile go1.13.7.
I tried it again, my environment is like that:

go1.8.7: /home/xiaojun/go_bootstrap/go
go1.13.7: /home/xiaojun/src/go/go

with setting like that:

export GOROOT_BOOTSTRAP=/home/xiaojun/go_bootstrap/go
export GOROOT=/home/xiaojun/go_bootstrap/go
export PATH=$GOROOT/bin/:$PATH
cd /home/xiaojun/src/go/go/src
./all.bash

and still get the same error, the whole log is as below:

Last login: Wed Feb 12 10:55:20 2020 from 192.168.100.153
[root@Estuary-CentOS8 ~]# export GOROOT_BOOTSTRAP=/home/xiaojun/go_bootstrap/go
[root@Estuary-CentOS8 ~]# export GOROOT=/home/xiaojun/go_bootstrap/go
[root@Estuary-CentOS8 ~]# export PATH=$GOROOT/bin/:$PATH
[root@Estuary-CentOS8 ~]# cd /home/xiaojun/src/go/go/src
[root@Estuary-CentOS8 src]# ./all.bash
Building Go cmd/dist using /home/xiaojun/go_bootstrap/go.
Building Go toolchain1 using /home/xiaojun/go_bootstrap/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/arm64.

##### Testing packages.
ok      archive/tar     0.069s
ok      archive/zip     0.063s
ok      bufio   0.098s
ok      bytes   0.303s
ok      compress/bzip2  0.133s
ok      compress/flate  0.746s
ok      compress/gzip   0.021s
ok      compress/lzw    0.068s
ok      compress/zlib   0.081s
ok      container/heap  0.025s
ok      container/list  0.036s
ok      container/ring  0.017s
ok      context 1.037s
ok      crypto  0.021s
ok      crypto/aes      0.057s
ok      crypto/cipher   0.058s
ok      crypto/des      0.027s
ok      crypto/dsa      0.007s
ok      crypto/ecdsa    0.219s
ok      crypto/ed25519  0.081s
ok      crypto/elliptic 0.045s
ok      crypto/hmac     0.011s
ok      crypto/internal/subtle  0.012s
ok      crypto/md5      0.035s
ok      crypto/rand     0.058s
ok      crypto/rc4      0.060s
ok      crypto/rsa      0.105s
ok      crypto/sha1     0.016s
ok      crypto/sha256   0.009s
ok      crypto/sha512   0.012s
ok      crypto/subtle   0.025s
ok      crypto/tls      1.399s
ok      crypto/x509     0.654s
ok      database/sql    0.623s
ok      database/sql/driver     0.006s
ok      debug/dwarf     0.039s
ok      debug/elf       0.044s
ok      debug/gosym     0.021s
ok      debug/macho     0.015s
ok      debug/pe        0.026s
ok      debug/plan9obj  0.016s
ok      encoding/ascii85        0.015s
ok      encoding/asn1   0.023s
ok      encoding/base32 0.054s
ok      encoding/base64 0.029s
ok      encoding/binary 0.027s
ok      encoding/csv    0.037s
ok      encoding/gob    0.087s
ok      encoding/hex    0.093s
ok      encoding/json   0.097s
ok      encoding/pem    0.020s
ok      encoding/xml    0.033s
ok      errors  0.032s
ok      expvar  0.012s
ok      flag    0.052s
ok      fmt     0.115s
ok      go/ast  0.018s
ok      go/build        0.180s
ok      go/constant     0.016s
ok      go/doc  0.074s
ok      go/format       0.028s
ok      go/importer     0.257s
ok      go/internal/gccgoimporter       0.028s
ok      go/internal/gcimporter  0.565s
ok      go/internal/srcimporter 1.187s
ok      go/parser       0.059s
ok      go/printer      0.563s
ok      go/scanner      0.023s
ok      go/token        0.092s
ok      go/types        1.118s
ok      hash    0.030s
ok      hash/adler32    0.029s
ok      hash/crc32      0.012s
ok      hash/crc64      0.026s
ok      hash/fnv        0.013s
ok      html    0.026s
ok      html/template   0.118s
ok      image   0.086s
ok      image/color     0.026s
ok      image/draw      0.062s
ok      image/gif       0.689s
ok      image/jpeg      0.253s
ok      image/png       0.060s
ok      index/suffixarray       0.510s
ok      internal/cpu    0.043s
ok      internal/fmtsort        0.050s
ok      internal/poll   0.168s
ok      internal/reflectlite    0.015s
ok      internal/singleflight   0.051s
ok      internal/trace  0.147s
ok      internal/xcoff  0.025s
ok      io      0.072s
ok      io/ioutil       0.014s
ok      log     0.050s
ok      log/syslog      1.310s
ok      math    0.013s
ok      math/big        0.426s
ok      math/bits       0.021s
ok      math/cmplx      0.054s
ok      math/rand       0.190s
ok      mime    0.023s
ok      mime/multipart  0.297s
ok      mime/quotedprintable    0.021s
ok      net     5.252s
ok      net/http        4.560s
ok      net/http/cgi    0.864s
ok      net/http/cookiejar      0.051s
ok      net/http/fcgi   0.028s
ok      net/http/httptest       0.044s
ok      net/http/httptrace      0.008s
ok      net/http/httputil       0.065s
ok      net/http/internal       0.018s
ok      net/http/pprof  2.120s
ok      net/internal/socktest   0.020s
ok      net/mail        0.021s
ok      net/rpc 0.043s
ok      net/rpc/jsonrpc 0.015s
ok      net/smtp        0.033s
ok      net/textproto   0.035s
ok      net/url 0.027s
ok      os      0.778s
ok      os/exec 0.566s
ok      os/signal       5.384s
ok      os/user 0.029s
ok      path    0.011s
ok      path/filepath   0.038s
ok      reflect 0.856s
ok      regexp  0.103s
ok      regexp/syntax   0.389s
ok      runtime 34.780s
ok      runtime/debug   0.040s
ok      runtime/internal/atomic 0.057s
ok      runtime/internal/math   0.027s
ok      runtime/internal/sys    0.025s
ok      runtime/pprof   8.165s
ok      runtime/pprof/internal/profile  0.026s
ok      runtime/trace   2.567s
ok      sort    0.100s
ok      strconv 0.609s
ok      strings 0.292s
ok      sync    0.340s
ok      sync/atomic     0.104s
ok      syscall 3.116s
ok      testing 0.312s
ok      testing/quick   0.093s
ok      text/scanner    0.028s
ok      text/tabwriter  0.010s
ok      text/template   0.093s
ok      text/template/parse     0.019s
ok      time    2.799s
ok      unicode 0.024s
ok      unicode/utf16   0.008s
ok      unicode/utf8    0.009s
ok      cmd/addr2line   2.417s
ok      cmd/api 0.025s
ok      cmd/asm/internal/asm    0.797s
ok      cmd/asm/internal/lex    0.008s
ok      cmd/compile     0.052s
ok      cmd/compile/internal/gc 14.898s
ok      cmd/compile/internal/ssa        0.978s
ok      cmd/compile/internal/syntax     0.065s
ok      cmd/compile/internal/test       0.056s [no tests to run]
ok      cmd/compile/internal/types      0.081s
ok      cmd/cover       5.730s
ok      cmd/doc 0.240s
ok      cmd/fix 0.101s
ok      cmd/go  95.444s
ok      cmd/go/internal/auth    0.008s
ok      cmd/go/internal/cache   0.517s
ok      cmd/go/internal/dirhash 0.028s
ok      cmd/go/internal/generate        0.080s
ok      cmd/go/internal/get     0.041s
ok      cmd/go/internal/imports 0.015s
ok      cmd/go/internal/load    0.015s
ok      cmd/go/internal/lockedfile      0.022s
ok      cmd/go/internal/lockedfile/internal/filelock    0.110s
ok      cmd/go/internal/modconv 0.044s
ok      cmd/go/internal/modfetch        0.089s
ok      cmd/go/internal/modfetch/codehost       0.021s
ok      cmd/go/internal/modfile 0.019s
ok      cmd/go/internal/modload 0.030s
ok      cmd/go/internal/module  0.050s
ok      cmd/go/internal/mvs     0.017s
ok      cmd/go/internal/note    0.037s
ok      cmd/go/internal/par     0.039s
ok      cmd/go/internal/renameio        0.870s
ok      cmd/go/internal/search  0.009s
ok      cmd/go/internal/semver  0.010s
ok      cmd/go/internal/sumweb  0.037s
ok      cmd/go/internal/tlog    0.503s
ok      cmd/go/internal/txtar   0.010s
ok      cmd/go/internal/web     0.035s
ok      cmd/go/internal/work    0.043s
ok      cmd/gofmt       0.050s
ok      cmd/internal/buildid    0.235s
ok      cmd/internal/dwarf      0.045s
ok      cmd/internal/edit       0.040s
ok      cmd/internal/goobj      1.288s
ok      cmd/internal/obj        0.054s
ok      cmd/internal/obj/arm64  0.038s
ok      cmd/internal/obj/x86    3.331s
ok      cmd/internal/objabi     0.008s
ok      cmd/internal/src        0.008s
ok      cmd/internal/test2json  0.202s
ok      cmd/link        8.469s
ok      cmd/link/internal/ld    3.921s
ok      cmd/link/internal/sym   0.008s
ok      cmd/nm  4.254s
ok      cmd/objdump     3.136s
ok      cmd/pack        2.699s
ok      cmd/trace       0.111s
ok      cmd/vet 12.556s

##### os/user with tag osusergo
ok      os/user 0.025s

##### GOMAXPROCS=2 runtime -cpu=1,2,4 -quick
ok      runtime 17.394s

##### cmd/go terminal test
PASS
ok      cmd/go/testdata/testterminal18153       0.004s

##### Testing without libgcc.
ok      crypto/x509     0.443s
ok      net     0.028s
ok      os/user 0.143s

##### internal linking of -buildmode=pie
ok      reflect 2.022s
ok      os/user 0.445s

##### sync -cpu=10
ok      sync    1.212s

##### Testing race detector
ok      runtime/race    19.944s
ok      flag    1.080s
ok      net     1.105s
ok      os      1.165s
ok      os/exec 3.201s
ok      encoding/gob    1.047s
ok      flag    1.093s
ok      os/exec 3.295s

##### ../misc/cgo/stdio
PASS

##### ../misc/cgo/life
PASS
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
No support for static linking found (lacks libc.a?), skip cgo static linking test.

##### ../misc/cgo/fortran
PASS
ok      misc/cgo/fortran        0.038s

##### ../misc/cgo/test
PASS
ok      misc/cgo/test   8.618s
PASS
ok      misc/cgo/test   7.270s
PASS
ok      misc/cgo/test   8.543s
PASS
ok      misc/cgo/testtls        0.014s
PASS
ok      misc/cgo/testtls        0.046s
PASS
ok      misc/cgo/test   6.445s
PASS
ok      misc/cgo/testtls        0.010s
PASS
ok      misc/cgo/nocgo  0.009s

##### ../misc/cgo/testgodefs

##### ../misc/cgo/testso
ok      misc/cgo/testso 1.646s

##### ../misc/cgo/testsovar
ok      misc/cgo/testsovar      1.672s

##### ../misc/cgo/testcshared
SKIP - short mode and $GO_BUILDER_NAME not set

##### ../misc/cgo/testshared
--- FAIL: TestTrivialExecutable (3.91s)
    shared_test.go:41: executing ../../bin/trivial (trivial executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestDivisionExecutable (0.87s)
    shared_test.go:41: executing ../../bin/division (division executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestCgoExecutable (1.66s)
    shared_test.go:41: executing ../../bin/execgo (cgo executable) failed signal: segmentation fault (core dumped):
--- FAIL: TestGopathShlib (4.57s)
    shared_test.go:41: executing ../../bin/exe (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestTwoGopathShlibs (5.28s)
    shared_test.go:41: executing ../../bin/exe2 (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestThreeGopathShlibs (7.75s)
    shared_test.go:41: executing ../../bin/exe3 (executable linked to GOPATH library) failed signal: segmentation fault (core dumped):
--- FAIL: TestABIChecking (4.32s)
    shared_test.go:885: exe failed, but without line "abi mismatch detected between the executable and lib"; got output:
--- FAIL: TestImplicitInclusion (2.01s)
    shared_test.go:41: executing ../../bin/implicitcmd (running executable linked against library that contains same package as it) failed signal: segmentation fault (core dumped):
--- FAIL: TestInterface (3.00s)
    shared_test.go:41: executing ../../bin/iface (running type/itab uniqueness tester) failed signal: segmentation fault (core dumped):
--- FAIL: TestGlobal (1.98s)
    shared_test.go:41: executing ../../bin/global (global executable) failed signal: segmentation fault (core dumped):
shared_test.go:72: executing go test -installsuffix=6129484611666145821 -linkshared -test.short sync/atomic failed exit status 1:
FAIL    misc/cgo/testshared     58.075s
FAIL
2020/02/12 11:20:41 Failed: exit status 1
2020/02/12 11:20:41 FAILED
[root@Estuary-CentOS8 src]#

@erifan
Copy link

erifan commented Feb 12, 2020

That's weird, I noticed one such error in your log and wonder if it is relevant.

##### ../misc/cgo/life
PASS
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
No support for static linking found (lacks libc.a?), skip cgo static linking test.

@erifan
Copy link

erifan commented Feb 12, 2020

Refer to #28334

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Feb 14, 2020
@dmitshur dmitshur added this to the Backlog milestone Feb 14, 2020
@darmac
Copy link
Author

darmac commented Feb 20, 2020

I updated the binutils to 2.34 which include the fixed patch, and it can test pass now, Thanks for your help.

@darmac darmac closed this as completed Feb 20, 2020
@golang golang locked and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge 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