Viktor Kutuzov
abfacbdf3a
[Sanitizers] Order initialization of coverage and guard arrays
...
Differential Revision: http://reviews.llvm.org/D6892
llvm-svn: 226440
2015-01-19 09:41:52 +00:00
Evgeniy Stepanov
141c5a9ae0
[sanitizer] Move options-related tests to sanitizer_common.
...
And handle help=1 in standalone LSan.
llvm-svn: 226438
2015-01-19 09:21:44 +00:00
Evgeniy Stepanov
e5b1c0d98e
[msan] Use internal__exit() instead of _exit().
...
llvm-svn: 226437
2015-01-19 09:20:28 +00:00
Evgeniy Stepanov
0540f4141f
[dfsan] Use append_no_rtti_flag instead of manually specifying -fno-rtti.
...
llvm-svn: 226435
2015-01-19 08:26:38 +00:00
Hal Finkel
0e39c55d22
[sanitizer] Adjust max read size in FlagHandlerInclude
...
Setting the maximum read size in FlagHandlerInclude to 2^15 might be a good
default, but causes the read to fail on systems with a page size larger than
that (ReadFileToBuffer(...) will fail if the maximum allowed size is less than
the value returned by GetPageSizeCached()). For example, on my PPC64/Linux
system, GetPageSizeCached() returns 2^16. In case the page size is larger, use
that instead.
llvm-svn: 226368
2015-01-17 03:31:43 +00:00
Justin Bogner
66fd5c914a
InstrProf: Optionally print an error when emitting profile data fails
...
Debugging a missing profile is a bit painful right now. We can make
people's lives a bit easier by adding a knob to enable printing a
helpful error message for such failures.
llvm-svn: 226312
2015-01-16 20:10:56 +00:00
Evgeniy Stepanov
5450a9635a
[sanitizer] Additional error checking.
...
llvm-svn: 226279
2015-01-16 15:25:16 +00:00
Viktor Kutuzov
05f6929932
[Sanitizers] Intercept clock_gettime() on FreeBSD
...
Committed unreviewed with permission.
llvm-svn: 226276
2015-01-16 14:54:39 +00:00
Viktor Kutuzov
068ece9679
[Sanitizers] Intercept lgamma_r() on FreeBSD
...
Committed unreviewed with permission.
llvm-svn: 226275
2015-01-16 14:52:17 +00:00
Evgeniy Stepanov
4286a9bd5a
[asan] Change detection of allow_user_segv_handler on Android.
...
llvm-svn: 226273
2015-01-16 13:12:22 +00:00
Evgeniy Stepanov
29235e374c
[sanitizer] Fix bashism in check_lint.sh.
...
llvm-svn: 226267
2015-01-16 10:20:49 +00:00
Evgeniy Stepanov
e0009356ba
[sanitizer] Cleanup linter temporary files.
...
llvm-svn: 226266
2015-01-16 10:09:56 +00:00
Evgeniy Stepanov
db20539d3a
[sanitizer] Fix compiler warning in the flag parser code.
...
llvm-svn: 226263
2015-01-16 09:32:31 +00:00
Evgeniy Stepanov
bc14dd46f2
[sanitizer] Implement include= option.
...
Allows loading sanitizer options from file.
llvm-svn: 226175
2015-01-15 16:26:59 +00:00
Evgeniy Stepanov
f294d5b829
[sanitizer] Flag parser rewrite.
...
The new parser is a lot stricter about syntax, reports unrecognized
flags, and will make it easier to implemented some of the planned features.
llvm-svn: 226169
2015-01-15 15:13:43 +00:00
Evgeniy Stepanov
fa1d9f4860
Fix compilation of compiler_rt against libunwind.
...
libunwind defines _Unwind_GetLanguageSpecificData as returning long
instead of (uint8_t *).
llvm-svn: 226167
2015-01-15 14:27:38 +00:00
Saleem Abdulrasool
a7452e434b
builtins: avoid duplicating unwind declarations
...
Use unwind.h to get the declarations for unwinding interfaces. This header is
already provided by clang and gcc, so this adds no additional dependencies for
building the builtins library. It avoids the duplication which may drift over
time though.
llvm-svn: 225990
2015-01-14 15:55:17 +00:00
Viktor Kutuzov
0181812bf6
[Msan] Fix strlen() and strnlen() interceptors to work on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D6928
llvm-svn: 225986
2015-01-14 14:59:46 +00:00
Peter Collingbourne
75e259ed95
[dfsan] Export dfsan_get_label_info function with C linkage.
...
llvm-svn: 225692
2015-01-12 20:40:30 +00:00
Viktor Kutuzov
b4b05017cf
[Msan] Fix use of mmap(MAP_ANONYMOUS) in the unit tests on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D6929
llvm-svn: 225688
2015-01-12 20:18:38 +00:00
Viktor Kutuzov
6aba5098fd
[Msan] Fix tests reading /proc files on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D6926
llvm-svn: 225686
2015-01-12 20:15:33 +00:00
Timur Iskhodzhanov
00ede84084
[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000
...
llvm-svn: 225641
2015-01-12 17:38:58 +00:00
Evgeniy Stepanov
3f2e761826
[asan] Fix uninit in coverage.
...
pc_fd was not initialized to (-1) on some code paths, resulting in the program
erroneously closing stdin when reinitializing coverage.
llvm-svn: 225637
2015-01-12 17:13:20 +00:00
Ehsan Akhgari
d918614586
Fix two extra semicolon warnings
...
Reviewers: timurrrr
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6890
llvm-svn: 225635
2015-01-12 17:03:02 +00:00
Jay Foad
335c08e56c
[ASan] Handle SIGBUS on Linux.
...
Summary:
On Linux in some situations we can get SIGBUS instead of SIGSEGV on
stack overflow, so asan should handle SIGBUS as well as SIGSEGV.
https://code.google.com/p/address-sanitizer/issues/detail?id=369
Reviewers: samsonov, glider
Reviewed By: glider
Subscribers: glider, llvm-commits
Differential Revision: http://reviews.llvm.org/D6923
llvm-svn: 225630
2015-01-12 13:46:37 +00:00
Roman Divacky
0c9c0c5a6d
Add FreeBSD support for __clear_cache.
...
llvm-svn: 225610
2015-01-11 18:21:11 +00:00
Alexey Samsonov
95674c8181
Remove AsanInterceptsSignal in favor of (equivalent) IsDeadlySignal.
...
llvm-svn: 225556
2015-01-09 23:03:31 +00:00
Kostya Serebryany
96fc9a2537
[sanitizer] use the right memory order
...
llvm-svn: 225546
2015-01-09 21:01:34 +00:00
Alexey Samsonov
a04ca22edf
Fix memory leaks in GetListOfModules() users.
...
llvm-svn: 225472
2015-01-08 22:31:14 +00:00
Alexey Samsonov
b40fd1b24e
[Sanitizer] Remove the hardcoded limit of address ranges in LoadedModule.
...
This should fix https://code.google.com/p/address-sanitizer/issues/detail?id=368 .
llvm-svn: 225469
2015-01-08 22:03:05 +00:00
Viktor Kutuzov
e01a595dad
[Sanitizers] Fix internal_lseek() to work on FreeBSD
...
Differential Revision: http://reviews.llvm.org/D6825
llvm-svn: 225443
2015-01-08 13:28:22 +00:00
Kostya Serebryany
7ad02fca09
[asan] add flag quarantine_size_mb, deprecate quarantine_size
...
llvm-svn: 225337
2015-01-07 02:37:52 +00:00
Alexey Samsonov
7eba6dfdaa
[TSan] Fix Go build.
...
llvm-svn: 225336
2015-01-07 02:12:41 +00:00
Alexey Samsonov
03499e920b
[Sanitizer] Change the runtime flag representation.
...
This mirrors r225239 to all the rest sanitizers:
ASan, DFSan, LSan, MSan, TSan, UBSan.
Now the runtime flag type, name, default value and
description is located in the single place in the
.inc file.
llvm-svn: 225327
2015-01-07 00:38:00 +00:00
Kostya Serebryany
7e85a9216e
[asan] add a flag soft_rss_limit_mb
...
llvm-svn: 225323
2015-01-06 23:53:32 +00:00
Alexey Samsonov
6239ebc1c2
[Sanitizer] Improve unit tests in COMPILER_RT_DEBUG=ON mode.
...
Propagate -DSANITIZER_DEBUG definition to unit tests.
Make sure unit tests depend on compiler-rt headers.
llvm-svn: 225298
2015-01-06 20:58:40 +00:00
Alexey Samsonov
bdbdd3fd4e
[Sanitizer] Use COMMON_FLAG macro to describe common runtime flags.
...
Summary:
Introduce a single place where we specify flag type, name, default
value, and description. This removes a large amount of boilerplate
and ensures we won't leave flags uninitialized.
Test Plan: regression test suite
Reviewers: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6851
llvm-svn: 225239
2015-01-06 02:44:05 +00:00
Kostya Serebryany
fb42a5a292
[ubsan] partially enable -fsanitize-coverage=N with ubsan. It will work as usual in most cases but will not dump coverage on error with -fno-sanitize-recover (that'll be a separate fix)
...
llvm-svn: 225234
2015-01-06 01:31:23 +00:00
Kostya Serebryany
e02839b60f
[asan/tracing] write the trace using a sequence of internal_write calls instead of just one (otherwise files of > 2Gb are trunkated). Also a minor adjustment to the trace collection.
...
llvm-svn: 225230
2015-01-06 01:11:23 +00:00
Alexey Samsonov
df3aeb8e71
Remove TSAN_DEBUG in favor of SANITIZER_DEBUG.
...
llvm-svn: 225111
2015-01-03 04:29:12 +00:00
Alexey Samsonov
3b1885448a
Replace DCHECK with DCHECK_LE where appropriate.
...
llvm-svn: 225110
2015-01-03 04:29:05 +00:00
Kostya Serebryany
0f53d9a2ee
[asan/tracing] extend the test a bit more, simplify the tracing code, add a guard page to trace array, fix the trace IDs before dumping
...
llvm-svn: 225108
2015-01-03 02:07:58 +00:00
Kostya Serebryany
d421db05bb
[asan] simplify the tracing code, make it use the same guard variables as coverage
...
llvm-svn: 225103
2015-01-03 00:54:43 +00:00
Alexey Samsonov
c426c337ed
Revert "Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization.""
...
Fix test failures by introducing CommonFlags::CopyFrom() to make sure
compiler doesn't insert memcpy() calls into runtime code.
Original commit message:
Protect CommonFlags singleton by adding const qualifier to
common_flags() accessor. The only ways to modify the flags are
SetCommonFlagsDefaults(), ParseCommonFlagsFromString() and
OverrideCommonFlags() functions, which are only supposed to be
called during initialization.
llvm-svn: 225088
2015-01-02 21:28:37 +00:00
Chandler Carruth
6173e869eb
Revert r224736: "[Sanitizer] Make CommonFlags immutable after initialization."
...
We've got some internal users that either aren't compatible with this or
have found a bug with it. Either way, this is an isolated cleanup and so
I'm reverting it to un-block folks while we investigate. Alexey and
I will be working on fixing everything up so this can be re-committed
soon. Sorry for the noise and any inconvenience.
llvm-svn: 225079
2015-01-02 09:59:38 +00:00
Kostya Serebryany
77c5c1a66d
[asan] fix coverage between fork() and exec(): reinitialize the guards after fork()
...
llvm-svn: 225016
2014-12-30 23:16:12 +00:00
Kostya Serebryany
a7ee2734cf
[asan] add flag coverage_pcs. When false, the coverage is not dumped as PCs. Useful e.g. if the user only needs coverage is bitset
...
llvm-svn: 225002
2014-12-30 19:55:04 +00:00
Kostya Serebryany
aa185bfc4b
[asan] change _sanitizer_cov_module_init to accept int* instead of int**
...
llvm-svn: 224999
2014-12-30 19:29:28 +00:00
Timur Iskhodzhanov
a023e06618
Follow-up to r224987: fix a lint warning
...
llvm-svn: 224988
2014-12-30 15:30:19 +00:00
Timur Iskhodzhanov
64fc8e4a5a
[ASan/Win] Sort the list of modules when we fail to reserve the shadow memory range
...
llvm-svn: 224987
2014-12-30 14:44:12 +00:00