Skip to content

misc/cgo/testsanitizers: fails on ubuntu 16.04 pre-release #15185

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mwhudson opened this issue Apr 8, 2016 · 3 comments
Closed

misc/cgo/testsanitizers: fails on ubuntu 16.04 pre-release #15185

mwhudson opened this issue Apr 8, 2016 · 3 comments
Milestone

Comments

@mwhudson
Copy link
Contributor

mwhudson commented Apr 8, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?

go version devel +68ac1f7 Thu Apr 7 21:39:32 2016 +0000 linux/amd64

  1. What operating system and processor architecture are you using (go env)?

ubuntu@ip-172-31-28-54:~/go/src$ ../bin/go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/home/ubuntu/go"
GOTOOLDIR="/home/ubuntu/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build979798221=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

  1. What did you do?

go tool dist test -run sanitizers

  1. What did you expect to see?

Tests passing

  1. What did you see instead?
ubuntu@ip-172-31-28-54:~/go/src$ go tool dist test -run sanitizers

##### ../misc/cgo/testsanitizers
skipping msan tests: -fsanitize=memory not supported
==================
WARNING: ThreadSanitizer: data race (pid=24394)
  Write of size 4 at 0x0000006acf78 by thread T3:
    #0 setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan.go:22 (tsan+0x000000445360)
    #1 _cgo_82605fb7dc7c_Cfunc_setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan.go:96 (tsan+0x0000004453e1)
    #2 runtime.asmcgocall <null> (tsan+0x00000044268f)

  Previous write of size 4 at 0x0000006acf78 by main thread:
    #0 setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan.go:22 (tsan+0x000000445360)
    #1 _cgo_82605fb7dc7c_Cfunc_setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan.go:96 (tsan+0x0000004453e1)
    #2 runtime.asmcgocall <null> (tsan+0x00000044268f)

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

  Thread T3 (tid=24398, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x000000027577)
    #1 _cgo_sys_thread_start /home/ubuntu/go/src/runtime/cgo/gcc_linux_amd64.c:73 (tsan+0x000000445761)

SUMMARY: ThreadSanitizer: data race /home/ubuntu/go/misc/cgo/testsanitizers/tsan.go:22 setVal
==================
FAIL: tsan
==================
WARNING: ThreadSanitizer: data race (pid=24480)
  Write of size 4 at 0x0000006aded8 by thread T3:
    #0 setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan2.go:32 (tsan2+0x000000445440)
    #1 _cgo_b3c556dc7343_Cfunc_setVal /home/ubuntu/go/misc/cgo/testsanitizers/tsan2.go:106 (tsan2+0x0000004455d1)
    #2 runtime.asmcgocall <null> (tsan2+0x00000044279f)

  Previous write of size 4 at 0x0000006aded8 by main thread:
    #0 run /home/ubuntu/go/misc/cgo/testsanitizers/tsan2.go:24 (tsan2+0x0000004454c9)
    #1 _cgo_b3c556dc7343_Cfunc_run /home/ubuntu/go/misc/cgo/testsanitizers/tsan2.go:92 (tsan2+0x00000044557d)
    #2 runtime.asmcgocall <null> (tsan2+0x00000044279f)

  Location is global '<null>' of size 0 at 0x000000000000 (tsan2+0x0000006aded8)

  Thread T3 (tid=24484, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x000000027577)
    #1 _cgo_sys_thread_start /home/ubuntu/go/src/runtime/cgo/gcc_linux_amd64.c:73 (tsan2+0x000000445951)

SUMMARY: ThreadSanitizer: data race /home/ubuntu/go/misc/cgo/testsanitizers/tsan2.go:32 setVal
==================
FAIL: tsan2
2016/04/08 00:37:19 Failed: exit status 1
2016/04/08 00:37:19 FAILED
@bradfitz bradfitz added this to the Go1.7 milestone Apr 8, 2016
@mwhudson
Copy link
Contributor Author

mwhudson commented Apr 8, 2016

In case it's relevant:

ubuntu@ip-172-31-28-54:~/go/src$ gcc --version
gcc (Ubuntu 5.3.1-13ubuntu4) 5.3.1 20160405
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@dvyukov dvyukov assigned ianlancetaylor and unassigned dvyukov Apr 8, 2016
@dvyukov
Copy link
Member

dvyukov commented Apr 8, 2016

In src/cmd/cgo/out.go we do:

#if defined(__has_feature)
#if __has_feature(thread_sanitizer)
#undef _cgo_tsan_acquire
#undef _cgo_tsan_release

As far as I know gcc does not support __has_feature feature.

@ALTree
Copy link
Member

ALTree commented Apr 8, 2016

This is #14602

@dvyukov dvyukov closed this as completed Apr 8, 2016
@golang golang locked and limited conversation to collaborators Apr 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants