Commit Graph

5081 Commits

Author SHA1 Message Date
Evgeniy Stepanov a2edd9159a [sanitizer] Make unrecognized flags not fatal.
Print a warning at verbosity=1 and higher instead of dying immediately.

llvm-svn: 226458
2015-01-19 12:22:57 +00:00
Evgeniy Stepanov 6c6e589c1f [sanitizer] Switch flag parsing to LowLevelAlloc.
InternalAlloc is quite complex and its behavior may depend on the values of
flags. As such, it should not be used while parsing flags.

Sadly, LowLevelAlloc does not support deallocation of memory.

llvm-svn: 226453
2015-01-19 11:47:13 +00:00
Evgeniy Stepanov 3231dd3c1c [sanitizer] Simplify code in flag parser.
llvm-svn: 226452
2015-01-19 10:54:36 +00:00
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
David Blaikie 4da5edbebe Update for tests failing due to improvements in clang's column information for aggregate expressions
llvm-svn: 226393
2015-01-18 02:17:55 +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 4448007885 [asan] More verbose output from one of the tests.
Trying to debug a buildbot-only failure.

llvm-svn: 226270
2015-01-16 12:08:32 +00:00
Evgeniy Stepanov 82d3ef1617 [asan] Fix asan_options-include test.
Wrong include order.

llvm-svn: 226268
2015-01-16 10:30:53 +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
Hal Finkel e67f32aa99 [asan] Loosen test for upcoming ppc64 change
This test casts 0x4 to a function pointer and calls it. Unfortunately, the
faulting address may not exactly be 0x4 on PPC64 ELFv1 systems. The LLVM PPC
backend used to always generate the loads "in order", so we'd fault at 0x4
anyway. However, at upcoming change to loosen that ordering, and we'll pick a
different order on some targets. As a result, as explained in the comment, we
need to allow for certain nearby addresses as well.

llvm-svn: 226202
2015-01-15 20:48:38 +00:00
Evgeniy Stepanov 8c9a0708a0 [sanitizer] Restore -fno-lto accidentally removed in r226169.
llvm-svn: 226177
2015-01-15 16:31:22 +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 1a1a7d0f30 [lsan] Fix a typo in a test.
llvm-svn: 226168
2015-01-15 15:00:49 +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
David Blaikie baaaa67819 Reapply debug info changes now that more precise column information is available.
llvm-svn: 225959
2015-01-14 07:59:48 +00:00
Rafael Espindola c7e4fb209e Another try at handling LD_LIBRARY_PATH not being defined.
llvm-svn: 225932
2015-01-14 02:23:27 +00:00
Rafael Espindola a9782ecfb0 Handle LD_LIBRARY_PATH not being defined.
Should fix the bots after r225890.

llvm-svn: 225919
2015-01-14 01:28:08 +00:00
Alexey Samsonov f3b61be2ee Update test cases for new -fsanitize-recover= semantics.
llvm-svn: 225725
2015-01-12 23:02:42 +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
Evgeniy Stepanov 5975243955 [asan] Pass activation options in the android test runner.
llvm-svn: 225636
2015-01-12 17:10:05 +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
David Blaikie 9098487213 Revert "Reapply debug info changes now that more precise column information is available."
While the clang patch is reverted pending investigation/fixes.

This reverts commit r225001.

llvm-svn: 225560
2015-01-09 23:27:12 +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
Kuba Brecka 1a03ccd848 [asan] Adding a regression test for https://code.google.com/p/address-sanitizer/issues/detail?id=368
llvm-svn: 225484
2015-01-09 00:26:45 +00:00
Kostya Serebryany 8cc4002df2 [asan] make a test consume 2x less RAM (we observe flaky bot failures that seem like OOMs)
llvm-svn: 225478
2015-01-08 23:37:09 +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
Renato Golin ea56f08b3f XFAIL AArch64 UBsan test, just like ARM
llvm-svn: 225370
2015-01-07 20:03:47 +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