Yury Gribov
4646b11acf
[asan] Improvements for asan deactivated mode: disable asan activation for runtime library on Linux, disable malloc checks.
...
Reviewed in http://reviews.llvm.org/D6265
llvm-svn: 222732
2014-11-25 07:10:30 +00:00
Evgeniy Stepanov
f518a4e774
[asan] Add fast_unwind_on_check flag.
...
Allows to specify the unwinder to use for CHECK failures. Previous behaviour
was to use the "fatal" unwinder.
As compiler-rt is built without frame pointers, only the slow unwinder
really makes sense here, and it is the default.
llvm-svn: 219677
2014-10-14 09:36:24 +00:00
Alexander Potapenko
1aba330e52
[ASan] Introduce the dump_instruction_bytes flag to print the faulting instruction upon SIGSEGV
...
When dump_instruction_bytes=1 and the instruction pointer doesn't point to the zero page, ASan prints 16 bytes starting at the instruction point.
llvm-svn: 218243
2014-09-22 11:58:52 +00:00
Evgeniy Stepanov
bc496dab07
[asan] Delay system log initialization on Android.
...
Writing to system log requires libc interceptors to be initialized.
Fixes crashes with verbosity=1 on newer Android builds.
llvm-svn: 217764
2014-09-15 11:37:40 +00:00
Alexey Samsonov
611c906cb3
[Sanitizer] Get rid of Symbolizer::Get() and Symbolizer::GetOrNull().
...
We may as well just use Symbolizer::GetOrInit() in all the cases.
Don't call Symbolizer::Get() early in tools initialization: these days
it doesn't do any important setup work, and we may as well create the
symbolizer the first time it's actually needed.
llvm-svn: 217558
2014-09-10 22:45:09 +00:00
Kostya Serebryany
c148f7c3af
[asan] enable poison_array_cookie back
...
llvm-svn: 216705
2014-08-29 01:16:18 +00:00
Kostya Serebryany
1e3b338606
[asan] disable poison_array_cookie while I am investigating a false positive on chromium (I suspect that LLVM looses nosanitizer metadata; no test yet)
...
llvm-svn: 216684
2014-08-28 20:24:05 +00:00
Alexey Samsonov
2e39027931
[LSan] Parse common flags from LSAN_OPTIONS even if LSan is combined with
...
another sanitizer.
A user may run both LSan and LSan+ASan. It is weird to pass path to leak
suppression file (or other common sanitizer flags, like "verbosity") in
"LSAN_OPTIONS" in the first case and in "ASAN_OPTIONS" in the second case.
llvm-svn: 215949
2014-08-18 23:39:47 +00:00
Alexey Samsonov
34e2b280da
[TSan] Share the code the setup code calling getrlim/setrlim with sanitizer_common
...
llvm-svn: 215481
2014-08-12 22:31:19 +00:00
Alexey Samsonov
d2d2457823
[Sanitizer] Make disable_coredump a common flag and use it in TSan
...
llvm-svn: 215479
2014-08-12 22:07:48 +00:00
Alexey Samsonov
b9ec65cd4d
[Sanitizer] Kill deprecated allocator interfaces in ASan, MSan and TSan in favor of
...
a unified interface in <sanitizer/allocator_interface.h>.
llvm-svn: 215469
2014-08-12 20:28:20 +00:00
Kostya Serebryany
522c35eb80
[asan] introduce __asan_poison_cxx_array_cookie. This is asan-rt part of PR19838 (Left OOB accesses on new[]-allocated arrays with array cookies are not detected). No tests yet. They will follow once I commit the clang part.
...
llvm-svn: 214711
2014-08-04 12:43:13 +00:00
Kostya Serebryany
e7532e59c0
[asan] rename new-delete-size-mismatch to new-delete-type-mismatch and make the report more verbose
...
llvm-svn: 214299
2014-07-30 11:20:37 +00:00
Kostya Serebryany
69852a843c
[asan] add a feature to detect new-delete-size-mismatch (when used with -Xclang -fsized-deallocation). Not yet on Mac. Also, remove some unused code.
...
llvm-svn: 214296
2014-07-30 09:48:23 +00:00
Alexey Samsonov
1440105338
[Sanitizer] Simplify Symbolizer creation interface.
...
Get rid of Symbolizer::Init(path_to_external) in favor of
thread-safe Symbolizer::GetOrInit(), and use the latter version
everywhere. Implicitly depend on the value of external_symbolizer_path
runtime flag instead of passing it around manually.
No functionality change.
llvm-svn: 214005
2014-07-26 01:37:23 +00:00
Kostya Serebryany
8e9a5b1899
[asan] fix x32 build, patch by H.J. Lu
...
llvm-svn: 212823
2014-07-11 15:22:45 +00:00
Kostya Serebryany
7d4fc2c6a7
[asan] enable detect_odr_violation=2; https://code.google.com/p/address-sanitizer/wiki/OneDefinitionRuleViolation . This feature has been working quite well so far, found a few bugs and zero false positives. The main problem is that there could be lots of true positives and users will have to disable this checking until the bugs are fixed.
...
llvm-svn: 210106
2014-06-03 15:06:13 +00:00
Alp Toker
1ee7fc7a1a
Fix typos
...
llvm-svn: 208841
2014-05-15 02:22:34 +00:00
Kostya Serebryany
b9e31d7fcd
[asan] use some LIKELY/UNLIKELY
...
llvm-svn: 208776
2014-05-14 14:03:31 +00:00
Kostya Serebryany
7534a60753
[asan] Respect personality in kernel area detector, patch by Yuri Gribov
...
llvm-svn: 208760
2014-05-14 08:13:11 +00:00
Alexey Samsonov
1866b58885
[ASan] Split static ASan runtime in two parts: asan and asan_cxx.
...
asan_cxx containts replacements for new/delete operators, and should
only be linked in C++ mode. We plan to start building this part
with exception support to make new more standard-compliant.
See https://code.google.com/p/address-sanitizer/issues/detail?id=295
for more details.
llvm-svn: 208609
2014-05-12 18:39:22 +00:00
Timur Iskhodzhanov
90278c626f
[ASan] Add references to the issue tracker about malloc/free/new/delete mismatch check on Mac and Windows
...
llvm-svn: 208574
2014-05-12 15:06:59 +00:00
Sergey Matveev
f37bd92c3a
[asan] Move the "coverage" flag to common flags.
...
The implementation lives in sanitizer_common and will need to access that flag.
llvm-svn: 208566
2014-05-12 14:27:36 +00:00
Kostya Serebryany
118d469660
[asan] one more attempt to enable lsan by default (PR19521)
...
llvm-svn: 208545
2014-05-12 12:49:48 +00:00
Timur Iskhodzhanov
7d5c81db0a
[ASan/Win] Don't crash when ASAN_OPTIONS have disable_core=1
...
Reviewed at http://reviews.llvm.org/D3610
llvm-svn: 208070
2014-05-06 08:21:50 +00:00
Kostya Serebryany
8b530e10a1
[asan] make AsanCoverage lock-free (and AS-safe)
...
llvm-svn: 207630
2014-04-30 10:40:48 +00:00
Kostya Serebryany
4f9c31a2fa
[asan] split detect_odr_violation into two: =2 detects all ODR violations, =1 detects only those where the variable sizes are different. BTW, the detector seems to be working well and finding nice bugs. Early adopters are welcome.
...
llvm-svn: 207415
2014-04-28 12:47:58 +00:00
Kostya Serebryany
e91930a7e6
[asan] implement an experimental detector of ODR violations. Not tested yet outside of a tiny test, may need tuning.
...
llvm-svn: 207210
2014-04-25 08:58:28 +00:00
Kostya Serebryany
8cd3d27879
[asan] disable lsan back. :( -- It appears that quite a few lit tests have leaks and they were not covered by out buildbot
...
llvm-svn: 206955
2014-04-23 08:15:16 +00:00
Kostya Serebryany
c9db838267
[asan] enable LeakSanitizer (LSan) by default in asan. This only affects Linux x86_64. LSan has been used in various projects for more than half a year and we now consider it quite stable to be on by default.
...
llvm-svn: 206896
2014-04-22 13:56:56 +00:00
Kostya Serebryany
38bb53b2c5
[asan] add a run-time flag detect_container_overflow=true/false
...
llvm-svn: 206753
2014-04-21 14:18:45 +00:00
Kostya Serebryany
3d2629c514
[asan] implement __asan_loadN/__asan_storeN for out-lined asan checks
...
llvm-svn: 206733
2014-04-21 07:09:01 +00:00
Kostya Serebryany
664b1e2f9b
[asan] fix a bug in outlined asan checks and in the corresponding test (ouch)
...
llvm-svn: 206470
2014-04-17 14:38:25 +00:00
Kostya Serebryany
ae401ca5e7
[asan] add __asan_load1/__asan_store1/... callbacks to asan-rt; together with -mllvm -asan-instrumentation-with-call-threshold=N this will be a workaround for PR17409
...
llvm-svn: 206387
2014-04-16 13:52:28 +00:00
Kostya Serebryany
bcfbea6d4e
[asan] added internal flag mmap_limit_mb
...
llvm-svn: 206178
2014-04-14 14:51:01 +00:00
Kostya Serebryany
9f20c9b17c
[asan] fix a leak in __tls_get_addr handler; introduce a run-time flag to disable this handler completely; remove a workaround for a bug fixed in glibc
...
llvm-svn: 205617
2014-04-04 09:10:58 +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
Kostya Serebryany
88d0eac412
[asan] Do not sanitize kernel area on 32-bit targets, patch by Yuri Gribov
...
llvm-svn: 204897
2014-03-27 07:36:26 +00:00
Alexander Potapenko
c6afaace15
[ASan] Move the flag descriptions from comments to ParseFlag arguments.
...
llvm-svn: 204440
2014-03-21 08:37:59 +00:00
Alexander Potapenko
1296436cbf
[libsanitizer] Introduce flag descriptions.
...
Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags.
As the flags are parsed their descriptions are stored in a global linked list.
The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions.
Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1.
llvm-svn: 204339
2014-03-20 12:52:52 +00:00
Kostya Serebryany
796f6557bf
[asan] *experimental* implementation of invalid-pointer-pair detector (finds when two unrelated pointers are compared or subtracted). This implementation has both false positives and false negatives and is not tuned for performance. A bug report for a proper implementation will follow.
...
llvm-svn: 202389
2014-02-27 12:45:36 +00:00
Evgeniy Stepanov
769d46f373
[sanitizer] Use system unwinder in signal handlers on Android.
...
Because of the way Bionic sets up signal stack frames, libc unwinder is unable
to step through it, resulting in broken SEGV stack traces.
Luckily, libcorkscrew.so on Android implements an unwinder that can start with
a signal context, thus sidestepping the issue.
llvm-svn: 201151
2014-02-11 13:38:57 +00:00
Evgeniy Stepanov
01cd8ae204
[asan] Read extra flags from a system property on activation on Android.
...
llvm-svn: 200550
2014-01-31 14:36:55 +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
cf4bef3161
[ASan] Move the signal handling-related flags to sanitizer_common.
...
This change is a part of refactoring intended to have common signal handling behavior in all tools.
llvm-svn: 200295
2014-01-28 09:28:57 +00:00
Evgeniy Stepanov
c61623b170
[asan] Implement delayed activation of AddressSanitizer
...
This change adds ASAN_OPTIONS=start_deactivated=1 flag. When present, ASan will
start in "deactivated" mode, with no heap poisoning, no quarantine, no stack
trace gathering, and minimal redzones. All this features come back when
__asan_init is called for the constructor of an instrumented library.
The primary use case for this feature is Android. Code itself is not
Android-specific, and this patch includes a Linux test for it.
llvm-svn: 199377
2014-01-16 12:31:50 +00:00
Evgeniy Stepanov
219719a2da
[asan] Implement max_redzone runtime flag.
...
llvm-svn: 198873
2014-01-09 14:41:03 +00:00
Alexey Samsonov
25d010a98d
[Sanitizer] Always initialize a Symbolizer (even if 'symbolize' is false).
...
If 'symbolize' flag is not set, we still want to transform virtual address
to module+offset pair in the call to Symbolizer::SymbolizeCode().
See https://code.google.com/p/address-sanitizer/issues/detail?id=251 for
more details.
llvm-svn: 197491
2013-12-17 11:15:39 +00:00
Kostya Serebryany
1aedf6c9e6
[asan] replace the flag uar_stack_size_log with two flags min_uar_stack_size_log/max_uar_stack_size_log
...
llvm-svn: 197370
2013-12-16 08:42:08 +00:00
Kostya Serebryany
57bfdb080b
[asan] add flag uar_noreserve to use noreserve mmap for fake stack. uar_noreserve=1 will save some memory but also negatively affect performance
...
llvm-svn: 197233
2013-12-13 15:03:49 +00:00