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

runtime/race: race detector can call exit more than once on finish #15578

Closed
jmchacon opened this issue May 6, 2016 · 3 comments
Closed

runtime/race: race detector can call exit more than once on finish #15578

jmchacon opened this issue May 6, 2016 · 3 comments
Milestone

Comments

@jmchacon
Copy link

jmchacon commented May 6, 2016

Seen on linux amd64 1.6 (but verified present at tip as well)

When using the race detector and C++ code is linked into the process as well it's possible for 2 threads to call racefini() today which eventually calls __tsan_fini which itself calls the regular C library exit().

Calling exit > 1 times is undefined behavior and means in a C++ program that the static destructors get invoked twice. On a glibc implementation of the exit handlers it also means a double free() occurs when the entry from the exit handlers list is freed upon completion.

@jmchacon
Copy link
Author

jmchacon commented May 6, 2016

I have a CL incoming to address this

@ianlancetaylor ianlancetaylor changed the title race detector can call exit() more than once on finish runtime/race: race detector can call exit more than once on finish May 6, 2016
@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone May 6, 2016
@ianlancetaylor
Copy link
Contributor

CC @dvyukov

@gopherbot
Copy link

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

@golang golang locked and limited conversation to collaborators May 18, 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

3 participants