Alexey Samsonov
4e958e5ddb
Fix-up copypasto from r172410
...
llvm-svn: 172419
2013-01-14 14:52:35 +00:00
Evgeniy Stepanov
cfe3b3b956
Build rules for sanitizer_common tests on Android.
...
llvm-svn: 172410
2013-01-14 14:08:25 +00:00
Evgeniy Stepanov
e375a1f036
Remove thread-locals from sanitizer_common tests.
...
Not supported on Android.
llvm-svn: 172408
2013-01-14 14:06:58 +00:00
Kostya Serebryany
f55e719a13
[asan] add more frames to standalone_malloc_test
...
llvm-svn: 172383
2013-01-14 07:59:09 +00:00
Dmitry Vyukov
3d462f89de
asan: add missing file
...
llvm-svn: 172381
2013-01-14 07:52:01 +00:00
Dmitry Vyukov
f22982bf0a
asan/tsan: move blocking mutex from asan to sanitizer_common
...
llvm-svn: 172380
2013-01-14 07:51:39 +00:00
Dmitry Vyukov
ecd73d36d4
asan/tsan: faster memory allocator
...
replace lists with arrays
llvm-svn: 172217
2013-01-11 16:41:19 +00:00
Dmitry Vyukov
f3a7087194
asan: improve allocator benchmark
...
llvm-svn: 172213
2013-01-11 16:22:53 +00:00
Dmitry Vyukov
83c4a77265
asan: improve the benchmark
...
llvm-svn: 172209
2013-01-11 15:57:19 +00:00
Dmitry Vyukov
c14bb685a1
asan/tsan: fix bug in list implementation
...
llvm-svn: 172187
2013-01-11 10:15:13 +00:00
Kostya Serebryany
e1be48fe64
[sanitizer] fix the non-cmake build (2-nd attempt)
...
llvm-svn: 172068
2013-01-10 13:33:15 +00:00
Kostya Serebryany
1199dc0327
[sanitizer] fix the non-cmake build
...
llvm-svn: 172063
2013-01-10 13:05:16 +00:00
Kostya Serebryany
4f6e4ae44a
[sanitizer] add standalone_malloc_test
...
llvm-svn: 172061
2013-01-10 12:34:12 +00:00
Kostya Serebryany
cb510e50e2
[asan] implement more strict checking for memset/etc parameters. Instead of checking the first and the last byte, we check the entire shadow region. This costs ~10 slowdown for the instrumented functions. Motivated by a nasty memset-buffer-overflow-by-140-bytes in chrome which was reported as a use-after-free or not at all
...
llvm-svn: 171198
2012-12-28 15:24:16 +00:00
Alexey Samsonov
c20f5d2246
Define COMPILER_RT_CAN_EXECUTE_TESTS variable on platforms where we can produce working binaries and use it in build rules for sanitizers tests
...
llvm-svn: 171160
2012-12-27 13:19:23 +00:00
Kostya Serebryany
6f604b5007
[asan/tsan] when unmapping a chunk of user memory, apply madvise(MADV_DONTNEED) to the corresponding chunk of shadow memory. Also update sanitizer_allocator64_testlib.cc
...
llvm-svn: 171144
2012-12-27 07:37:24 +00:00
Dmitry Vyukov
116518af74
tsan: fix tests to consistently use internal functions (otherwise it leads to false positives)
...
llvm-svn: 171057
2012-12-25 09:20:58 +00:00
Kostya Serebryany
ad24c58e16
[sanitizer] increase the maximum size class of the fast allocator. This should save quite a bit of memory in tsan/msan (and later in asan). This also puts more stress on the large allocator. Add a couple of checks
...
llvm-svn: 171055
2012-12-25 07:50:35 +00:00
Kostya Serebryany
db3250b8b3
[sanitizer] fix gcc warnings, enable one tests under asan_allocator2
...
llvm-svn: 171036
2012-12-24 14:53:13 +00:00
Kostya Serebryany
fc7de2910c
[sanitizer] make LargeMmapAllocator::GetBlockBegin faster by not using a linked list
...
llvm-svn: 171035
2012-12-24 14:35:14 +00:00
Kostya Serebryany
ebb23c8cfa
[sanitizer] rework the size class map in the sanitizer allocator: make the differences between size classes more uniform.
...
llvm-svn: 171031
2012-12-24 13:41:07 +00:00
Alexey Samsonov
e30a84f08f
[Sanitizer] CMake build rules for unittests: depend on headers when compiling a file with custom clang.
...
llvm-svn: 170897
2012-12-21 14:04:52 +00:00
Alexey Samsonov
53a965e125
[Sanitizer] Don't implicitly add object files to the list of dependencies when building compiler_rt unittests. Fix sanitizer_common and asan build rules accordingly. This also fixes check-sanitizer command on Ninja.
...
llvm-svn: 170870
2012-12-21 08:56:14 +00:00
Alexey Samsonov
aef6b78bcb
[Sanitizer] Fix CMake build rules for sanitizer_common tests to respect universal static libraries on Mac
...
llvm-svn: 170698
2012-12-20 14:38:02 +00:00
Alexey Samsonov
01674dfc8f
[Sanitizer] Modify CMake build rules for sanitizer_common unit tests: build them with fresh Clang for both 32- and 64-bits (if possible)
...
llvm-svn: 170691
2012-12-20 13:24:21 +00:00
Kostya Serebryany
2abbce6701
[sanitizer] one more stability fix in 64-bit allocator
...
llvm-svn: 170498
2012-12-19 06:51:45 +00:00
Kostya Serebryany
12676268fa
[sanitizer] fix LargeMmapAllocator::GetBlockBegin
...
llvm-svn: 170434
2012-12-18 14:56:38 +00:00
Kostya Serebryany
c8208c5258
[sanitizer] fix a bug that has crept into the sanitizer allocator and caused SEGV on allocations between 1Mb and 2Mb, improve the test
...
llvm-svn: 170274
2012-12-15 18:36:23 +00:00
Alexey Samsonov
6a68a9117b
[Sanitizer] remove extra typename
...
llvm-svn: 170208
2012-12-14 15:37:35 +00:00
Kostya Serebryany
673c052631
[sanitizer] add AllocatorLeakTest
...
llvm-svn: 170206
2012-12-14 14:20:29 +00:00
Dmitry Vyukov
51b6e07deb
tsan: fix lint warning
...
llvm-svn: 170202
2012-12-14 13:46:03 +00:00
Dmitry Vyukov
34aef74a4d
tsan: disable allocator tests in debug build
...
llvm-svn: 170187
2012-12-14 10:17:22 +00:00
Dmitry Vyukov
ed6d54368c
tsan: comment out debug output in test
...
llvm-svn: 170186
2012-12-14 10:12:14 +00:00
Kostya Serebryany
2ce42e0aef
[sanitizer] change the way SizeClassAllocator64 allocated memory from the system: instead of one huge mmap(NORESERVE) it does one huge mprotect and then does small on-demand mmaps. This allows us to call OnMap callbacks which are required to poison newly allocated memory in asan
...
llvm-svn: 170097
2012-12-13 05:05:11 +00:00
Kostya Serebryany
e29883c10a
[sanitizer] add OnMap/OnUmap callbacks to the allocator interface
...
llvm-svn: 169985
2012-12-12 14:32:18 +00:00
Kostya Serebryany
40bac5b01f
[asan] fix lint, remove debug prints
...
llvm-svn: 169620
2012-12-07 18:07:52 +00:00
Kostya Serebryany
35f9e5e87b
[sanitizer] implement SanitizerSetThreadName/SanitizerGetThreadName. Just for linux so far (using prctl(PR_GET_NAME))
...
llvm-svn: 169598
2012-12-07 11:27:24 +00:00
Kostya Serebryany
52a3b92abd
[sanitizer] try not to use libc mem* functions in sanitizer_common tests (conflicts with our own interceptors)
...
llvm-svn: 169595
2012-12-07 10:13:10 +00:00
Kostya Serebryany
6d2d30f61d
[asan/msan] one more test for 32-bit allocator + minor code simplification
...
llvm-svn: 169507
2012-12-06 14:39:41 +00:00
Kostya Serebryany
c14ae88b08
[asan/msan] add BulkAllocate to the 32-bit allocator (and a test)
...
llvm-svn: 169506
2012-12-06 14:27:32 +00:00
Kostya Serebryany
9f84eecc9e
[asan/msan] add GetBlockBegin to the 32-bit allocator (+test)
...
llvm-svn: 169499
2012-12-06 13:13:58 +00:00
Kostya Serebryany
2731cb23b1
[asan/msan] one more test for 32-bit allocator
...
llvm-svn: 169497
2012-12-06 13:00:11 +00:00
Kostya Serebryany
2044135dca
[asan/msan] new 32-bit allocator, basic functionality so far
...
llvm-svn: 169496
2012-12-06 12:49:28 +00:00
Kostya Serebryany
1e3d387459
[tsan] add MmapAlignedOrDie
...
llvm-svn: 169474
2012-12-06 06:10:31 +00:00
Kostya Serebryany
571232b8cf
[tsan] get rid of *allocator64* files, moving everything to *allocator* files. This will help with the 32-bit allocator implementation and testing
...
llvm-svn: 169368
2012-12-05 10:09:15 +00:00
Kostya Serebryany
7436d95c9c
[tsan] test the allocator with CompactSizeClassMap
...
llvm-svn: 169270
2012-12-04 14:39:51 +00:00
Kostya Serebryany
f299288f55
[tsan] minor interface refactoring
...
llvm-svn: 169267
2012-12-04 14:15:17 +00:00
Kostya Serebryany
5e6f833bdd
[tsan] refactor the allocator tests to allow testing other flavours of the allocator (add templates)
...
llvm-svn: 169264
2012-12-04 13:59:22 +00:00
Kostya Serebryany
485f7b4a70
[tsan] add CompactSizeClassMap as an alternative (more compact) size class map. Not used yet.
...
llvm-svn: 169128
2012-12-03 15:00:33 +00:00
Kostya Serebryany
dab61684ef
[tsan] remove unused InternalAllocBlock as part of larger refactoring
...
llvm-svn: 169123
2012-12-03 11:57:01 +00:00
Dmitry Vyukov
2429b02770
tsan: move traces from tls into dedicated storage at fixed address
...
helps to reduce tls size (it's weird to have multi-MB tls)
will help with dynamically adjustable trace size
llvm-svn: 168783
2012-11-28 10:35:31 +00:00
Kostya Serebryany
df198db1aa
[asan/tsan] get rid of kPageSize completely in favor of GetPageSizeCached(). This makes the code friendly to more platforms
...
llvm-svn: 168537
2012-11-24 05:03:11 +00:00
Dmitry Vyukov
35437032be
tsan: better error message for OOM
...
llvm-svn: 168491
2012-11-22 08:42:01 +00:00
Alexey Samsonov
f7a24c4e2b
[Sanitizer] fix printf unittest on 32-bit arch
...
llvm-svn: 167297
2012-11-02 14:28:17 +00:00
Alexey Samsonov
008274440a
[Sanitizer] move unit test for Printf from tsan to sanitizer_common
...
llvm-svn: 167296
2012-11-02 12:36:11 +00:00
Alexander Potapenko
2a1925852d
Fix the internal_memmove() implementation that used to skip src[0] if dst < src.
...
llvm-svn: 166774
2012-10-26 13:24:20 +00:00
Kostya Serebryany
0a31ed1417
[tsan] fix the tsan allocator to handle any alignment
...
llvm-svn: 164107
2012-09-18 06:00:59 +00:00
Dmitry Vyukov
4d743f5346
tsan: reserve msb in stack depot id's (required for msan)
...
llvm-svn: 164010
2012-09-17 03:14:15 +00:00
Alexey Samsonov
100150f59d
[Sanitizer] test 64-bit allocator only on suitable targets
...
llvm-svn: 163615
2012-09-11 12:19:18 +00:00
Alexey Samsonov
894069796e
[Sanitizer] Add new lit testsuite: check-sanitizer that runs unit tests for sanitizer_common runtime (shared between ASan and TSan)
...
llvm-svn: 163610
2012-09-11 10:50:32 +00:00
Alexey Samsonov
c21f901b2f
[Sanitizer] fix warnings reported by gcc. Update the list of targets to check lint for
...
llvm-svn: 163608
2012-09-11 10:31:28 +00:00
Alexey Samsonov
fcbc97a13f
[Sanitizer] remove custom Die/CheckFailed from allocator testlib
...
llvm-svn: 163604
2012-09-11 09:48:52 +00:00
Alexey Samsonov
329eae86ef
[Sanitizer] Resolve fixme: break dependency of sanitizer_common tests on TSan RTL
...
llvm-svn: 162984
2012-08-31 10:15:44 +00:00
Dmitry Vyukov
191f2f7cdb
tsan: use stack depot to describe heap blocks
...
llvm-svn: 162902
2012-08-30 13:02:30 +00:00
Dmitry Vyukov
f4792878c4
asan/tsan: first version of "stack depot"
...
llvm-svn: 162897
2012-08-30 10:02:48 +00:00
Alexey Samsonov
d1d1a814b7
[Sanitizer] align allocation sizes in low level allocator
...
llvm-svn: 162676
2012-08-27 14:51:36 +00:00
Dmitry Vyukov
7e6347402d
tsan: fix new memory allocator
...
Deallocate: drain blocks to central cache if cached too much (instead of never drain).
Allocate: batch allocate fixed amount of blocks (instead of all blocks).
This significantly reduces memory consumption of large heavy-multithreaded programs.
llvm-svn: 162447
2012-08-23 17:16:07 +00:00
Alexey Samsonov
e6704ee109
[Sanitizer] define InternalScopedBuffer to replace large arrays on stack. It is defined analogous to similar class in tsan and should replace it.
...
llvm-svn: 162262
2012-08-21 08:13:37 +00:00
Dmitry Vyukov
4b5ec3145a
tsan: add some more tests for memory allocator
...
llvm-svn: 161950
2012-08-15 14:25:33 +00:00
Kostya Serebryany
7a32f8dcb8
[tsan] fix lint
...
llvm-svn: 160504
2012-07-19 12:22:04 +00:00
Kostya Serebryany
a415df6539
[tsan] minor fixes in tsan allocator and its testlib. Now runs fine with chrome
...
llvm-svn: 160503
2012-07-19 12:15:33 +00:00
Kostya Serebryany
ab34919413
[tsan] minor enhancements in the new tsan allocator and a test malloc replacement library that can be linked to any program to replace malloc (tested on spec2006)
...
llvm-svn: 160436
2012-07-18 16:04:55 +00:00
Alexey Samsonov
4dbfad627e
[Sanitizer] add missing unit test for flag parsing (forgot to run svn add before)
...
llvm-svn: 160428
2012-07-18 06:29:18 +00:00
Alexey Samsonov
d77fbba74a
[Sanitizer] implement straightforward nlogn sorting, as qsort() may call malloc, which leads to deadlock in ASan allocator
...
llvm-svn: 160262
2012-07-16 11:27:17 +00:00
Kostya Serebryany
739b0de5b1
[tsan] start using AllocatorCache in CombinedAllocator
...
llvm-svn: 159825
2012-07-06 14:32:00 +00:00
Kostya Serebryany
d1e6094f9e
[tsan] implement SizeClassAllocatorLocalCache (part of tsan allocator)
...
llvm-svn: 159823
2012-07-06 13:46:49 +00:00
Kostya Serebryany
78e973fa6b
[tsan] use intrusive list in the new tsan allocator
...
llvm-svn: 159814
2012-07-06 09:26:01 +00:00
Kostya Serebryany
ff13537a94
[tsan] add intrusive list to be used in tsan allocator, etc
...
llvm-svn: 159812
2012-07-06 09:03:45 +00:00
Dmitry Vyukov
513f0238d8
tsan/asan: add SpinMutex to sanitizer_common
...
llvm-svn: 159439
2012-06-29 17:32:18 +00:00
Kostya Serebryany
92afdb6c31
[tsan] added CombinedAllocator for tsan
...
llvm-svn: 159432
2012-06-29 15:35:18 +00:00
Kostya Serebryany
4196046714
[tsan] added LargeMmapAllocator, a part of the new tsan allocator
...
llvm-svn: 159204
2012-06-26 14:23:32 +00:00
Dmitry Vyukov
c598de93bd
tsan: remove internal allocator, switch to sanitizer_common one.
...
llvm-svn: 159142
2012-06-25 15:09:24 +00:00
Kostya Serebryany
100590f756
[tsan] minor changes in tsan allocator
...
llvm-svn: 159139
2012-06-25 14:53:49 +00:00
Kostya Serebryany
f299f7013a
[tsan] a better CHECK for OOM in the new allocator
...
llvm-svn: 159122
2012-06-25 04:12:49 +00:00
Kostya Serebryany
278ccdacdc
[tsan] add metadata to the new tsan allocator
...
llvm-svn: 159002
2012-06-22 16:13:28 +00:00
Kostya Serebryany
5b01415dc0
[tsan] more code for a specialized tsan allocator
...
llvm-svn: 158991
2012-06-22 13:00:50 +00:00
Kostya Serebryany
6e26fa9dd1
[tsan] first step in implementing a custom allocator for tsan (and msan) which saves precious shadow
...
llvm-svn: 158913
2012-06-21 10:04:36 +00:00