Skip to content

cmd/cgo: ThreadSanitizer barks about data races in all.bash #14602

Closed
@ALTree

Description

@ALTree

go version devel +b83f397 Wed Mar 2 19:32:41 2016 +0000 linux/amd64

I'm seeing this on tip:

##### ../misc/cgo/testasan

##### ../misc/cgo/testsanitizers
skipping msan tests: -fsanitize=memory not supported
==================
WARNING: ThreadSanitizer: data race (pid=2282)
  Write of size 4 at 0x0000006d20b8 by thread T2:
    #0 setVal /home/alberto/go/misc/cgo/testsanitizers/tsan.go:22 (tsan+0x00000044b9b0)
    #1 _cgo_82605fb7dc7c_Cfunc_setVal /home/alberto/go/misc/cgo/testsanitizers/tsan.go:96 (tsan+0x00000044ba31)
    #2 runtime.asmcgocall <null> (tsan+0x00000044782f)

  Previous write of size 4 at 0x0000006d20b8 by main thread:
    #0 setVal /home/alberto/go/misc/cgo/testsanitizers/tsan.go:22 (tsan+0x00000044b9b0)
    #1 _cgo_82605fb7dc7c_Cfunc_setVal /home/alberto/go/misc/cgo/testsanitizers/tsan.go:96 (tsan+0x00000044ba31)
    #2 runtime.asmcgocall <null> (tsan+0x00000044782f)

  Location is global 'val' of size 4 at 0x0000006d20b8 (tsan+0x0000006d20b8)

  Thread T2 (tid=2285, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x000000026e74)
    #1 _cgo_sys_thread_start /home/alberto/go/src/runtime/cgo/gcc_linux_amd64.c:75 (tsan+0x00000044bd3e)

SUMMARY: ThreadSanitizer: data race /home/alberto/go/misc/cgo/testsanitizers/tsan.go:22 setVal
==================
FAIL: tsan
==================
WARNING: ThreadSanitizer: data race (pid=2412)
  Write of size 4 at 0x0000006d2018 by thread T2:
    #0 setVal /home/alberto/go/misc/cgo/testsanitizers/tsan2.go:32 (tsan2+0x00000044ba90)
    #1 _cgo_b3c556dc7343_Cfunc_setVal /home/alberto/go/misc/cgo/testsanitizers/tsan2.go:106 (tsan2+0x00000044bc01)
    #2 runtime.asmcgocall <null> (tsan2+0x00000044793f)

  Previous write of size 4 at 0x0000006d2018 by main thread:
    #0 run /home/alberto/go/misc/cgo/testsanitizers/tsan2.go:24 (tsan2+0x00000044baf9)
    #1 _cgo_b3c556dc7343_Cfunc_run /home/alberto/go/misc/cgo/testsanitizers/tsan2.go:92 (tsan2+0x00000044bbad)
    #2 runtime.asmcgocall <null> (tsan2+0x00000044793f)

  Location is global 'val' of size 4 at 0x0000006d2018 (tsan2+0x0000006d2018)

  Thread T2 (tid=2416, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x000000026e74)
    #1 _cgo_sys_thread_start /home/alberto/go/src/runtime/cgo/gcc_linux_amd64.c:75 (tsan2+0x00000044bf0e)

SUMMARY: ThreadSanitizer: data race /home/alberto/go/misc/cgo/testsanitizers/tsan2.go:32 setVal
==================
FAIL: tsan2
2016/03/02 20:59:43 Failed: exit status 1
$ uname -a
Linux gauss 4.3.0-1-amd64 #1 SMP Debian 4.3.5-1 (2016-02-06) x86_64 GNU/Linux
$ gcc --version
gcc (Debian 5.3.1-8) 5.3.1 20160205

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions