FAQ
I'm building my service without CGO, so ideally, I'd like to run my tests
with the same settings, and I really like race detection. Is there any way
to use the race detector with CGO_ENABLED=0?

# testmain
runtime/race(.text): __libc_malloc: not defined
runtime/race(.text): getuid: not defined
runtime/race(.text): pthread_self: not defined
runtime/race(.text): madvise: not defined
runtime/race(.text): sleep: not defined
runtime/race(.text): usleep: not defined
runtime/race(.text): abort: not defined
runtime/race(.text): isatty: not defined
runtime/race(.text): __libc_free: not defined
runtime/race(.text): getrlimit: not defined
runtime/race(.text): __libc_stack_end: not defined
runtime/race(.text): getrlimit: not defined
runtime/race(.text): setrlimit: not defined
runtime/race(.text): setrlimit: not defined
runtime/race(.text): setrlimit: not defined
runtime/race(.text): exit: not defined
runtime/race(.text.unlikely): __errno_location: not defined
runtime/race(.text): undefined: __libc_malloc
runtime/race(.text): undefined: getuid
runtime/race(.text): undefined: pthread_self
runtime/race(.text): undefined: madvise
too many errors

--
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/d/optout.

Search Discussions

  • Dave Cheney at Feb 18, 2015 at 3:15 am
    The race detector needs cgo, the race detector lives in a .so that provides
    those missing symbols.

    The simplest solution may be to modify your go install to always use the
    pure go resolver, look for the // +build netgo tags, and remove "linux"
    from the version that uses cgo, this should let you have both cgo an the
    pure Go resolver, and thus the race detector at the same time.
    On Wednesday, 18 February 2015 08:09:22 UTC+11, Blake Caldwell wrote:

    I'm building my service without CGO, so ideally, I'd like to run my tests
    with the same settings, and I really like race detection. Is there any way
    to use the race detector with CGO_ENABLED=0?

    # testmain
    runtime/race(.text): __libc_malloc: not defined
    runtime/race(.text): getuid: not defined
    runtime/race(.text): pthread_self: not defined
    runtime/race(.text): madvise: not defined
    runtime/race(.text): sleep: not defined
    runtime/race(.text): usleep: not defined
    runtime/race(.text): abort: not defined
    runtime/race(.text): isatty: not defined
    runtime/race(.text): __libc_free: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): __libc_stack_end: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): exit: not defined
    runtime/race(.text.unlikely): __errno_location: not defined
    runtime/race(.text): undefined: __libc_malloc
    runtime/race(.text): undefined: getuid
    runtime/race(.text): undefined: pthread_self
    runtime/race(.text): undefined: madvise
    too many errors
    --
    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/d/optout.
  • Dmitry Vyukov at Feb 18, 2015 at 7:06 am
    Yes, unfortunately it does not work now.
    I have this in plans for a long time. Filed:
    https://github.com/golang/go/issues/9918


    On Wed, Feb 18, 2015 at 12:09 AM, Blake Caldwell wrote:
    I'm building my service without CGO, so ideally, I'd like to run my tests
    with the same settings, and I really like race detection. Is there any way
    to use the race detector with CGO_ENABLED=0?

    # testmain
    runtime/race(.text): __libc_malloc: not defined
    runtime/race(.text): getuid: not defined
    runtime/race(.text): pthread_self: not defined
    runtime/race(.text): madvise: not defined
    runtime/race(.text): sleep: not defined
    runtime/race(.text): usleep: not defined
    runtime/race(.text): abort: not defined
    runtime/race(.text): isatty: not defined
    runtime/race(.text): __libc_free: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): __libc_stack_end: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): exit: not defined
    runtime/race(.text.unlikely): __errno_location: not defined
    runtime/race(.text): undefined: __libc_malloc
    runtime/race(.text): undefined: getuid
    runtime/race(.text): undefined: pthread_self
    runtime/race(.text): undefined: madvise
    too many errors

    --
    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/d/optout.
    --
    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/d/optout.
  • Blake Caldwell at Feb 18, 2015 at 4:56 pm
    Thanks guys!
    On Tuesday, February 17, 2015 at 4:09:22 PM UTC-5, Blake Caldwell wrote:

    I'm building my service without CGO, so ideally, I'd like to run my tests
    with the same settings, and I really like race detection. Is there any way
    to use the race detector with CGO_ENABLED=0?

    # testmain
    runtime/race(.text): __libc_malloc: not defined
    runtime/race(.text): getuid: not defined
    runtime/race(.text): pthread_self: not defined
    runtime/race(.text): madvise: not defined
    runtime/race(.text): sleep: not defined
    runtime/race(.text): usleep: not defined
    runtime/race(.text): abort: not defined
    runtime/race(.text): isatty: not defined
    runtime/race(.text): __libc_free: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): __libc_stack_end: not defined
    runtime/race(.text): getrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): setrlimit: not defined
    runtime/race(.text): exit: not defined
    runtime/race(.text.unlikely): __errno_location: not defined
    runtime/race(.text): undefined: __libc_malloc
    runtime/race(.text): undefined: getuid
    runtime/race(.text): undefined: pthread_self
    runtime/race(.text): undefined: madvise
    too many errors
    --
    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/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 17, '15 at 9:09p
activeFeb 18, '15 at 4:56p
posts4
users3
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase