FAQ
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

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ian Lance Taylor at Nov 21, 2013 at 5:29 pm

    On Thu, Nov 21, 2013 at 7:24 AM, Matthew Zimmerman wrote:

    Wiimote disconnected
    SIGSEGV: segmentation violation
    PC=0x7f30324d4224
    signal arrived during cgo execution
    This means that your C code got a SIGSEGV signal. It's not a problem
    with your Go code, unless perhaps you are somehow passing an invalid
    pointer into the C code.

    Ian

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Matthew Zimmerman at Nov 22, 2013 at 6:10 am
    Indeed! I'm too used to Go! I was using the cgo attribute where an
    additional error is returned for every function. I thought that if
    the cwiid_open() function didn't find a wiimote, it would throw an
    error. This was wrong and instead it was just returning nil for the
    pointer to the wiimote struct. Now that I'm checking for that
    condition I'm having no issues with the code now.

    Thanks Ian for helping a C newb!
    On Thu, Nov 21, 2013 at 12:29 PM, Ian Lance Taylor wrote:
    On Thu, Nov 21, 2013 at 7:24 AM, Matthew Zimmerman wrote:

    Wiimote disconnected
    SIGSEGV: segmentation violation
    PC=0x7f30324d4224
    signal arrived during cgo execution
    This means that your C code got a SIGSEGV signal. It's not a problem
    with your Go code, unless perhaps you are somehow passing an invalid
    pointer into the C code.

    Ian
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 21, '13 at 3:24p
activeNov 22, '13 at 6:10a
posts3
users2
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase