Timur Iskhodzhanov
92702d8401
[ASan] Remove the explicit function prototypes for intercepted functions on Windows
...
llvm-svn: 190411
2013-09-10 14:42:15 +00:00
Reid Kleckner
0071525492
asan: Add a wcslen interceptor mirroring strlen
...
Tested on Linux, since I can't build the tests on Windows yet.
llvm-svn: 190022
2013-09-05 01:13:49 +00:00
Alexey Samsonov
646ec67e25
Disable init-order checking before destructors are run.
...
We don't want to report initialization-order bugs when a destructor of a global
variable accesses dynamically initialized global from another
(not necessarily initialized) module. We do this by intercepting __cxa_atexit and
registrering our own callback that unpoisons shadow for all dynamically initialized
global variables.
llvm-svn: 182637
2013-05-24 11:46:56 +00:00
Dmitry Vyukov
6f4b34bcf4
asan/tsan: move strcasecmp() interceptor to sanitizer_common
...
llvm-svn: 178010
2013-03-26 12:40:23 +00:00
Evgeniy Stepanov
0af672326a
[sanitizer] Replace more platform checks with SANITIZER_ constants.
...
llvm-svn: 177400
2013-03-19 14:33:38 +00:00
Alexey Samsonov
3a6b6b9d55
[Sanitizer] Don't intercept frexpf and frexpl on Windows. Add frexp declaration to asan_intercepted_functions.h
...
llvm-svn: 177155
2013-03-15 14:02:21 +00:00
Kostya Serebryany
1d63d13ce2
[asan] move the .preinit_array hack into a separate file (added used attribute)
...
llvm-svn: 175871
2013-02-22 07:51:26 +00:00
Alexander Potapenko
1615f193eb
[ASan] Declare CreateThread as extern "C" to fix the Windows build.
...
llvm-svn: 175760
2013-02-21 15:32:50 +00:00
Alexander Potapenko
b8135a8a6b
[ASan] Put several function prototypes back under #ifdef _WIN32 to fix the Windows build.
...
llvm-svn: 175743
2013-02-21 15:10:03 +00:00
Alexander Potapenko
e8ba1c851a
[ASan] Refactoring: nuke the redundant function declarations in asan_intercepted_functions.h
...
that had been used on OS X only.
The INTERCEPTOR() macro on OS X is now responsible for declaring the wrapped function, the wrapper and the
pair of pointers to them in __DATA,__interposition section. Thus adding an interceptor requires editing a single file now.
llvm-svn: 175740
2013-02-21 14:41:16 +00:00
Alexander Potapenko
70b01558f1
[ASan] Delete asan/dynamic dir and temporarily move the interposers declarations to asan_intercepted_functions.h
...
Now that we have only one dependency on asan_intercepted_functions.h, we can unite that code with the interceptors declarations in asan_interceptors.cc and get rid of asan_intercepted_functions.h
llvm-svn: 175631
2013-02-20 15:46:02 +00:00
Evgeniy Stepanov
ea61d08185
[sanitizer] Add interceptors for localtime and friends.
...
llvm-svn: 175499
2013-02-19 09:19:16 +00:00
Evgeniy Stepanov
a73704c0f8
[asan] Add new __isoc99_*scanf to ASan intercepted functions list.
...
llvm-svn: 174965
2013-02-12 12:45:29 +00:00
Alexander Potapenko
09aba10499
[ASan] fix the interceptor for siglongjmp. As we're using dylib interposition, we must intercept both siglongjmp and longjmp on Darwin.
...
llvm-svn: 174510
2013-02-06 15:45:43 +00:00
Alexander Potapenko
34157fc33f
[ASan] Delete the code related to static runtime on OS X.
...
Nuke lib/interception/mach_override.
llvm-svn: 174383
2013-02-05 15:57:12 +00:00
Alexander Potapenko
56a3724cf1
[ASan] fix compilation on Mac by adding a missing pwrite parameter.
...
llvm-svn: 173333
2013-01-24 09:15:08 +00:00
Alexander Potapenko
cae42d23a6
[ASan] Use dylib interposition to hook memory allocation in the dynamic runtime.
...
This CL drastically simplifies the way we're hooking the memory allocation routines in ASan on Mac by using dylib interposition to replace the main malloc_zone_* functions. This allows us to avoid replacing the default CFAllocator and drop the CF dependency at all.
Committing this patch will result in the static runtime being broken. A follow-up CL will switch ASan to use the dynamic runtime library.
llvm-svn: 173134
2013-01-22 09:14:54 +00:00
Alexey Samsonov
6ad1d7809d
ASan: build unit tests with -fsanitize-address-zero-base-shadow on Linux and Android
...
llvm-svn: 173021
2013-01-21 10:51:18 +00:00
Evgeniy Stepanov
f940b2e381
[asan] Move *scanf declarations out of mac-only section.
...
llvm-svn: 173020
2013-01-21 10:33:14 +00:00
Evgeniy Stepanov
01671c33ff
[sanitizer] lint
...
llvm-svn: 172817
2013-01-18 13:12:56 +00:00
Alexander Potapenko
a6d40f638e
[ASan] Fix compilation on Mac.
...
llvm-svn: 172810
2013-01-18 12:31:16 +00:00
Evgeniy Stepanov
91181eaa59
[sanitizer] Fix Mac build.
...
llvm-svn: 172809
2013-01-18 11:38:23 +00:00
Kostya Serebryany
69fe0ba415
[sanitizer] reapply r172719, r172721-172723, r172725, and also fix the warning on Mac.
...
llvm-svn: 172791
2013-01-18 06:43:13 +00:00
Jakob Stoklund Olesen
7956e0094d
Revert r172719, r172721-172723, and r172725.
...
The r172719 patch broke the build on Mac, the others depended on it.
compiler-rt/lib/asan/asan_interceptors.cc:78:13: error: unused function
'SetThreadName' [-Werror,-Wunused-function]
static void SetThreadName(const char *name) {
Orignal headlines:
[asan] attempting to fix the Mac build
[asan] restructure read/pread/pread64 tests
[sanitizer] move write/pwrite/pwrite64 interceptors to common
[msan] start using common interceptors in msan
[tsan] move prctl interceptor from asan to common_interceptors thus enabling it for tsan too
llvm-svn: 172763
2013-01-17 22:51:56 +00:00
Kostya Serebryany
87eb229241
[asan] attempting to fix the Mac build
...
llvm-svn: 172725
2013-01-17 15:14:20 +00:00
Kostya Serebryany
f7f5566055
[tsan] move prctl interceptor from asan to common_interceptors thus enabling it for tsan too
...
llvm-svn: 172719
2013-01-17 13:38:16 +00:00
Alexey Samsonov
5a26e1fbf2
[Sanitizer] Add new header - sanitizer_platform_interceptors.h, which should define whether or not given function should be intercepted on a given platform.
...
llvm-svn: 170115
2012-12-13 08:50:16 +00:00
Alexey Samsonov
447e2f2f19
[ASan] one more macro for 'read' interception
...
llvm-svn: 170114
2012-12-13 08:36:13 +00:00
Alexey Samsonov
65c14f5314
[ASan] more macro for conditional interception of pread functions
...
llvm-svn: 170112
2012-12-13 08:10:23 +00:00
Kostya Serebryany
07bb3925b0
[sanitizer] replace size_t with SIZE_T in interceptors (same for ssize_t, off_t and off64_t). This is done to avoid confusion and to make the code work with compilers that define size_t w/o any includes (MSVC)
...
llvm-svn: 170103
2012-12-13 06:31:40 +00:00
Kostya Serebryany
eec22a628b
[asan] fix the Android build (pread64 interceptor again)
...
llvm-svn: 170098
2012-12-13 05:27:08 +00:00
Kostya Serebryany
e29883c10a
[sanitizer] add OnMap/OnUmap callbacks to the allocator interface
...
llvm-svn: 169985
2012-12-12 14:32:18 +00:00
Alexander Potapenko
ada2fbd2d4
[ASan] fix compilation on Mac.
...
llvm-svn: 169969
2012-12-12 11:52:26 +00:00
Alexey Samsonov
fa94fa52ad
ASan: intercept prctl on Linux only
...
llvm-svn: 169616
2012-12-07 17:54:38 +00:00
Alexander Potapenko
0dcd6d9468
[ASan] Do not build the interceptors that use ObjC blocks if the compiler does not support blocks.
...
Need to define MISSING_BLOCKS_SUPPORT in this case at buildtime.
Patch by Jack Howarth <howarth@bromo.med.uc.edu>
llvm-svn: 169206
2012-12-04 02:41:47 +00:00
Alexey Samsonov
aac36b345a
[ASan] intercept swapcontext on Linux only
...
llvm-svn: 168509
2012-11-23 10:14:44 +00:00
Alexey Samsonov
0d7755ccb5
[ASan] Add interceptor for swapcontext to fight with false positives in some of its use cases.
...
llvm-svn: 168508
2012-11-23 09:46:34 +00:00
Alexander Potapenko
35bc23ce58
Fix two compiler warnings: must use at least one argument for "..." in a variadic macros, signed vs. unsigned comparison.
...
llvm-svn: 163314
2012-09-06 13:31:13 +00:00
Alexander Potapenko
2ebe619340
Re-implement the wrappers for libdispatch functions using blocks where appropriate
...
(kudos to Anna Zaks for a good example).
This simplifies the code much and lets us not implement internal parts of libdispatch.
All ASan tests from t32 and t64 should pass with the dylib runtime now.
llvm-svn: 162439
2012-08-23 09:34:40 +00:00
Alexander Potapenko
02e6f03236
Dynamic interceptors for dispatch_async and dispatch_after.
...
llvm-svn: 162202
2012-08-20 11:59:26 +00:00
Alexander Potapenko
4a156c1b80
Fix a leftover #if defined(DYNAMIC_MAC_WRAPPERS).
...
llvm-svn: 162197
2012-08-20 08:49:49 +00:00
Alexander Potapenko
cfb2a6b074
Remove the extra semicolon reported by the buildbot.
...
llvm-svn: 161954
2012-08-15 15:59:18 +00:00
Alexander Potapenko
f6344ffe39
Introduce asan_intercepted_functions.h which contains the declarations wrapped functions and their wrappers.
...
Those declarations are going to be shared between asan_interceptors.cc and the dynamic runtime library on Mac OS.
llvm-svn: 161952
2012-08-15 15:24:48 +00:00