golang / go

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

build: all.bash failed at test step on raspberrypi #3728

Closed tjyang closed 9 years ago

tjyang commented 12 years ago
What steps will reproduce the problem?

1. export GOARM=5
2. cd go/src;./all.bash
3. compilation went fine but test step failed and hang the console.
4. Looks like a memory issue.
5. How do I build without "testing" step ?

What is the expected output?

test completed

What do you see instead?

# Testing packages.
ok      cmd/api 0.256s
?       cmd/cgo [no test files]
ok      cmd/fix 28.627s
ok      cmd/go  0.340s
?       cmd/godoc       [no test files]
ok      cmd/gofmt       1.066s
?       cmd/vet [no test files]
?       cmd/yacc        [no test files]
ok      archive/tar     0.130s
ok      archive/zip     1.061s
ok      bufio   3.589s
ok      bytes   1.719s
ok      compress/bzip2  1.250s
ok      compress/flate  14.258s
ok      compress/gzip   0.328s
ok      compress/lzw    2.137s
ok      compress/zlib   26.907s
ok      container/heap  0.119s
ok      container/list  0.115s
ok      container/ring  0.376s
?       crypto  [no test files]
ok      crypto/aes      0.325s
ok      crypto/cipher   0.126s
ok      crypto/des      0.655s
ok      crypto/dsa      0.447s
ok      crypto/ecdsa    0.681s
ok      crypto/elliptic 0.297s
ok      crypto/hmac     0.142s
ok      crypto/md5      0.163s
ok      crypto/rand     0.534s
ok      crypto/rc4      0.113s
ok      crypto/rsa      6.847s
ok      crypto/sha1     0.164s
ok      crypto/sha256   0.178s
ok      crypto/sha512   0.202s
ok      crypto/subtle   0.277s
ok      crypto/tls      5.551s
ok      crypto/x509     30.485s
?       crypto/x509/pkix        [no test files]
ok      database/sql    0.322s
ok      database/sql/driver     0.113s
ok      debug/dwarf     0.281s
ok      debug/elf       0.306s
ok      debug/gosym     0.122s
ok      debug/macho     0.151s
ok      debug/pe        0.139s
ok      encoding/ascii85        0.168s
ok      encoding/asn1   0.163s
ok      encoding/base32 0.163s
ok      encoding/base64 0.163s
ok      encoding/binary 0.172s
ok      encoding/csv    0.164s
throw: runtime: out of memory

goroutine 25 [running]:
encoding/gob.(*Decoder).readMessage(0x107b2820, 0x1000cf66, 0x1078f3f0)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/decoder.go:92 +0x70
encoding/gob.(*Decoder).recvMessage(0x107b2820, 0x2527c, 0x10757000)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/decoder.go:84 +0x130
encoding/gob.(*Decoder).decodeTypeSequence(0x107b2820, 0x107a1300, 0x160, 0x0)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/decoder.go:142 +0x68
encoding/gob.(*Decoder).DecodeValue(0x107b2820, 0x113028, 0x107a13a0, 0x160, 0x0, ...)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/decoder.go:206 +0x174
encoding/gob.(*Decoder).Decode(0x107b2820, 0x113020, 0x107a13a0, 0x107a13a0, 0x107afba0,
...)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/decoder.go:185 +0x27c
encoding/gob.encFuzzDec(0x10799fb0, 0x112d60, 0x10799f88, 0x107273e0, 0x107331b0, ...)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/codec_test.go:1429 +0x358
encoding/gob.testFuzz(0x1079f140, 0x994c53f0, 0x126fc084, 0x64, 0x40047fa4, ...)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/codec_test.go:1468 +0x294
encoding/gob.TestFuzzRegressions(0x1079f140, 0xe)
        /usbpub/home/gobuild/go/src/pkg/encoding/gob/codec_test.go:1457 +0xd4
testing.tRunner(0x1079f140, 0x1ffb2c, 0x0)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:273 +0xac
created by testing.RunTests
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:349 +0x764

