go version go1.1.2 linux/amd64
gcc (GCC) 4.8.2
Error happens with go version go1.2rc5 linux/amd64 as well
I've seen this error reported on this list (and other places before)
but I can't find a solution for my particular problem and I'm not sure
what it is. I am not very experienced in C.
This program integrates with cwiid (Nintendo Wiimote controller
library) to handle button presses for e.g., 5k race results. I've
created a "crash" branch that simplifies the code to create the error
condition.
The error occurs when cwiid listens for a Wiimote and doesn't get one;
it then crashes. The confusing part for me is if I connect the
wiimote, then disconnect it (pull battery, hold power button, walk out
of range, etc) the program doesn't crash on successive listeners. You
don't need a wiimote to recreate the error but you do need a bluetooth
device to listen for one.
Dependencies:
cwiid
bluez
bluetooth
git clone -b crash
https://github.com/mzimmerman/racerwiigo.git && cd
racerwiigo && go build && ./racerwiigo
Cloning into 'racerwiigo'...
remote: Counting objects: 172, done.
remote: Compressing objects: 100% (138/138), done.
remote: Total 172 (delta 104), reused 98 (delta 34)
Receiving objects: 100% (172/172), 75.28 KiB | 0 bytes/s, done.
Resolving deltas: 100% (104/104), done.
Checking connectivity... done
/home/zubov/racerwiigo
Press 1&2 on the Wiimote now
Wiimote disconnected
SIGSEGV: segmentation violation
PC=0x7f30324d4224
signal arrived during cgo execution
main._C2func_cwiid_command(0x0, 0x200000003, 0x0, 0x0, 0x0, ...)
_/home/zubov/racerwiigo/_obj/_cgo_defun.c:45 +0x2f
main.main()
_/home/zubov/racerwiigo/_obj/_cgo_gotypes.go:182 +0x2da
goroutine 2 [syscall]:
rax 0xd8
rbx 0x7f3032a85d18
rcx 0x7f3032a85d18
rdx 0x2
rdi 0xd8
rsi 0x2
rbp 0x7fffd100ed90
rsp 0x7fffd100ed50
r8 0x0
r9 0x7f30324c4670
r10 0x7fffd100eb60
r11 0x7f30326ed44f
r12 0x4a32a0
r13 0x7fffd100ef70
r14 0x0
r15 0x0
rip 0x7f30324d4224
rflags 0x10206
cs 0x33
fs 0x0
gs 0x0