Evgeniy Stepanov
96f8edc720
[asan] Default to memory-mapped coverage on Android.
...
The alternative (writing coverage at process exit) is nearly useless there.
llvm-svn: 210024
2014-06-02 13:06:33 +00:00
Evgeniy Stepanov
fa5c0750f0
[sanitizer] Add coverage_dir flag.
...
llvm-svn: 209815
2014-05-29 14:33:16 +00:00
Evgeniy Stepanov
a0aa0f41d1
[sanitizer] Require that options end with '='.
...
llvm-svn: 209814
2014-05-29 14:32:32 +00:00
Evgeniy Stepanov
567e516015
[asancov] Write coverage directly to a memory-mapped file.
...
This way does not require a __sanitizer_cov_dump() call. That's
important on Android, where apps can be killed at arbitrary time.
We write raw PCs to disk instead of module offsets; we also write
memory layout to a separate file. This increases dump size by the
factor of 2 on 64-bit systems.
llvm-svn: 209653
2014-05-27 12:37:52 +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
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
7afc6b2c72
[asan] enable use_sigaltstack by default (this will provide verbose reports on stack-overflow instead of silently crashing with SEGV)
...
llvm-svn: 207099
2014-04-24 11:55:17 +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
26c4e96455
[sanitizer] enable check_printf by default for asan and tsan. We've been using this flag for a while and it seems to be stable enough for the rest of the world.
...
llvm-svn: 206872
2014-04-22 09:17:08 +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
Timur Iskhodzhanov
59ce9e07a4
Fix a VS compile-time warning
...
warning C4345: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
llvm-svn: 204597
2014-03-24 10:47:37 +00:00
Alexander Potapenko
25e204e194
[libsanitizer] Add descriptions for the common flags.
...
Use new(allocator_for_flags) instead of allocator_for_flags.Allocate()
Fix the description output format a bit.
llvm-svn: 204484
2014-03-21 17:28:12 +00:00
Alexander Potapenko
d23359c3e3
[libsanitizer] Implement IntrusiveList<T>::Iterator, use IntrusiveList in sanitizer_flags.cc
...
llvm-svn: 204342
2014-03-20 13:49:21 +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
Dmitry Vyukov
3b37e8bf18
tsan: yet another attempt to fix pthread_cond interceptors
...
Make behavior introduced in r202820 conditional (under legacy_pthread_cond flag).
The new issue that we've hit with the satellite pthread_cond_t struct is
that pthread_condattr_getpshared does not work (satellite data is not shared between processes).
The idea is that most processes do not use pthread 2.2.5.
The rare ones that use (2.2.5 is dated by 2002) must specify legacy_pthread_cond=1
on their own risk.
llvm-svn: 204032
2014-03-17 07:51:53 +00:00
Evgeniy Stepanov
e23add20ae
[sanitizer] Add a flag to enable/disable report colorization.
...
llvm-svn: 202249
2014-02-26 09:06:59 +00:00
Kostya Serebryany
e233d8618d
[sanitizer] add iterators to bit vectors; make bit vector operations use little stack; add common flag 'detect_deadlocks'
...
llvm-svn: 201405
2014-02-14 12:08:23 +00:00
Evgeniy Stepanov
05938a23f5
[sanitizer] Use mmap to zero-fill large shadow regions.
...
This is covered by existing ASan test.
This does not change anything for TSan by default (but provides a flag to
change the threshold size).
Based on a patch by florent.bruneau here:
https://code.google.com/p/address-sanitizer/issues/detail?id=256
llvm-svn: 201400
2014-02-14 11:41:26 +00:00
Alexey Samsonov
7304b4201f
[Sanitizer] Teach external symbolizer to work with addr2line if llvm-symbolizer is unavailable. Allow this mode in TSan.
...
llvm-svn: 201218
2014-02-12 08:29:42 +00:00
Dmitry Vyukov
e63a09adb6
tsan: fix Go build
...
Go linker does not like function-static objects.
llvm-svn: 200534
2014-01-31 11:20:55 +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
Alexey Samsonov
00cd273c46
Sanitize printf functions.
...
Intercept and sanitize arguments passed to printf functions in ASan and TSan
(don't do this in MSan for now). The checks are controlled by runtime flag
(off by default for now).
Patch http://llvm-reviews.chandlerc.com/D2480 by Yuri Gribov!
llvm-svn: 199729
2014-01-21 11:58:33 +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
Dmitry Vyukov
7bd319cc08
tsan: fix flags parsing
...
- running_on_valgrind was not parsed in some contexts
- refactor code a bit
- add comprehensive tests for flags parsing
llvm-svn: 195831
2013-11-27 09:54:10 +00:00
Alexey Samsonov
d5144879f9
[Sanitizer] Improve external symbolizer behavior.
...
1) Don't start external symbolizer subprocess until we actually try to
symbolize anything.
2) Allow to turn off external symbolizer by providing empty ?SAN_SYMBOLIZER_PATH
environment variable.
llvm-svn: 195771
2013-11-26 16:24:53 +00:00
Alexey Samsonov
498e5906ad
[Sanitizer] Add print_summary runtime flag to disable error summaries (UBSan doesn't need them)
...
llvm-svn: 194685
2013-11-14 08:56:59 +00:00
Alexey Samsonov
6345150992
[Sanitizer] Specify a default value for each common runtime flag
...
llvm-svn: 194479
2013-11-12 13:59:08 +00:00
Dmitry Vyukov
1ec0fd4071
tsan: parse symbolize/external_symbolizer_path common flags
...
llvm-svn: 193236
2013-10-23 09:00:49 +00:00
Dmitry Vyukov
45baa00dcb
tsan: actually parse verbofity flag
...
llvm-svn: 192704
2013-10-15 14:00:28 +00:00
Dmitry Vyukov
7ac0b2b0e1
tsan: use sanitizer::CommonFlags in tsan
...
llvm-svn: 192692
2013-10-15 12:25:29 +00:00
Alexey Samsonov
9d8385453b
[Sanitizer] Simplify StackTrace::FastUnwindStack interface and fix a bug with one-frame stack traces
...
llvm-svn: 192428
2013-10-11 09:58:30 +00:00
Kostya Serebryany
ada5a7b7ef
[sanitizer] make the allocator crash instead of returning 0 on huge size (controlled by the allocator_may_return_null flag)
...
llvm-svn: 190127
2013-09-06 09:25:11 +00:00
Sergey Matveev
6459a370a7
[lsan] Add leak_check_at_exit flag.
...
We needed a way to tell LSan to invoke leak checking only if __do_leak_check()
is called explicitly. This can now be achieved by setting
leak_check_at_exit=false.
llvm-svn: 187578
2013-08-01 14:57:07 +00:00
Sergey Matveev
9c012165ad
[lsan] Make __lsan_do_leak_check() honor the detect_leaks flag.
...
Also move detect_leaks to common flags.
llvm-svn: 186821
2013-07-22 12:38:17 +00:00
Evgeniy Stepanov
982d56abb8
[sanitizer] Move log_path to common flag and use it in MSan.
...
llvm-svn: 184836
2013-06-25 13:50:44 +00:00
Evgeniy Stepanov
0b1f41b6f4
[sanitizer] ioctl interceptor.
...
ASan: disabled by default
MSan: enabled by default
TSan: disabled
llvm-svn: 183517
2013-06-07 13:00:47 +00:00
Timur Iskhodzhanov
cc61eefd4b
Fix MSVC W3 compiler warnings
...
llvm-svn: 182857
2013-05-29 14:11:44 +00:00
Sergey Matveev
0c8ed9ce44
[asan] Common flags in ASan.
...
Some flags that are common to ASan/MSan/TSan/LSan have been moved to
sanitizer_common.
llvm-svn: 181193
2013-05-06 11:27:58 +00:00
Dmitry Vyukov
fd3f5ec0cb
tsan: better flag parsing: do not confuse flag that is a part of another flag
...
(e.g. suppressions and print_suppressions)
llvm-svn: 178158
2013-03-27 17:59:13 +00:00
Alexey Samsonov
99b81b4bbe
[Sanitizer] Allow runtime flags be separated by colon as well as space
...
llvm-svn: 175511
2013-02-19 13:03:37 +00:00
Alexey Samsonov
d1d1a814b7
[Sanitizer] align allocation sizes in low level allocator
...
llvm-svn: 162676
2012-08-27 14:51:36 +00:00
Alexey Samsonov
e67a5dd8e1
[Sanitizer] Use low-level allocator in flag parsing to avoid calling malloc() before ASan/TSan initialization is done
...
llvm-svn: 162673
2012-08-27 14:04:54 +00:00
Alexey Samsonov
2c94cd6e3d
[Sanitizer] move flag parsing routines (and unit tests) from tsan runtime to common runtime.
...
llvm-svn: 159928
2012-07-09 13:21:39 +00:00