goroutine 1 [chan receive]:
testing.RunTests(0x10c00, 0x1ffa30, 0x4a, 0x4a, 0x31501, ...)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:350 +0x784
testing.Main(0x10c00, 0x1ffa30, 0x4a, 0x4a, 0x1fc5e0, ...)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:285 +0x70
main.main()
        /tmp/go-build294647749/encoding/gob/_test/_testmain.go:193 +0x88

goroutine 2 [syscall]:
created by runtime.main
        /usbpub/home/gobuild/go/src/pkg/runtime/proc.c:221

goroutine 3 [syscall]:
created by addtimer
        /usbpub/home/gobuild/go/src/pkg/runtime/ztime_linux_arm.c:72
FAIL    encoding/gob    0.389s
ok      encoding/hex    0.119s
ok      encoding/json   2.598s
ok      encoding/pem    0.196s
ok      encoding/xml    0.404s
ok      errors  0.117s
ok      exp/ebnf        0.121s
ok      exp/ebnflint    0.258s
ok      exp/gotype      10.777s
ok      exp/html        4.590s
ok      exp/html/atom   0.113s
ok      exp/inotify     1.154s
ok      exp/locale/collate      0.669s
ok      exp/locale/collate/build        0.190s
ok      exp/norm        26.455s
ok      exp/proxy       0.144s
ok      exp/types       4.242s
ok      exp/utf8string  0.121s
ok      expvar  0.193s
ok      flag    0.121s
ok      fmt     0.907s
ok      go/ast  0.164s
ok      go/build        6.339s
ok      go/doc  1.732s
ok      go/parser       1.066s
ok      go/printer      8.551s
ok      go/scanner      0.186s
ok      go/token        1.327s
?       hash    [no test files]
ok      hash/adler32    0.633s
ok      hash/crc32      0.221s
ok      hash/crc64      0.111s
ok      hash/fnv        0.114s
ok      html    0.122s
ok      html/template   1.119s
ok      image   1.830s
ok      image/color     0.203s
ok      image/draw      0.890s
?       image/gif       [no test files]
ok      image/jpeg      1.386s
ok      image/png       1.234s
ok      index/suffixarray       0.346s
ok      io      0.173s
ok      io/ioutil       0.121s
ok      log     0.174s
ok      log/syslog      0.353s
ok      math    0.991s
ok      math/big        5.878s
ok      math/cmplx      0.253s
panic: test timed out

goroutine 7 [running]:
testing.alarm()
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:436 +0x5c
created by time.goFunc
        /usbpub/home/gobuild/go/src/pkg/time/sleep.go:94 +0x5c

goroutine 1 [chan receive]:
testing.RunTests(0x10c00, 0x17a850, 0x6, 0x6, 0x31001, ...)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:350 +0x784
testing.Main(0x10c00, 0x17a850, 0x6, 0x6, 0x17a790, ...)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:285 +0x70
main.main()
        /tmp/go-build294647749/math/rand/_test/_testmain.go:63 +0x88

goroutine 2 [syscall]:
created by runtime.main
        /usbpub/home/gobuild/go/src/pkg/runtime/proc.c:221

goroutine 3 [timer goroutine (idle)]:
created by addtimer
        /usbpub/home/gobuild/go/src/pkg/runtime/ztime_linux_arm.c:72

goroutine 8 [runnable]:
testing.tRunner(0x10632f40, 0x17a874, 0x0)
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:256
created by testing.RunTests
        /usbpub/home/gobuild/go/src/pkg/testing/testing.go:349 +0x764
FAIL    math/rand       130.702s
ok      mime    0.130s
ok      mime/multipart  1.993s

Which compiler are you using (5g, 6g, 8g, gccgo)?

gobuild@raspberrypi:~/go/bin$ gcc -v
Using built-in specs.
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Debian 4.4.5-8'
--with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.4
--enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.4 --libdir=/usr/lib --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --disable-sjlj-exceptions
--enable-checking=release --build=arm-linux-gnueabi --host=arm-linux-gnueabi
--target=arm-linux-gnueabi
Thread model: posix
gcc version 4.4.5 (Debian 4.4.5-8)
gobuild@raspberrypi:~/go/bin$

Which operating system are you using?
gobuild@raspberrypi:~/go/bin$ uname -a
Linux raspberrypi 3.1.9+ #90 Wed Apr 18 18:23:05 BST 2012 armv6l GNU/Linux
gobuild@raspberrypi:~/go/bin$

Which version are you using?  (run 'go version')
gobuild@raspberrypi:~/go/bin$ ./go version
go version weekly.2012-03-27 +7021c8a8a25a
gobuild@raspberrypi:~/go/bin$

Please provide any additional information below.

gobuild@raspberrypi:~/go/bin$ hg id
7021c8a8a25a tip
gobuild@raspberrypi:~/go/bin$

gobuild@raspberrypi:~/go/bin$ head -1  /proc/meminfo
MemTotal:         190836 kB
gobuild@raspberrypi:~/go/bin$
davecheney commented 12 years ago

Comment 1:

