Closed tjyang closed 9 years ago
From my perspective openbsd support is now fairly stable - I've been doing full builds with all tests successfully completing for several weeks now. Unfortunately, I'm going to need more information than has been provided - to start with: 1) What OpenBSD version and architecture are you running on (output from 'sysctl kern.version' would be useful). You'll probably want to run -current or at least a 5.0 beta. 2) What's the status of your go repository (output from 'hg summary' for /home/tjyang/gotip). I presume you are tracking the default branch?
I created a "tip" user for building tip version of code. Same error message when doing test. -bash-4.1$ sysctl kern.version kern.version=OpenBSD 4.9 (GENERIC.MP) #794: Wed Mar 2 07:19:02 MST 2011 deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP -bash-4.1$ -bash-4.1$ hg summary parent: 9706:546f21eebee8 tip image/png: don't use a goroutine to decode. This was preventing branch: default commit: (clean) update: (current) -bash-4.1$ -bash-4.1$ hg id 546f21eebee8 tip -bash-4.1$ %%%% making pkg %%%% gmake: Entering directory `/home/tip/go/src/pkg' install runtime install sync/atomic install unicode install math install container/list install container/ring install container/vector install crypto/subtle install utf16 install utf8 install sort install cmath install container/heap install sync install syscall install rand install os install io install strings install crypto/cast5 install os/signal install path install bytes install hash install crypto/cipher install exp/norm install hash/crc64 install hash/crc32 install hash/adler32 install crypto install regexp install tabwriter install path/filepath install strconv install crypto/md5 install crypto/sha1 install crypto/sha256 install crypto/md4 install crypto/ripemd160 install crypto/sha512 install index/suffixarray install io/ioutil install bufio install reflect install crypto/aes install crypto/blowfish install crypto/hmac install encoding/base64 install crypto/openpgp/error install crypto/rc4 install exec install url install crypto/twofish install crypto/xtea install encoding/ascii85 install encoding/base32 install encoding/git85 install encoding/hex install image install exp/regexp/syntax install html install json install archive/tar install compress/flate install encoding/binary install time install fmt install compress/bzip2 install encoding/pem install crypto/openpgp/armor install crypto/openpgp/s2k install debug/dwarf install flag install go/token install template/parse install csv install debug/gosym install image/ycbcr install log install exp/regexp install mime install runtime/debug install scanner install gob install hash/fnv install runtime/pprof install image/bmp install image/jpeg install old/template install testing install testing/iotest install testing/quick install testing/script install try install xml install ../cmd/goyacc install archive/zip install big install compress/gzip install compress/lzw install compress/zlib install crypto/des install crypto/dsa install crypto/elliptic install crypto/rand install debug/elf install debug/macho install debug/pe install go/scanner install template install image/draw install image/gif install image/png install image/tiff install patch install asn1 install crypto/ecdsa install crypto/rsa install crypto/openpgp/elgamal install go/ast install ebnf install exp/datafmt install exp/gui install exp/template/html install ../cmd/hgpatch install crypto/x509/pkix install crypto/openpgp/packet install go/doc install go/parser install go/printer install go/typechecker install go/types install ../cmd/ebnflint install ../cmd/govet install crypto/x509 install crypto/openpgp install ../cmd/cgo install go/build install ../cmd/gofix install ../cmd/gofmt install ../cmd/gotype install crypto/ocsp install ../cmd/gotest install runtime/cgo install net install os/user install crypto/tls install exp/gui/x11 install net/textproto install netchan install syslog install mime/multipart install mail install net/dict install http install smtp install expvar install http/cgi install http/pprof install http/httptest install http/spdy install rpc install websocket install ../cmd/godoc install ../cmd/goinstall install http/fcgi install rpc/jsonrpc gmake: Leaving directory `/home/tip/go/src/pkg' --- Installed Go for openbsd/386 in /home/tip/go. Installed commands in /home/tip/go/bin. *** You need to add /home/tip/go/bin to your $PATH. *** The compiler is 8g. --- cd pkg test archive/tar TEST FAIL archive/tar gmake[1]: Entering directory `/home/tip/go/src/pkg/archive/tar' gotest -test.short -test.timeout=120 gmake[1]: *** [testshort] Segmentation fault gmake[1]: Leaving directory `/home/tip/go/src/pkg/archive/tar' gmake: *** [archive/tar.testshort] Error 1 -bash-4.1$ -bash-4.1$ ../go/bin/8g -V 8g version weekly.2011-09-07 9706 -bash-4.1$ pwd /home/tip/go -bash-4.1$
OpenBSD 4.9 is too old - it does not support I386_SET_GSBASE via sysarch(), which is why attempting to run a binary is resulting in a segfault (most likely from the runtime notok function). If you want to use Go on OpenBSD, please update to a current snapshot. OpenBSD 5.0 will be released on the 1st of November and it will be the first version that Go will work fully on.
I created another vm session to run openbsd 5.0(snapshot). Still failed at tar test. please see following info. <snipped> install http/spdy install rpc install websocket install ../cmd/goinstall install http/fcgi install ../cmd/godoc install rpc/jsonrpc gmake: Leaving directory `/home/tip/go/src/pkg' --- Installed Go for openbsd/386 in /home/tip/go. Installed commands in /home/tip/go/bin. The compiler is 8g. --- cd pkg test archive/tar TEST FAIL archive/tar gmake[1]: Entering directory `/home/tip/go/src/pkg/archive/tar' gotest -test.short -test.timeout=120 throw: runtime: cannot reserve arena virtual address space gmake[1]: *** [testshort] Error 2 gmake[1]: Leaving directory `/home/tip/go/src/pkg/archive/tar' gmake: *** [archive/tar.testshort] Error 1 -bash-4.2$ hg summary parent: 9740:5729b8d311d4 tip go/printer: use panic/defer instead of goroutine branch: default commit: (clean) update: (current) -bash-4.2$ hg id 5729b8d311d4 tip -bash-4.2$ 8g -V 8g version weekly.2011-09-07 9740 -bash-4.2$ sysctl kern.version kern.version=OpenBSD 5.0-current (GENERIC.MP) #66: Mon Sep 12 02:15:23 MDT 2011 deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP -bash-4.2$ tail ~/.bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions PATH=${PATH}:~/go/bin export GOROOT=~/go GOARCH=386 GOOS=openbsd GOBIN=~/go/bin -bash-4.2$
0. I was using vmware wks 7.0 on Asus ROG with i7 cpu. 1. Another test on IBM T30 laptop. -bash-4.2$ sysctl kern.version kern.version=OpenBSD 5.0-current (GENERIC) #52: Tue Sep 13 22:04:50 MDT 2011 deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC -bash-4.2$ uname -a OpenBSD t30.test.net 5.0 GENERIC#52 i386 -bash-4.2$ date Sun Sep 18 08:18:11 CDT 2011 -bash-4.2$ 2. still failed on tar test. <snipped> install http/spdy install rpc install websocket install ../cmd/godoc install ../cmd/goinstall install http/fcgi install rpc/jsonrpc gmake: Leaving directory `/home/tip/go/src/pkg' --- Installed Go for openbsd/386 in /home/tip/go. Installed commands in /home/tip/go/bin. The compiler is 8g. --- cd pkg test archive/tar TEST FAIL archive/tar gmake[1]: Entering directory `/home/tip/go/src/pkg/archive/tar' gotest -test.short -test.timeout=120 throw: runtime: cannot reserve arena virtual address space gmake[1]: *** [testshort] Error 2 gmake[1]: Leaving directory `/home/tip/go/src/pkg/archive/tar' gmake: *** [archive/tar.testshort] Error 1 -bash-4.2$ 4. I have OpenBSD/sparc64 stood up on a Sun blade 100 also..
0. I was using vmware wks 7.0 on Asus ROG with i7 cpu. 1. Another test on IBM T30 laptop. -bash-4.2$ sysctl kern.version kern.version=OpenBSD 5.0-current (GENERIC) #52: Tue Sep 13 22:04:50 MDT 2011 deraadt@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC -bash-4.2$ uname -a OpenBSD t30.test.net 5.0 GENERIC#52 i386 -bash-4.2$ date Sun Sep 18 08:18:11 CDT 2011 -bash-4.2$ 2. still failed on tar test. <snipped> install http/spdy install rpc install websocket install ../cmd/godoc install ../cmd/goinstall install http/fcgi install rpc/jsonrpc gmake: Leaving directory `/home/tip/go/src/pkg' --- Installed Go for openbsd/386 in /home/tip/go. Installed commands in /home/tip/go/bin. The compiler is 8g. --- cd pkg test archive/tar TEST FAIL archive/tar gmake[1]: Entering directory `/home/tip/go/src/pkg/archive/tar' gotest -test.short -test.timeout=120 throw: runtime: cannot reserve arena virtual address space gmake[1]: *** [testshort] Error 2 gmake[1]: Leaving directory `/home/tip/go/src/pkg/archive/tar' gmake: *** [archive/tar.testshort] Error 1 -bash-4.2$ 4. I have OpenBSD/sparc64 stood up on a Sun blade 100 also..
Similar issue like https://golang.org/issue/2015 -bash-4.2$ 8g hello.go -bash-4.2$ 8l -o hello hello.8 -bash-4.2$ ./hello throw: runtime: cannot reserve arena virtual address space -bash-4.2$ cat hello. hello.8 hello.go -bash-4.2$ cat hello.go package main import "fmt" func main() { fmt.Println("hello world") } -bash-4.2$
Looks like it is resource limitation issue. Running hello world with "2097152" is ok with running a "tip" user with "524288" limit will cause the issue. # ulimit -a time(cpu-seconds) unlimited file(blocks) unlimited coredump(blocks) unlimited data(kbytes) 2097152 stack(kbytes) 8192 lockedmem(kbytes) 339837 memory(kbytes) 1017760 nofiles(descriptors) 128 processes 1310 # pwd /usr/ports # cd ~tip # ls .Xdefaults .cshrc .profile hello .bash_history .login .ssh hello.8 .bashrc .mailrc go hello.go # ./hello hello world # id uid=0(root) gid=0(wheel) groups=0(wheel), 2(kmem), 3(sys), 4(tty), 5(operator), 20(staff), 31(guest) # uname -a OpenBSD t30.test.net 5.0 GENERIC#52 i386 #
This a "ulimit -a" setting output from a fedora 15 amd64 as a regular unix user "release". [release@t-fedora15-64 ~]$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 29370 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited [release@t-fedora15-64 ~]$
As you have already identified, you are running into resource limits. The Go runtime reserves a fairly large amount of virtual address space and this will fail if your data size is too low. You will also likely need to increase the file descriptor limit or a later test will also fail. Under OpenBSD/i386 all tests should pass with: ulimit -d 2097152 ulimit -n 512