Commit Graph

1944 Commits

Author SHA1 Message Date
Evgeniy Stepanov 3305b177e6 [asan] Lower memory usage in LargeMallocTest on Android.
llvm-svn: 176264
2013-02-28 15:54:58 +00:00
Alexander Potapenko f1c48eb509 [ASan] Add the memcmp_strict flag (1 by default) that controls the behavior of accessibility checks in memcmp.
1: memcmp(p1, p2, n) always checks n bytes
0: memcmp checks up to n bytes depending on whether the memory contents differ.

llvm-svn: 176256
2013-02-28 14:09:30 +00:00
Evgeniy Stepanov 1cb95a17b8 [asan] Enable allocator2 on Android.
llvm-svn: 176255
2013-02-28 14:07:01 +00:00
Kostya Serebryany abebb57272 [asan] bump kMidMemEnd to 0x4fffffffffULL since in rare cases prelink uses addresses higher than 0x3fffffffff
llvm-svn: 176250
2013-02-28 12:28:37 +00:00
Alexey Samsonov 4a3234bec5 [Sanitizer] Relax ThreadLister tests to allow possible pre-existing threads. Do proper mutex destruction. Patch by Sergey Matveev
llvm-svn: 176249
2013-02-28 11:33:51 +00:00
Evgeniy Stepanov 218c582cb5 [msan] Lit tests for __attribute__((no_sanitize_memory)).
llvm-svn: 176248
2013-02-28 11:25:54 +00:00
Nick Lewycky 1052c99f46 Holy macaroons, somebody made a copy of llvm/runtime/profile/GCDAProfiling.c,
didn't delete the original, and now they've diverged. I have no idea what's
going on. Apply my patch in r176173 to this one too, this one looks newer?

llvm-svn: 176236
2013-02-28 07:00:13 +00:00
Kostya Serebryany 8ee2a5adc7 [asan] if calloc returns a freshly-mmaped memory, don't clear it with memset. Speeds up calloc-intensive code
llvm-svn: 176185
2013-02-27 13:38:19 +00:00
Alexey Samsonov 49b86b354a [Sanitizer] don't include missing header on Android
llvm-svn: 176183
2013-02-27 13:03:35 +00:00
Alexey Samsonov 46a36d5019 [UBSan] Use common report decorator to print colorful diagnostics in UBSan, and be more consistent w/ Printf/RawWrite
llvm-svn: 176182
2013-02-27 12:58:24 +00:00
Kostya Serebryany f0b8f989e9 add Linux syscall wrappers and ThreadLister to sanitizer_common
ThreadLister is a Linux-specific class for obtaining the thread IDs of a process from procfs (/proc/<pid>/task/). It will be used by leak checking code.
Also add several syscall wrappers which will be required by the same code that uses ThreadLister, but are not used in ThreadLister itself.
Patch by Sergey Matveev

llvm-svn: 176179
2013-02-27 11:22:40 +00:00
Kostya Serebryany c98cddd024 [asan] guard ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS definition with an #ifndef
llvm-svn: 176175
2013-02-27 08:28:24 +00:00
Alexey Samsonov 086b940b1e [Sanitizer] Don't die if external symbolizer is used on Mac, where it's not implemented yet
llvm-svn: 176091
2013-02-26 13:40:51 +00:00
Kostya Serebryany a8cfb900dd [sanitizer] A low-level vector implementation to be used in leak checking code. Patch by Sergey Matveev
llvm-svn: 176089
2013-02-26 13:30:27 +00:00
Kostya Serebryany 459df6f167 [asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)
llvm-svn: 176085
2013-02-26 12:59:06 +00:00
Kostya Serebryany 01a32bdef1 [tsan] enable tsan-vs-gvn test since it is now fixed
llvm-svn: 176079
2013-02-26 08:18:27 +00:00
Kostya Serebryany 8caf654731 [asan] fix the output for range accesses (memset, etc); improve the tests; more strict checking in memcmp
llvm-svn: 176078
2013-02-26 07:25:18 +00:00
Kostya Serebryany c8ac15a66b [asan] use the new attribute syntax (no_address_safety_analysis => no_sanitize_address)
llvm-svn: 176077
2013-02-26 07:01:06 +00:00
Alexey Samsonov 54ff0f6388 [Sanitizer] one more fix for signed/unsigned mismatch in comparison
llvm-svn: 176020
2013-02-25 14:06:38 +00:00
Alexey Samsonov b2ac280f96 [Sanitizer] fix signed/unsigned compare warnings in sanitizer_stacktrace_test. Build sanitizer_common tests with -Werror as we use predictable just-built Clang for building them
llvm-svn: 176014
2013-02-25 09:00:03 +00:00
Alexey Samsonov 85f0a7e644 [TSan] Add interceptor for malloc_usable_size()
llvm-svn: 176013
2013-02-25 08:43:10 +00:00
Alexey Samsonov 10bccda948 [TSan] remove temporary build directory in 'make clean' command
llvm-svn: 176012
2013-02-25 08:32:02 +00:00
Richard Smith 0404ec8396 ubsan: Runtime handlers for array indexing checks.
llvm-svn: 175948
2013-02-23 02:40:07 +00:00
Reid Kleckner e1596856ec [Sanitizer] Add a test for the fast unwinder
Summary:
The test sets up fake x86-style fp+retaddr frames, since that's all the
unwinder works with.

Reviewers: kcc

CC: eugenis

Differential Revision: http://llvm-reviews.chandlerc.com/D445