Hello, 
Thanks for testing Go on a Pi.
What does your swap configuration look like, 190mb of ram is close to enough to run the
package tests, but will probably swap your machine into submission during the gc tests,
(where it says # ../test).
As a consolation, you can rerun most of the build phases independently. ie, to rerun the
package tests
   go test std -test.short
You can also rerun the gc tests, but be ready with your console cable or reset button as
some require a lot of memory to run
   cd $GOROOT/test; go run run.go
The math/rand timeout is an unfortunate side-effect of using the soft float emulation.
If you apply, http://golang.org/cl/5987063/ and remove the GOARM environment
variable, this will enable the hardware floating point support, and the test will likely
pass. If this works for you, please, comment on the issue.
tjyang commented 12 years ago

Comment 2:

Thanks for the pointers for go test and patches.
I am using this ticket as a place for my note taking, sorry for the details.
0. apply patch from http://golang.org/cl/5987063/
0.5 cd go/src;./all.bash
1. hmm, swap partition got commented out by default from debian 6.0 for raspberrypi.
gobuild@raspberrypi:~$ more /etc/fstab
proc            /proc           proc    defaults        0       0
/dev/mmcblk0p1  /boot           vfat    defaults        0       0
#/dev/mmcblk0p3  none            swap    sw              0       0
/dev/sda1  /usbpub ext4 rw,nosuid,nodev,uhelper=udisks 0 0
gobuild@raspberrypi:~$
2. take out comment line from /etc/fstab
3. now I am getting 195M swap space.
gobuild@raspberrypi:~$ swapon  -s
Filename                                Type            Size    Used    Priority
/dev/mmcblk0p3                          partition       195580  0       -1
gobuild@raspberrypi:~$
4. "cd $GOROOT/test; go run run.go" and run top to observe memory usage. 
    I see no memory deprivation from top output.
gobuild@raspberrypi:~/go/test$ cd $GOROOT/test; go run run.go
run        map.go              : incorrect output
float32 map allows NaN lookup (a)
float32 map should have 5 entries: map[NaN:<nil> -0:-0 +Inf:NaN NaN:<nil>]
complex64 map allows NaN lookup (a)
complex64 map should have 5 entries: map[(5+Infi):NaN (+5+NaNi):<nil> (+0-0i):-0
(+5+NaNi):<nil>]
exit status 1
gobuild@raspberrypi:~/go/test$ 
5. Above "exit status 1" happened when I tried to build "programming in go" examples in
another vt100 session.
6. Decided to run "all.bash" again without other load on Pi.
   Only see fmt test failed.
gobuild@raspberrypi:~/go/src$ ./all.bash
# Building C bootstrap tool.
cmd/dist
# Building compilers and Go bootstrap tool for host, linux/arm.
lib9
libbio
libmach
misc/pprof
cmd/addr2line
cmd/cov
cmd/nm
cmd/objdump
cmd/pack
cmd/prof
cmd/cc
cmd/gc
cmd/5l
cmd/5a
cmd/5c
cmd/5g
pkg/runtime
pkg/errors
pkg/sync/atomic
pkg/sync
pkg/io
pkg/unicode
pkg/unicode/utf8
pkg/unicode/utf16
pkg/bytes
pkg/math
pkg/strings
pkg/strconv
pkg/bufio
pkg/sort
pkg/container/heap
pkg/encoding/base64
pkg/syscall
pkg/time
pkg/os
pkg/reflect
pkg/fmt
pkg/encoding/json
pkg/flag
pkg/path/filepath
pkg/path
pkg/io/ioutil
pkg/log
pkg/regexp/syntax
pkg/regexp
pkg/go/token
pkg/go/scanner
pkg/go/ast
pkg/go/parser
pkg/os/exec
pkg/net/url
pkg/text/template/parse
pkg/text/template
pkg/go/doc
pkg/go/build
cmd/go
# Building packages and commands for linux/arm.
runtime
errors
sync/atomic
sync
io
unicode
unicode/utf8
bytes
bufio
math
syscall
time
os
strconv
reflect
fmt
sort
flag
go/token
strings
path/filepath
go/scanner
go/ast
regexp/syntax
regexp
io/ioutil
net/url
text/template/parse
text/template
go/doc
go/parser
log
path
go/build
text/tabwriter
go/printer
os/exec
cmd/api
hash
crypto
crypto/md5
encoding/binary
debug/dwarf
debug/elf
debug/macho
debug/pe
cmd/cgo
cmd/fix
container/heap
encoding/base64
unicode/utf16
encoding/json
encoding/xml
compress/flate
hash/crc32
compress/gzip
crypto/cipher
crypto/aes
crypto/des
math/rand
math/big
crypto/elliptic
crypto/hmac
crypto/rand
crypto/rc4
crypto/subtle
crypto/rsa
crypto/sha1
crypto/dsa
crypto/ecdsa
encoding/asn1
crypto/x509/pkix
encoding/pem
crypto/x509
runtime/cgo
net
crypto/tls
mime
net/textproto
mime/multipart
runtime/debug
net/http
cmd/go
archive/zip
encoding/gob
expvar
index/suffixarray
html
html/template
runtime/pprof
net/http/pprof
text/scanner
cmd/godoc
cmd/gofmt
cmd/vet
cmd/yacc
archive/tar
compress/bzip2
compress/lzw
hash/adler32
compress/zlib
container/list
container/ring
crypto/sha256
crypto/sha512
database/sql/driver
database/sql
debug/gosym
encoding/ascii85
encoding/base32
encoding/csv
encoding/hex
exp/ebnf
exp/ebnflint
exp/types
exp/gotype
exp/html/atom
exp/html
exp/inotify
exp/norm
exp/locale/collate
hash/fnv
exp/locale/collate/build
exp/proxy
exp/utf8string
hash/crc64
image/color
image
image/draw
image/gif
image/jpeg
image/png
log/syslog
math/cmplx
net/http/cgi
net/http/fcgi
net/http/httptest
net/http/httputil
net/mail
net/rpc
net/rpc/jsonrpc
net/smtp
old/netchan
os/signal
os/user
testing
testing/iotest
testing/quick
# Testing packages.
ok      cmd/api 0.258s
?       cmd/cgo [no test files]
ok      cmd/fix 30.181s
ok      cmd/go  0.462s
?       cmd/godoc       [no test files]
ok      cmd/gofmt       1.056s
?       cmd/vet [no test files]
?       cmd/yacc        [no test files]
ok      archive/tar     0.124s
ok      archive/zip     1.053s
ok      bufio   3.561s
ok      bytes   1.602s
ok      compress/bzip2  1.302s
ok      compress/flate  14.474s
ok      compress/gzip   0.351s
ok      compress/lzw    2.069s
ok      compress/zlib   28.182s
ok      container/heap  0.114s
ok      container/list  0.109s
ok      container/ring  0.354s
?       crypto  [no test files]
ok      crypto/aes      0.318s
ok      crypto/cipher   0.120s
ok      crypto/des      0.680s
ok      crypto/dsa      0.427s
ok      crypto/ecdsa    0.709s
ok      crypto/elliptic 0.283s
ok      crypto/hmac     0.137s
ok      crypto/md5      0.156s
ok      crypto/rand     0.526s
ok      crypto/rc4      0.108s
ok      crypto/rsa      6.472s
ok      crypto/sha1     0.157s
ok      crypto/sha256   0.171s
ok      crypto/sha512   0.228s
ok      crypto/subtle   0.271s
ok      crypto/tls      5.596s
ok      crypto/x509     30.364s
?       crypto/x509/pkix        [no test files]
ok      database/sql    0.315s
ok      database/sql/driver     0.112s
ok      debug/dwarf     0.276s
ok      debug/elf       0.299s
ok      debug/gosym     0.116s
ok      debug/macho     0.157s
ok      debug/pe        0.135s
ok      encoding/ascii85        0.189s
ok      encoding/asn1   0.158s
ok      encoding/base32 0.264s
ok      encoding/base64 0.157s
ok      encoding/binary 0.167s
ok      encoding/csv    0.159s
ok      encoding/gob    0.972s
ok      encoding/hex    0.115s
ok      encoding/json   1.450s
ok      encoding/pem    0.186s
ok      encoding/xml    0.391s
ok      errors  0.113s
ok      exp/ebnf        0.116s
ok      exp/ebnflint    0.241s
ok      exp/gotype      10.574s
ok      exp/html        4.622s
ok      exp/html/atom   0.111s
ok      exp/inotify     1.151s
ok      exp/locale/collate      0.639s
ok      exp/locale/collate/build        0.182s
ok      exp/norm        27.133s
ok      exp/proxy       0.141s
ok      exp/types       4.356s
ok      exp/utf8string  0.118s
ok      expvar  0.192s
ok      flag    0.116s
--- FAIL: TestNaN (0.00 seconds)
        scan_test.go:459: didn't get NaNs scanning "nan nan nan": got NaN +Inf NaN
        scan_test.go:459: didn't get NaNs scanning "NAN NAN NAN": got NaN +Inf NaN
        scan_test.go:459: didn't get NaNs scanning "NaN NaN NaN": got NaN +Inf NaN
FAIL
FAIL    fmt     0.883s
ok      go/ast  0.158s
ok      go/build        6.186s
ok      go/doc  1.756s
ok      go/parser       1.048s
ok      go/printer      8.737s
ok      go/scanner      0.181s
ok      go/token        1.338s
?       hash    [no test files]
ok      hash/adler32    0.626s
ok      hash/crc32      0.108s
ok      hash/crc64      0.107s
ok      hash/fnv        0.109s
ok      html    0.119s
ok      html/template   1.106s
ok      image   1.903s
ok      image/color     0.201s
ok      image/draw      0.909s
?       image/gif       [no test files]
ok      image/jpeg      1.335s
ok      image/png       1.239s
ok      index/suffixarray       0.375s
ok      io      0.170s
ok      io/ioutil       0.116s
ok      log     0.168s
ok      log/syslog      0.351s
ok      math    0.142s
ok      math/big        5.688s
ok      math/cmplx      0.119s
ok      math/rand       3.262s
ok      mime    0.134s
ok      mime/multipart  1.974s
ok      net     2.516s
ok      net/http        26.383s
ok      net/http/cgi    4.920s
ok      net/http/fcgi   0.232s
ok      net/http/httptest       0.195s
ok      net/http/httputil       0.319s
?       net/http/pprof  [no test files]
ok      net/mail        0.153s
ok      net/rpc 0.874s
ok      net/rpc/jsonrpc 0.257s
ok      net/smtp        0.169s
ok      net/textproto   0.185s
ok      net/url 0.164s
ok      old/netchan     0.423s
ok      os      0.446s
ok      os/exec 2.340s
ok      os/signal       0.109s
ok      os/user 0.119s
ok      path    0.117s
ok      path/filepath   6.386s
ok      reflect 0.189s
ok      regexp  2.983s
ok      regexp/syntax   24.790s
ok      runtime 24.170s
?       runtime/cgo     [no test files]
ok      runtime/debug   0.156s
ok      runtime/pprof   4.396s
ok      sort    1.302s
ok      strconv 13.797s
ok      strings 0.250s
ok      sync    0.823s
ok      sync/atomic     0.325s
ok      syscall 0.287s
?       testing [no test files]
?       testing/iotest  [no test files]
ok      testing/quick   0.863s
ok      text/scanner    0.192s
ok      text/tabwriter  0.184s
ok      text/template   0.502s
ok      text/template/parse     0.226s
ok      time    16.504s
ok      unicode 0.121s
ok      unicode/utf16   0.108s
ok      unicode/utf8    0.178s
?       unsafe  [no test files]
gobuild@raspberrypi:~/go/src$
davecheney commented 12 years ago

Comment 3:

1. swapping onto an sd card will be quite slow and will prematurely age your card.
2. I can't reproduce the fmt failure with that patch applied on my pandaboard so this is
either an unrelated failure, or some quirk of the Pi's VFP2 floating point hardware.
Please comment on the CL so the original author can address it.
minux commented 12 years ago

Comment 4:

the TestNaN failure is very strange, I will investigate.
gopherbot commented 12 years ago

Comment 5 by slash2314:

I am at the current tip and I also experienced the 
--- FAIL: TestNaN (0.00 seconds)
    scan_test.go:459: didn't get NaNs scanning "nan nan nan": got NaN +Inf NaN
    scan_test.go:459: didn't get NaNs scanning "NAN NAN NAN": got NaN +Inf NaN
    scan_test.go:459: didn't get NaNs scanning "NaN NaN NaN": got NaN +Inf NaN
FAIL
FAIL    fmt 0.889s
ok      go/ast  0.181s
I also applied the http://golang.org/cl/5987063 before I recompiled. I don't
think the TestNaN failed before I applied that patch, as I compiled a recent tip without
the failure, but with GOARM=5 set.
davecheney commented 12 years ago

Comment 6:

Hello,
Thank you for the feedback. I would like to suggest that this issue be closed as there
are a number of problems going on here, and the fix to one causes another, making it
hard to determine a clear path to resolution. In its place, with your permission, I
would like to open two new issues;
1. Address the test timeout with math/rand using softfloat.
2. Address the unsupported VPF3 floating point instruction on the Pi.
How does this sound ?
Cheers
Dave

Owner changed to @davecheney.

Status changed to WaitingForReply.

tjyang commented 12 years ago

Comment 7:

Yes, please open two tickets for each issue.
davecheney commented 12 years ago

Comment 8:

@tjyang2001
https://golang.org/issue/3740 addresses the test timeout with soft
float enabled.
Could you please attempt a run with GOARM unset to generate the illegal instruction
failure and log a new issue. I would do it myself but I don't have a copy of the build
failure in my email.
Cheers
Dave
tjyang commented 12 years ago

Comment 9:

sure, will do.
tj
tjyang commented 12 years ago

Comment 10:

@Dave, this ticket can be marked as resolved for math/rand test failure. 
for "GOARM=5 ./all.bash", the run.bash need to be changed(pointed out by minux) to have
runtime=120s to over 160s for Pi.
davecheney commented 12 years ago

Comment 11:

Closing as requested.

Status changed to Duplicate.

Merged into issue #3740.