Skip to content
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

misc/cgo/testsanitizers: fails on Ubuntu 16.10 #15887

Closed
mwhudson opened this issue May 30, 2016 · 4 comments
Closed

misc/cgo/testsanitizers: fails on Ubuntu 16.10 #15887

mwhudson opened this issue May 30, 2016 · 4 comments

Comments

@mwhudson
Copy link
Contributor

I assume this is our usual friend, PIE-by-default:

ubuntu@yakkety:~/go$ go tool dist test -run testsanitizers

##### ../misc/cgo/testsanitizers
skipping msan tests: -fsanitize=memory not supported
FATAL: ThreadSanitizer: unexpected memory mapping 0x5620a8a10000-0x5620a8ae1000
exit status 66
FAIL: tsan
FATAL: ThreadSanitizer: unexpected memory mapping 0x55a9d17a7000-0x55a9d1878000
exit status 66
FAIL: tsan2
FATAL: ThreadSanitizer: unexpected memory mapping 0x559e976a5000-0x559e97775000
exit status 66
FAIL: tsan3
2016/05/30 02:56:37 Failed: exit status 1
2016/05/30 02:56:37 FAILED
@ianlancetaylor ianlancetaylor added this to the Go1.7Maybe milestone May 30, 2016
@ianlancetaylor
Copy link
Contributor

@dvyukov Does TSAN work with PIE?

@dvyukov dvyukov modified the milestones: Go1.8, Go1.7Maybe May 31, 2016
@dvyukov dvyukov self-assigned this May 31, 2016
@dvyukov
Copy link
Member

dvyukov commented May 31, 2016

TSAN works with -pie, but not on newer linux kernels -- they constantly shuffle process address space, we can't keep up. We have the same issue for C/C++ (google/sanitizers#503). This won't happen for 1.7, I have no idea how to fix it.

mwhudson added a commit to mwhudson/go that referenced this issue May 31, 2016
golang.org/issue/15443 complained that a race-enabled PIE binary crashed at
startup, but other ways of linking in tsan (or other sanitizers) such as

 #cgo CFLAGS: -fsanitize=thread
 #cgo LDFLAGS: -fsanitize=thread

have the same problem. Pass -no-pie to the host linker (if supported) if any
-fsanitizer=foo cgo LDFLAG is seen when linking.

Fixes golang#15887

Change-Id: Id799770f8d045f6f40fa8c463563937a5748d1a8
@mwhudson
Copy link
Contributor Author

That suggests something like https://go-review.googlesource.com/#/c/23535/ then (which does fix this issue).

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/23535 mentions this issue.

@golang golang locked and limited conversation to collaborators May 31, 2017
@rsc rsc unassigned dvyukov Jun 23, 2022
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

4 participants