golang frontend 'go' dies with SIGILL: illegal instruction

Bug #1184621 reported by JustusWinter
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

root@raspberrypi /tmp # go
SIGILL: illegal instruction
PC=0x7d394

math.init·1()
        /usr/lib/go/src/pkg/math/pow10.go:34 +0x28
math.init()
        /usr/lib/go/src/pkg/math/unsafe.go:21 +0x70
strconv.init()
        /usr/lib/go/src/pkg/strconv/quote.go:441 +0x70
go/parser.init()
        /usr/lib/go/src/pkg/go/parser/parser.go:2349 +0x78
main.init()
        /usr/lib/go/src/cmd/go/vet.go:37 +0x78

goroutine 2 [runnable]:
created by runtime.main
        /build/golang-FunV5r/golang-1.0.2/src/pkg/runtime/proc.c:221

trap 0x6
error 0x0
oldmask 0x0
r0 0x86c5b0
r1 0x0
r2 0x0
r3 0x0
r4 0x0
r5 0x0
r6 0x0
r7 0x0
r8 0x0
r9 0x45e29c
r10 0x10953000
fp 0x86c172
ip 0xcafebabe
sp 0xb6f5de4c
lr 0x7d928
pc 0x7d394
cpsr 0x20000010
fault 0x0
root@raspberrypi /tmp # cat -n /usr/lib/go/src/pkg/math/pow10.go | grep -C1 34
    33 func init() {
    34 pow10tab[0] = 1.0e0
    35 pow10tab[1] = 1.0e1
root@raspberrypi /tmp # cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 0002
Serial : 00000000d6440fb2

Revision history for this message
Lonnie Olson (fungussn) wrote :

Same issue here.

fungus@pinky ~ $ go
SIGILL: illegal instruction
PC=0x7d394

math.init·1()
 /usr/lib/go/src/pkg/math/pow10.go:34 +0x28
math.init()
 /usr/lib/go/src/pkg/math/unsafe.go:21 +0x70
strconv.init()
 /usr/lib/go/src/pkg/strconv/quote.go:441 +0x70
go/parser.init()
 /usr/lib/go/src/pkg/go/parser/parser.go:2349 +0x78
main.init()
 /usr/lib/go/src/cmd/go/vet.go:37 +0x78

goroutine 2 [runnable]:
created by runtime.main
 /build/golang-FunV5r/golang-1.0.2/src/pkg/runtime/proc.c:221

trap 0x6
error 0x0
oldmask 0x0
r0 0x86c5b0
r1 0x0
r2 0x0
r3 0x0
r4 0x0
r5 0x0
r6 0x0
r7 0x0
r8 0x0
r9 0x45e29c
r10 0x10953000
fp 0x86c172
ip 0xcafebabe
sp 0xb6ee3e4c
lr 0x7d928
pc 0x7d394
cpsr 0x20000010
fault 0x0
fungus@pinky ~ $ cat -n /usr/lib/go/src/pkg/math/pow10.go | grep -C1 34
    33 func init() {
    34 pow10tab[0] = 1.0e0
    35 pow10tab[1] = 1.0e1
fungus@pinky ~ $ cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 697.95
Features : swp half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : BCM2708
Revision : 000f
Serial : 000000006b4ea99a

###########
However, the same source code works when built with GOARM=5

fungus@pinky ~/tmp $ apt-get source golang
fungus@pinky ~/tmp $ tar -zxf golang_1.0.2.orig.tar.gz
fungus@pinky ~/tmp/go/src $ GOARM=5 ./make.bash
fungus@pinky ~/tmp/go/src $ ../bin/go version
go version go1.0.2

Revision history for this message
Kingdon Barrett (kingdon) wrote :

Thirded. This fellow has written an excellent article on how the packages need to be updated:
http://www.greenhughes.com/content/how-get-go-going-raspberry-pi

I hope that someone with commit access will build a new set of packages with this change, I can't tell if it's been fixed upstream in 1.1 (jessie) or 1.1.1 (sid) but that's an awful lot of unnecessary pi-hours spent if everyone who wants to use go on raspbian will have to compile their own packages until 2015 (or later).

Revision history for this message
peter green (plugwash) wrote :

Thanks for the info. If I understand things correcty it seems that GOARM=6 should work on the Pi but doesn't in wheezy's version of GO due to an upstream bug. I'll get the package rebuilt with GOARM=5.

Can someone test the version of golang in raspbian jessie and tell me if it also needs build configuration tweaks.

Revision history for this message
Vincent Batts (vbatts) wrote :

When I download the go1.1.2 source, and compile it on the raspberry, it works just fine. This is without any GO* flags, letting the ./all.bash make its own assumptions.

root@nas:/etc/apt# uname -a
Linux nas 3.6.11+ #538 PREEMPT Fri Aug 30 20:42:08 BST 2013 armv6l GNU/Linux
root@nas:/etc/apt# cat /etc/*release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.