Kuba Brecka
9a18c3016c
Fix ASan's Noinst unit tests
...
We currently skip all "Noinst" unit tests on OS X, which was probably caused when we removed the "allow_reexec" flag. The MaybeReexec function fails to re-execute when the runtime is linked statically, because there is no dylib to use. This patch adds an explicit DisableReexec function that is used from asan_noinst_test.cc and the runtime then doesn't try to re-execute.
Reviewed at http://reviews.llvm.org/D7493
llvm-svn: 228740
2015-02-10 20:37:57 +00:00
Viktor Kutuzov
9b75b757de
[Asan] Pack signal context into a structure
...
Differential Revision: http://reviews.llvm.org/D6148
llvm-svn: 222756
2014-11-25 13:00:21 +00:00
Timur Iskhodzhanov
651725e191
[ASan/Win] Fix PR20918 -- SEH handler doesn't work with the MD runtime
...
llvm-svn: 217679
2014-09-12 14:01:30 +00:00
Timur Iskhodzhanov
220ddacf8d
[ASan/Win] Land the trivial bits of -MD RTL support (PR20214)
...
llvm-svn: 216265
2014-08-22 12:38:07 +00:00
Timur Iskhodzhanov
19853dd28c
[ASan/Win] Catch NULL derefs and page faults
...
Reviewed at http://reviews.llvm.org/D4471
llvm-svn: 212807
2014-07-11 11:57:41 +00:00
Alexey Samsonov
56b6ee9833
[ASan] Optional support for dynamic ASan runtime on Linux.
...
Based on http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov!
llvm-svn: 205308
2014-04-01 13:16:30 +00:00
Alexander Potapenko
ea4a0dbb8d
[ASan] Implement __sanitizer::InstallDeadlySignalHandlers() and __asan::AsanOnSIGSEGV() on Windows.
...
llvm-svn: 200554
2014-01-31 15:11:11 +00:00
Alexander Potapenko
789e3e1b7c
[ASan] Move the SIGSEGV/SIGBUS handling to sanitizer_common
...
This change is a part of refactoring intended to have common signal handling behavior in all tools.
This particular CL moves InstallSignalHandlers() into sanitizer_common (making it InstallDeadlySignalHandlers()), but doesn't enable default signal handlers for any tool other than ASan.
llvm-svn: 200542
2014-01-31 13:10:07 +00:00
Alexander Potapenko
d8d490ed50
[ASan] Move the sigaltstack() bits to sanitizer_common.
...
This change is a part of refactoring intended to have common signal handling behavior in all tools.
Note that this particular change doesn't enable use_sigaltstack support in every tool.
llvm-svn: 200310
2014-01-28 11:12:29 +00:00
Timur Iskhodzhanov
1c84bd64db
[Sanitizer] Implement Symbolizer class on Windows
...
llvm-svn: 197571
2013-12-18 14:29:16 +00:00
Sergey Matveev
da9f5e7e7f
[asan] Improve thread lifetime tracking on POSIX systems.
...
Call AsanThread::Destroy() from a late-running TSD destructor.
Previously we called it before any user-registered TSD destructors, which caused
false positives in LeakSanitizer.
llvm-svn: 192585
2013-10-14 12:01:05 +00:00
Timur Iskhodzhanov
e2b207cfd2
[ASan] Fix a compile-time warning
...
llvm-svn: 191189
2013-09-23 11:19:43 +00:00
Timur Iskhodzhanov
d6c93c7b4d
[ASan] Add DLL thunks for the new stack UAR interface
...
llvm-svn: 191188
2013-09-23 11:05:41 +00:00
Sergey Matveev
af179b8d63
[sanitizer] Move GetStackTrace from ASan to sanitizer_common.
...
llvm-svn: 181424
2013-05-08 12:45:55 +00:00
Evgeniy Stepanov
95eaa21637
[sanitizer] More renamed macros.
...
llvm-svn: 177401
2013-03-19 14:54:17 +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
4f1885a109
[ASan] minor changes to swapcontext handling: don't clear shadow memory if context stack is too large
...
llvm-svn: 172727
2013-01-17 15:45:28 +00:00
Dmitry Vyukov
f22982bf0a
asan/tsan: move blocking mutex from asan to sanitizer_common
...
llvm-svn: 172380
2013-01-14 07:51:39 +00:00
Dmitry Vyukov
a40a805f30
asan: fix FIXME on windows
...
llvm-svn: 172226
2013-01-11 17:57:24 +00:00
Kostya Serebryany
060bfab568
[asan] fix win build
...
llvm-svn: 170119
2012-12-13 10:03:50 +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
Alexey Samsonov
298e237d7e
[ASan] Add extern C for __asan_symbolize on Windows
...
llvm-svn: 165003
2012-10-02 12:35:42 +00:00
Alexey Samsonov
e29c6731aa
[Sanitizer/ASan] Simplify the code that prints and symbolizes stack traces. Fall back to module+offset if user-provided symbolizer failed. Use weak function __asan_symbolize instead of __asan_set_symbolize_callback in ASan interface, so that we're able to symbolize reports for errors that happen before the main() is called, for example, during module initialization.
...
llvm-svn: 165000
2012-10-02 12:11:17 +00:00
Kostya Serebryany
27dcb2379f
[asan] fix Windows build
...
llvm-svn: 162758
2012-08-28 14:14:30 +00:00
Kostya Serebryany
6b0d775229
[asan] some renaming before we move StackTrace into sanitizer_common
...
llvm-svn: 162747
2012-08-28 11:54:30 +00:00
Alexander Potapenko
fefc1e989c
If the program is linked to a dynamic ASan runtime which is not present in DYLD_INSERT_LIBRARIES
...
(which, in turn, is required for our interceptors to take effect), re-exec the program with
DYLD_INSERT_LIBRARIES set.
llvm-svn: 162547
2012-08-24 09:22:05 +00:00
Alexey Samsonov
a85b6b8154
[ASan] get rid of ASAN_USE_EXTERNAL_SYMBOLIZER compiler def in favor of __asan_set_symbolize_callback interface function. Now the user doesn't have to recompile ASan runtime to provide its own symbolizer
...
llvm-svn: 162358
2012-08-22 13:31:37 +00:00
Alexander Potapenko
51e6488b31
Intercept CFAllocator for each thread in the program.
...
Test that child threads use the ASan allocator, that allocated memory can be passed to another thread and deallocated on it.
This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=81
llvm-svn: 160630
2012-07-23 14:07:58 +00:00
Alexey Samsonov
e1cb524226
[Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)
...
llvm-svn: 158710
2012-06-19 09:21:57 +00:00
Alexey Samsonov
40e5128412
[Sanitizer] move ShadowRangeIsAvailable and several defines to common runtime
...
llvm-svn: 158499
2012-06-15 07:29:14 +00:00
Alexey Samsonov
e4a889866d
[Sanitizer] move atomic ops, min/max and sort to commnon runtime
...
llvm-svn: 158496
2012-06-15 07:00:31 +00:00
Alexey Samsonov
70afb91636
[Sanitizer] move more portability wrappers to common runtime: sleep, _exit, abort, atexit, pthread_self
...
llvm-svn: 158493
2012-06-15 06:37:34 +00:00
Alexey Samsonov
ae1e171b72
[Sanitizer] move DumpProcessMap and DisableCoreDumper to common runtime
...
llvm-svn: 158490
2012-06-15 06:08:19 +00:00
Alexey Samsonov
c70d1086f6
[Sanitizer] move rest of mmap routines to common sanitizer runtime
...
llvm-svn: 158452
2012-06-14 14:42:58 +00:00
Alexey Samsonov
0c53a38abb
[Sanitizer] move portable GetEnv to common sanitizer runtime
...
llvm-svn: 158451
2012-06-14 14:07:21 +00:00
Alexey Samsonov
52f946611f
[ASan] don't include deleted header
...
llvm-svn: 158448
2012-06-14 13:15:45 +00:00
Alexey Samsonov
4b1f1031e6
[Sanitizer] factor out GetThreadStackTopAndBottom from ASan runtime to common.
...
llvm-svn: 158140
2012-06-07 07:13:46 +00:00
Alexey Samsonov
40d5b772e5
[Sanitizer] Switch to common mmap/munmap routines in ASan run-time.
...
llvm-svn: 158078
2012-06-06 16:15:07 +00:00
Kostya Serebryany
79437fe376
[asan] make tid u32 instead of int
...
llvm-svn: 158074
2012-06-06 15:06:58 +00:00
Kostya Serebryany
53b74ac256
[asan] start compacting the allocator header, the goal is to make it 16 bytes w/o losing any information
...
llvm-svn: 158072
2012-06-06 14:46:38 +00:00
Alexey Samsonov
ee07290628
[Sanitizer] Move more functions/constants to sanitizer_common.
...
llvm-svn: 158056
2012-06-06 09:26:25 +00:00
Alexey Samsonov
1b12eda7ec
[ASan] use internal_{close,read,write} in ASan runtime.
...
llvm-svn: 157991
2012-06-05 08:48:10 +00:00
Alexey Samsonov
f5e2dc3c3d
[ASan] use internal_open from sanitizer_libc in ASan runtime
...
llvm-svn: 157986
2012-06-05 07:25:47 +00:00
Kostya Serebryany
8a66b71c8f
[asan] partial fix for windows build
...
llvm-svn: 157750
2012-05-31 16:06:05 +00:00
Kostya Serebryany
1d35d155fd
[asan] more renaming
...
llvm-svn: 157747
2012-05-31 15:02:07 +00:00
Kostya Serebryany
8d03204204
[asan] more renaming
...
llvm-svn: 157746
2012-05-31 14:35:53 +00:00
Timur Iskhodzhanov
ea365131a2
[ASan] Make for-Windows RTL compileable using Clang++
...
llvm-svn: 157188
2012-05-21 14:25:36 +00:00
Kostya Serebryany
1490c7996f
[asan] add flags: disable_core, abort_on_error and unmap_shadow_on_exit
...
llvm-svn: 154159
2012-04-06 01:27:11 +00:00
Timur Iskhodzhanov
7d2776960b
[ASan/Win] Fix lint warning
...
llvm-svn: 154111
2012-04-05 18:31:50 +00:00
Timur Iskhodzhanov
0881092306
[ASan/Win] Fix build by using inline assembly instead of an unavailable intrinsic function
...
llvm-svn: 154106
2012-04-05 17:16:32 +00:00