This is one of the oldest patches made for TSan on Darwin.
It could be wrong, and possibly missing some cases.
Details
Details
- Reviewers
kcc glider dvyukov samsonov kubamracek
Diff Detail
Diff Detail
Event Timeline
Comment Actions
IsGlobalData is used only to detect global mutexes.
We use so-called "linker initialized" mutexes as global vars so that they are not subject to initialization and exit races:
https://code.google.com/p/chromium/codesearch#search/&q=LINKER_INITIALIZED&sq=package:chromium&type=cs
But we failed to fit an additional bit into mutex state to explicitly track such mutexes, so now tsan just conservatively assumes that all mutexes are linked-initialized.
I guess we need only SECT_DATA/SECT_COMMON as a mutex cannot be in a const section.
This can also improve performance for some programs.
Also this all must be #ifndef SANITIZER_GO. In fact, whole IsGlobalVar function is not needed for Go.
lib/tsan/rtl/tsan_platform_mac.cc | ||
---|---|---|
43 | Please keep the list of includes sorted alphabetically. |
Please keep the list of includes sorted alphabetically.