llvm-svn: 175893
2013-02-22 15:10:16 +00:00
Evgeniy Stepanov 3065014026 [msan] MSanDR: initial commit.
MSanDR is a DynamoRio-based tool that handles uninstrumented libraries and
dynamically generated code for MSan.

llvm-svn: 175883
2013-02-22 09:34:19 +00:00
Kostya Serebryany 1d63d13ce2 [asan] move the .preinit_array hack into a separate file (added used attribute)
llvm-svn: 175871
2013-02-22 07:51:26 +00:00
Alexander Potapenko 97781c4dd0 [ASan] temporarily disable alloc_dealloc_mismatch on Mac, since the previous commit caused error reports in gTest.
llvm-svn: 175766
2013-02-21 17:12:21 +00:00
Alexander Potapenko a47c6ee286 [ASan] Make sure operator new/delete and friends are intercepted on OS X.
Because the interceptors will reside in a dylib, not the main executable, we can't just declare them,
but must use the interposition machinery.
Fix the test expectations in large_func_test.cc affected by the change.
This CL should make our Mac buildbots green.

llvm-svn: 175763
2013-02-21 16:54:09 +00:00
Alexander Potapenko 1615f193eb [ASan] Declare CreateThread as extern "C" to fix the Windows build.
llvm-svn: 175760
2013-02-21 15:32:50 +00:00
Alexander Potapenko 8dbcb98c52 [ASan] Revert the incorrect macro on Linux.
llvm-svn: 175745
2013-02-21 15:15:43 +00:00
Alexander Potapenko b8135a8a6b [ASan] Put several function prototypes back under #ifdef _WIN32 to fix the Windows build.
llvm-svn: 175743
2013-02-21 15:10:03 +00:00
Alexander Potapenko e8ba1c851a [ASan] Refactoring: nuke the redundant function declarations in asan_intercepted_functions.h
that had been used on OS X only.
The INTERCEPTOR() macro on OS X is now responsible for declaring the wrapped function, the wrapper and the
pair of pointers to them in __DATA,__interposition section. Thus adding an interceptor requires editing a single file now.

llvm-svn: 175740
2013-02-21 14:41:16 +00:00
Evgeniy Stepanov 57d6f737e6 [sanitizer] Add MSan to Makefile-based build rules.
llvm-svn: 175737
2013-02-21 13:55:54 +00:00
Kostya Serebryany ab5be26af5 [asan] speedup by more than 2x handling of the small memset/memcpy/etc calls
llvm-svn: 175728
2013-02-21 07:07:39 +00:00
Reid Kleckner 15f2d1f4be [Sanitizer] Try to fix infinite loop in frame pointer unwinder
Using > instead of >= ensures that each frame deref makes progress and
that we eventually terminate.

Issue: https://code.google.com/p/address-sanitizer/issues/detail?id=162
llvm-svn: 175661
2013-02-20 20:29:48 +00:00
Alexey Samsonov 7dc2b2f07d [ASan] revert part of r175631 that looks like accidental commit
llvm-svn: 175655
2013-02-20 19:55:47 +00:00
Alexander Potapenko 70b01558f1 [ASan] Delete asan/dynamic dir and temporarily move the interposers declarations to asan_intercepted_functions.h
Now that we have only one dependency on asan_intercepted_functions.h, we can unite that code with the interceptors declarations in asan_interceptors.cc and get rid of asan_intercepted_functions.h

llvm-svn: 175631
2013-02-20 15:46:02 +00:00
Alexander Potapenko 56821acc79 [ASan] Make isoc99_*scanf intercepted on Linux only. Those are unavailable on Darwin.
llvm-svn: 175629
2013-02-20 15:27:58 +00:00
Kostya Serebryany 7b989859a8 [asan] move preinit_test to Linux since on Mac __asan_init is called from ld-preload-ed runtime
llvm-svn: 175625
2013-02-20 15:10:22 +00:00
Kostya Serebryany d8c29210e5 [asan] on linux, run __asan_init from .preinit_array (even earlier than before)
llvm-svn: 175623
2013-02-20 14:28:08 +00:00
Alexey Samsonov aadd1f2ad6 [Sanitizer] use raw syscall instead of _exit() function on Linux
llvm-svn: 175622
2013-02-20 13:54:32 +00:00
Kostya Serebryany ac05bc0556 [asan] add a lit test for invoke-with-no-return instrumentation
llvm-svn: 175618
2013-02-20 12:37:22 +00:00
Evgeniy Stepanov ec1d286111 [sanitizer] Fix lint.
llvm-svn: 175615
2013-02-20 11:06:07 +00:00
Kostya Serebryany 8381ef2035 [asan] add test throw_call_test (broken with -static-libstdc++)
llvm-svn: 175614
2013-02-20 10:43:05 +00:00
Evgeniy Stepanov 2e50efd484 [sanitizer] Fix FileOps test on Android.
llvm-svn: 175515
2013-02-19 15:01:05 +00:00
Kostya Serebryany 96401c9da9 [asan] don't run the long double test if long double is the same as double
llvm-svn: 175514
2013-02-19 13:43:44 +00:00
Evgeniy Stepanov 477e88ee9e [sanitizer] Slightly lower allocator test memory consumption.
This way it fits on a random 1G device.

llvm-svn: 175513
2013-02-19 13:38:27 +00:00
Alexey Samsonov 0b07c63e07 [ASan] Allow ASan default runtime options be overriden at compile time by providing ASAN_DEFAULT_OPTIONS macro
llvm-svn: 175512
2013-02-19 13:14:48 +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
Evgeniy Stepanov 76dc3a81ea [msan] Use slow stack unwinder in UMR reports.
llvm-svn: 175510
2013-02-19 12:43:18 +00:00