DescriptionThe idea of this patch is as follows.
Consider that a user program defines own function read(), and Asan intercepts read() as well. Currently we get 'duplicate symbol' linker error in this case. With this patch it's possible to successfully link and detect the situation in run-time.
For example, here is how Tsanv2 output looks on a hypothetical program that refines own read() and write():
$ tests/tsan_test
ThreadSanitizer: failed to intercept 'read' function
ThreadSanitizer: failed to intercept 'write' function
[==========] Running 58 tests from 11 test cases.
[----------] Global test environment set-up.
...
The trick is to make the interceptors weak symbols + a bit of compiler magic to detect interception failure.
P.s. the patch changes names of interceptors on Linux from e.g. read() to interception_wrap_read().
Patch Set 1 #
Total comments: 5
MessagesTotal messages: 5
|