Evgeniy Stepanov
8d487b4407
[sanitizer] No dirent64 on Android.
...
llvm-svn: 177071
2013-03-14 13:24:03 +00:00
Alexey Samsonov
3d09fdbf21
[Sanitizer] Build sanitizer_common with -fno-rtti
...
llvm-svn: 177070
2013-03-14 13:16:35 +00:00
Kostya Serebryany
d332d42372
[asan] remove one redundant malloc stress test, unify the usage of ASAN_LOW_MEMORY macro in tests, slightly reduce test memory usage (all to make 32-bit runs consume less RAM)
...
llvm-svn: 177069
2013-03-14 13:16:09 +00:00
Alexander Potapenko
34e1171768
[libsanitizer] fixed a bug in ThreadLister tests where we forgot to terminate one thread
...
Patch by Sergey Matveev (earthdok@google.com )
llvm-svn: 177068
2013-03-14 13:15:14 +00:00
Evgeniy Stepanov
740e6ebe71
[msan] Add changes missing from r177065.
...
llvm-svn: 177067
2013-03-14 13:13:49 +00:00
Alexander Potapenko
ac3bbb3ef3
[libsanitizer] Fixed incorrect handling of pre-existing threads in ThreadLister test.
...
Also, extended the test to check that ThreadLister::Reset() works as intended.
Patch by Sergey Matveev (earthdok@google.com )
llvm-svn: 177060
2013-03-14 12:06:54 +00:00
Evgeniy Stepanov
231894a902
[sanitizer] Intercept frexp and friends.
...
llvm-svn: 177056
2013-03-14 11:34:39 +00:00
Alexey Samsonov
7d2385419a
[Sanitizer] fix compilation for Windows
...
llvm-svn: 177054
2013-03-14 11:29:06 +00:00
Alexey Samsonov
83e7622df6
[Sanitizer] Write a slightly better implementation of GetEnv() function on Windows
...
llvm-svn: 177051
2013-03-14 11:10:23 +00:00
Evgeniy Stepanov
96f82f8ac3
[sanitizer] Fix lint.
...
llvm-svn: 176943
2013-03-13 10:20:35 +00:00
Evgeniy Stepanov
98f5ea0dba
[msan] Increase stack size as required.
...
Adjust stack size in pthread_attr_t when the app-requested size does not fit MSan TLS.
llvm-svn: 176939
2013-03-13 09:01:40 +00:00
Evgeniy Stepanov
5697b58ec4
[sanitizer] Move GetTlsSize code from TSan to sanitizer_common.
...
llvm-svn: 176938
2013-03-13 08:19:53 +00:00
Evgeniy Stepanov
24aad9c0cb
Break a >80 char line.
...
llvm-svn: 176937
2013-03-13 08:17:39 +00:00
Alexey Samsonov
91f833a413
[Sanitizer] Fixup for r176931 for Mac and Windows
...
llvm-svn: 176935
2013-03-13 07:39:25 +00:00
Alexey Samsonov
d38aceda4e
[Sanitizer] Fix a typo in function name
...
llvm-svn: 176932
2013-03-13 06:55:02 +00:00
Alexey Samsonov
06d3aa4884
[Sanitizer] Change MemoryMappingLayout methods to also report memory protection flags (for future use in leak checker). Patch by Sergey Matveev.
...
llvm-svn: 176931
2013-03-13 06:51:02 +00:00
Kostya Serebryany
138b155042
[sanitizer] use fewer size classes in the allocator to reduce the memory footprint. There is no all-size-fits-all constant here, but this change is positive or neutral on several large apps I've tested
...
llvm-svn: 176855
2013-03-12 08:44:40 +00:00
Kostya Serebryany
ba56c8d4f9
[sanitizer] simplify the allocator's SizeClassMap: do not require an extra template parameter, instead compute it in flight. No functionality change
...
llvm-svn: 176853
2013-03-12 07:01:27 +00:00
Alexey Samsonov
db7d9656bb
[Sanitizer] Implement BlockingMutex::CheckLocked()
...
llvm-svn: 176805
2013-03-11 15:45:20 +00:00
Alexander Potapenko
1f78ad5da4
[ASan] Reduce the local buffer size in Report() not to fail the check enforced when building TSan runtime.
...
llvm-svn: 176804
2013-03-11 13:36:39 +00:00
Alexander Potapenko
18c916c6c5
[ASan] Try to use a small (512 bytes) stack-local buffer in Report() for short messages, fall back to MmapOrDie() in the case of a failure.
...
This shall eliminate most of the cryptic "ERROR: failed to mmap" messages caused by recursively calling MmapOrDie() from MmapOrDie().
llvm-svn: 176802
2013-03-11 11:47:43 +00:00
Alexander Potapenko
92cc1a6d24
[ASan] don't call strerr from functions that map memory, since this results in malloc().
...
llvm-svn: 176800
2013-03-11 10:21:28 +00:00
Kostya Serebryany
0f5c20b417
[sanitizer] make SizeClassAllocator64::GetBlockBegin more bullet proof (by Sergey Matveev)
...
llvm-svn: 176799
2013-03-11 09:43:12 +00:00
Reid Kleckner
c193da57b8
[msan] pthread_join() returns int, not void*
...
pthread_join() returns an error code, not the result of the
pthread_create() function like I thought.
llvm-svn: 176554
2013-03-06 15:41:35 +00:00
Reid Kleckner
66c26e5e96
[sanitizers] Fix check failure on dealloc from new thread
...
Summary:
Adds a test for this case, which was reduced from a chromium build of
WebKit's DumpRenderTree.
Reviewers: eugenis
CC: glider
Differential Revision: http://llvm-reviews.chandlerc.com/D495
llvm-svn: 176552
2013-03-06 14:54:08 +00:00
Alexey Samsonov
dcb0e72e6f
[Sanitizer] fix signed-unsigned mismatch in test and use correct order of EXPECT_EQ() args
...
llvm-svn: 176479
2013-03-05 12:23:07 +00:00
Alexey Samsonov
434dde9996
[Sanitizer] Add methods back() and pop_back() to InternalVector. Patch by Sergey Matveev
...
llvm-svn: 176478
2013-03-05 11:58:25 +00:00
Evgeniy Stepanov
323771b3f1
[sanitizer] Fix check failure in SizeClassMap::Print.
...
llvm-svn: 176338
2013-03-01 08:49:14 +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
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
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
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
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
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
Alexey Samsonov
aadd1f2ad6
[Sanitizer] use raw syscall instead of _exit() function on Linux
...
llvm-svn: 175622
2013-02-20 13:54:32 +00:00
Evgeniy Stepanov
ec1d286111
[sanitizer] Fix lint.
...
llvm-svn: 175615
2013-02-20 11:06:07 +00:00
Evgeniy Stepanov
2e50efd484
[sanitizer] Fix FileOps test on Android.
...
llvm-svn: 175515
2013-02-19 15:01:05 +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
99b81b4bbe
[Sanitizer] Allow runtime flags be separated by colon as well as space
...
llvm-svn: 175511
2013-02-19 13:03:37 +00:00
Kostya Serebryany
9f298da9bd
[asan] instrument memory accesses with unusual sizes
...
This patch makes asan instrument memory accesses with unusual sizes (e.g. 5 bytes or 10 bytes), e.g. long double or
packed structures.
Instrumentation is done with two 1-byte checks
(first and last bytes) and if the error is found
__asan_report_load_n(addr, real_size) or
__asan_report_store_n(addr, real_size)
is called.
asan-rt part
Also fix lint.
llvm-svn: 175508
2013-02-19 11:30:25 +00:00
Evgeniy Stepanov
adaca58526
[msan] Fix ReExec on linux.
...
execle(argv[0], ...) is wrong, because argv[0] may contain a PATH-resolvable
program name. Execute /proc/self/exe instead.
llvm-svn: 175504
2013-02-19 11:09:29 +00:00
Evgeniy Stepanov
3e2e32c618
[sanitizer] Fix Android build.
...
llvm-svn: 175503
2013-02-19 11:06:41 +00:00