NPTL implementation of pthread_cond has 2 versions -- 2.2.5 and 2.3.2. pthread_cond_t has different sizes in these versions, so we can't simply always call real 2.3.2 functions. Previously we struggled with this by means of various hacks (always call new version; allocate a satellite object large enough for new version; added flag that enables/disables the previous behavior; and probably other options).
This is an attempt to solve this problem once and for all. The patch adds 2 versions of interceptors, so that we know when to call old real functions and when to call new real function.
The main downside is that linking of shared libraries with xsan runtime now requires version script. This mode (linking of xsan runtime into shared libs) is generally unsupported, but we use it in some custom setups (e.g. build an instrumented shared C++ library and load it into Python/R/Java process). That usages will require the provided version script.
Better suggestions are welcome.
Details
Diff Detail
Event Timeline
This patch doesn't seem to fix Chromium GPU hangs for me. Will double-check.
lib/asan/CMakeLists.txt | ||
---|---|---|
167 | Is this condition true for OSX? You don't need your version script there. | |
lib/interception/interception_linux.h | ||
38 | It's unclear what does "single" stand for here. Can you please add comments for both INTERCEPT_FUNCTION_VER_SINGLE and INTERCEPT_FUNCTION_VER? | |
lib/sanitizer_common/sanitizer.ver | ||
1 | Can you please add a comment describing what this script is for and who needs to use it? | |
2 | How about naming the file "sanitizer_linux.ver"? It's Linux-only, right? | |
6 | nit: spare newline | |
lib/sanitizer_common/sanitizer_common_interceptors.inc | ||
2667 | I suggest putting the function parameter on a separate line and/or adding a typedef for it (here and below) | |
lib/sanitizer_common/sanitizer_internal_defs.h | ||
151 | RHS of definitions in this file aren't horizontally aligned, except for thread and builtin_expect. | |
lib/tsan/Makefile.old | ||
2 | Is -lrt related to this CL? If no, please commit separately. | |
test/tsan/runtime_in_shared_lib.cc | ||
29 | nit: spare newline |
We've decided to abandon this.
There is no way to have versioned symbols in executable. See:
https://code.google.com/p/thread-sanitizer/issues/detail?id=58
Is this condition true for OSX? You don't need your version script there.