FAQ
I have a Go application that is crashing with:

runtime: signal received on thread not created by Go.
runtime: signal received on thread not created by Go.
Segmentation fault

It uses CGO and threads, so its not entirely unexpected, but I'm having a
tough time figuring it out. The last line in an strace before the crash is:

accept(9, {sa_family=AF_INET6, sin6_port=htons(57621), inet_pton(AF_INET6,
"::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
[28]) = 20

Which is strange, because I don't think I'm doing any IPv6 stuff. Any
thoughts on how to go about debugging this one? (gdb has been unhelpful so
far).

graham

--

Search Discussions

  • Ethan Burns at Nov 27, 2012 at 8:04 pm
    Do you happen to have profiling enabled via Go's pprof package? If so, you
    may want to checkout some of the latest messages in this thread:
    https://groups.google.com/d/topic/golang-nuts/6q8RVoXhg4g/discussion.
    On Tuesday, November 27, 2012 2:41:43 PM UTC-5, gmiller wrote:

    I have a Go application that is crashing with:

    runtime: signal received on thread not created by Go.
    runtime: signal received on thread not created by Go.
    Segmentation fault

    It uses CGO and threads, so its not entirely unexpected, but I'm having a
    tough time figuring it out. The last line in an strace before the crash is:

    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621), inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20

    Which is strange, because I don't think I'm doing any IPv6 stuff. Any
    thoughts on how to go about debugging this one? (gdb has been unhelpful so
    far).

    graham
    --
  • Minux at Nov 27, 2012 at 8:44 pm

    On Wed, Nov 28, 2012 at 3:41 AM, Graham Miller wrote:

    I have a Go application that is crashing with:

    runtime: signal received on thread not created by Go.
    runtime: signal received on thread not created by Go.
    Segmentation fault

    It uses CGO and threads, so its not entirely unexpected, but I'm having a
    tough time figuring it out. The last line in an strace before the crash is:

    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621), inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20

    Which is strange, because I don't think I'm doing any IPv6 stuff. Any
    thoughts on how to go about debugging this one? (gdb has been unhelpful so
    far).
    I'd like to know which signal caused the crash, strace should have a line
    for that.

    --
  • Ian Lance Taylor at Nov 27, 2012 at 9:11 pm

    On Tue, Nov 27, 2012 at 12:44 PM, minux wrote:
    On Wed, Nov 28, 2012 at 3:41 AM, Graham Miller wrote:

    I have a Go application that is crashing with:

    runtime: signal received on thread not created by Go.
    runtime: signal received on thread not created by Go.
    Segmentation fault

    It uses CGO and threads, so its not entirely unexpected, but I'm having a
    tough time figuring it out. The last line in an strace before the crash is:

    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621), inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20

    Which is strange, because I don't think I'm doing any IPv6 stuff. Any
    thoughts on how to go about debugging this one? (gdb has been unhelpful so
    far).
    I'd like to know which signal caused the crash, strace should have a line
    for that.
    Please open an issue for that if there isn't one already. Thanks.

    Ian

    --
  • Graham Miller at Nov 28, 2012 at 2:10 pm
    Minux: I'd like to know, too. But I removed a bunch of noise from my
    strace (FUTEX waits, and file IO), and I didn't see anything that indicated
    what signal it was. Do you know what I should look for.

    Ian: I don't really know that I can provide a more detailed bug report than
    what I provided above, is that sufficient?


    On Tue, Nov 27, 2012 at 4:11 PM, Ian Lance Taylor wrote:
    On Tue, Nov 27, 2012 at 12:44 PM, minux wrote:


    On Wed, Nov 28, 2012 at 3:41 AM, Graham Miller <graham.miller@gmail.com>
    wrote:
    I have a Go application that is crashing with:

    runtime: signal received on thread not created by Go.
    runtime: signal received on thread not created by Go.
    Segmentation fault

    It uses CGO and threads, so its not entirely unexpected, but I'm having
    a
    tough time figuring it out. The last line in an strace before the
    crash is:
    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621),
    inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20

    Which is strange, because I don't think I'm doing any IPv6 stuff. Any
    thoughts on how to go about debugging this one? (gdb has been unhelpful
    so
    far).
    I'd like to know which signal caused the crash, strace should have a line
    for that.
    Please open an issue for that if there isn't one already. Thanks.

    Ian
    --
  • Minux at Nov 28, 2012 at 3:12 pm

    On Wednesday, November 28, 2012, Graham Miller wrote:

    Minux: I'd like to know, too. But I removed a bunch of noise from my
    strace (FUTEX waits, and file IO), and I didn't see anything that indicated
    what signal it was. Do you know what I should look for.
    maybe you can just run your program under gdb to see the signal
    received and also what caused the signal.

    strace will record something like this for incoming signals:
    --- SIGILL (Illegal instruction) @ 0 (0) ---

    --
  • Graham Miller at Nov 28, 2012 at 9:31 pm
    So I think what was happening was I was playing around with setting the
    effective UID calling setuid/setgid, which in turn sends a signal to all
    threads, including those that were not created by the Go runtime. I'll
    have to rethink that.

    Thanks for the help.

    graham


    On Wed, Nov 28, 2012 at 10:12 AM, minux wrote:

    On Wednesday, November 28, 2012, Graham Miller wrote:

    Minux: I'd like to know, too. But I removed a bunch of noise from my
    strace (FUTEX waits, and file IO), and I didn't see anything that indicated
    what signal it was. Do you know what I should look for.
    maybe you can just run your program under gdb to see the signal
    received and also what caused the signal.

    strace will record something like this for incoming signals:
    --- SIGILL (Illegal instruction) @ 0 (0) ---
    --
  • Ian Lance Taylor at Nov 28, 2012 at 3:32 pm

    On Wed, Nov 28, 2012 at 6:10 AM, Graham Miller wrote:
    Minux: I'd like to know, too. But I removed a bunch of noise from my strace
    (FUTEX waits, and file IO), and I didn't see anything that indicated what
    signal it was. Do you know what I should look for.

    Ian: I don't really know that I can provide a more detailed bug report than
    what I provided above, is that sufficient?
    Sorry, I meant to open an issue to report the signal number for a bad
    signal, rather than just saying "signal received."

    As far as your actual bug goes, it is most likely a bad pointer
    reference in your C code. I would recommend running your program in
    the debugger to see where it happens.

    Ian

    On Tue, Nov 27, 2012 at 4:11 PM, Ian Lance Taylor wrote:
    On Tue, Nov 27, 2012 at 12:44 PM, minux wrote:


    On Wed, Nov 28, 2012 at 3:41 AM, Graham Miller <graham.miller@gmail.com>
    wrote:
    I have a Go application that is crashing with:

    runtime: signal received on thread not created by Go.
    runtime: signal received on thread not created by Go.
    Segmentation fault

    It uses CGO and threads, so its not entirely unexpected, but I'm having
    a
    tough time figuring it out. The last line in an strace before the
    crash is:

    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621),
    inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20

    Which is strange, because I don't think I'm doing any IPv6 stuff. Any
    thoughts on how to go about debugging this one? (gdb has been unhelpful
    so
    far).
    I'd like to know which signal caused the crash, strace should have a
    line
    for that.
    Please open an issue for that if there isn't one already. Thanks.

    Ian
    --
  • Minux at Nov 28, 2012 at 3:04 pm

    On Wednesday, November 28, 2012, Ian Lance Taylor wrote:
    On Wed, Nov 28, 2012 at 6:10 AM, Graham Miller wrote:
    Minux: I'd like to know, too. But I removed a bunch of noise from my strace
    (FUTEX waits, and file IO), and I didn't see anything that indicated what
    signal it was. Do you know what I should look for.

    Ian: I don't really know that I can provide a more detailed bug report than
    what I provided above, is that sufficient?
    Sorry, I meant to open an issue to report the signal number for a bad
    signal, rather than just saying "signal received."
    this is already fixed at tip.
    http://codereview.appspot.com/6498057

    --
  • Ian Lance Taylor at Nov 28, 2012 at 3:05 pm

    On Wed, Nov 28, 2012 at 7:04 AM, minux wrote:
    On Wednesday, November 28, 2012, Ian Lance Taylor wrote:

    On Wed, Nov 28, 2012 at 6:10 AM, Graham Miller <graham.miller@gmail.com>
    wrote:
    Minux: I'd like to know, too. But I removed a bunch of noise from my
    strace
    (FUTEX waits, and file IO), and I didn't see anything that indicated
    what
    signal it was. Do you know what I should look for.

    Ian: I don't really know that I can provide a more detailed bug report
    than
    what I provided above, is that sufficient?
    Sorry, I meant to open an issue to report the signal number for a bad
    signal, rather than just saying "signal received."
    this is already fixed at tip.
    http://codereview.appspot.com/6498057
    Great. Sorry for the noise--I thought I checked but I guess not.

    Ian

    --
  • Minux at Nov 28, 2012 at 9:03 pm

    On Wednesday, November 28, 2012, Ian Lance Taylor wrote:

    On Wed, Nov 28, 2012 at 7:04 AM, minux <minux.ma@gmail.com <javascript:;>>
    wrote:
    On Wednesday, November 28, 2012, Ian Lance Taylor wrote:
    Sorry, I meant to open an issue to report the signal number for a bad
    signal, rather than just saying "signal received."
    this is already fixed at tip.
    http://codereview.appspot.com/6498057
    Great. Sorry for the noise--I thought I checked but I guess not.
    it turns out i was wrong about that. that cl passed signum to the c routine,
    and ignored SIGPROF but it lacked the printing step. sorry.
    i will prepare a cl.

    --
  • Agl at Nov 27, 2012 at 9:05 pm

    On Tuesday, November 27, 2012 2:41:43 PM UTC-5, gmiller wrote:

    accept(9, {sa_family=AF_INET6, sin6_port=htons(57621), inet_pton(AF_INET6,
    "::ffff:96.232.47.130", &sin6_addr), sin6_flowinfo=0, sin6_scope_id=0},
    [28]) = 20
    Note that this is an IPv4 mapped IPv6 address. I.e. it's actually IPv4
    stuff despite all the signs otherwise.


    Cheers

    AGL

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 27, '12 at 7:42p
activeNov 28, '12 at 9:31p
posts12
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase