Commit Graph

746 Commits

Author SHA1 Message Date
Alexander Potapenko 50e788b724 Add a test for NSURL deallocation (issue 70)
llvm-svn: 158843
2012-06-20 20:28:39 +00:00
Kostya Serebryany 98390d0b71 [tsan] a bit more lint and Makefile changes to run tests from sanitizer_common
llvm-svn: 158821
2012-06-20 15:19:17 +00:00
Chandler Carruth bf22bd21e9 Resuming work on the compiler-rt CMake build at long long last. In order
to get it working again, two changes were needed:

- I had to give up on glob-based file expansion. This just isn't well
  supported by CMake, and until we convince upstream there of its value,
  it's not worth dealing with the pain.
- Add the common library as otherwise even ASan won't build.

This now builds again, although the "correctness" of it is a touch
debatable. ;] Specifically, there is no merging of the common runtime
library with the asan runtime library into a single archive file. I'm
not really sure what the best technique is for that, and it may be
influenced by the ongoing discussion about how best to link runtime
libraries.

Note of course that this is still very much WIP. It doesn't entirely
work yet, and remains disabled by the LLVM projects/CMakeLists.txt until
it is in a working state.

llvm-svn: 158811
2012-06-20 10:18:43 +00:00
Alexey Samsonov e1cb524226 [Sanitizer] Renaming: SNPrintf -> internal_snprintf (and move it to sanitizer libc)
llvm-svn: 158710
2012-06-19 09:21:57 +00:00
Alexey Samsonov b1c3991915 [TSan] Add a comment that tsan_flags.h may be included in the user code, and therefore shouldn't include other headers from TSan or common sanitizer runtime. User may need tsan_flags.h to provide its implementation of __tsan::OverrideFlags
llvm-svn: 158708
2012-06-19 08:57:53 +00:00
Alexey Samsonov af70c09b84 [Sanitizer] State that sanitizer_libc.h header can be included in the user code (and therefore it shouldn't include other sanitizer runtime headers).
llvm-svn: 158707
2012-06-19 08:52:02 +00:00
Alexey Samsonov b13ac747d4 [Sanitizer] use fully qualified type for placement new replacement
llvm-svn: 158706
2012-06-19 07:40:45 +00:00
Alexey Samsonov d9ae7adb84 [TSan] silence -Winternal-linkage-in-inlinewarning which is produced for gtest code
llvm-svn: 158705
2012-06-19 07:38:11 +00:00
Joerg Sonnenberger 8524f0ba2f Declare some variables unsigned to avoid signed vs unsigned mismatches.
This exploits the relative order of the arguments and/or checks already
made in the functions.

llvm-svn: 158669
2012-06-18 18:51:13 +00:00
Alexey Samsonov 8516014790 [Sanitizer] add internal_strncmp to sanitizer libc
llvm-svn: 158658
2012-06-18 14:34:59 +00:00
Alexey Samsonov cf7d233ac0 [TSan] kill some linux-specific code in favor of code in common runtime: reuse wrappers for mmap routines, ProcessMaps iterator, thread stack calculation
llvm-svn: 158657
2012-06-18 09:42:39 +00:00
Alexey Samsonov 58a3c58ec9 [Sanitizer] move different wrappers from TSan to common sanitizer runtime
llvm-svn: 158655
2012-06-18 08:44:30 +00:00
Alexey Samsonov 25c40e5a5b [Sanitizer] Fix type for placement new on 32-bit Mac
llvm-svn: 158524
2012-06-15 14:32:39 +00:00
Alexey Samsonov 0d76e8983f [Sanitizer] Use ProcessMaps in symbolizer to get module name and offset for instruction address
llvm-svn: 158522
2012-06-15 14:00:25 +00:00
Alexey Samsonov 156958dd0c [Sanitizer] move all the rest re-implementations of libc functions from ASan runtime to common sanitizer runtime
llvm-svn: 158519
2012-06-15 13:09:52 +00:00
Alexey Samsonov 3efd6fc26c [Sanitizer] Use DEFINE_REAL macro in TSan runtime to call libc implementations of functions. Move strchr to sanitizer_libc.
llvm-svn: 158517
2012-06-15 12:24:07 +00:00
Bill Wendling f11b42e396 Free the allocated filename. Found by clang static analyzer.
llvm-svn: 158514
2012-06-15 09:12:04 +00:00
Alexey Samsonov 8c4dcd72e3 [Sanitizer] Use mmaped buffer in DumpProcessMaps to avoid large stack frames
llvm-svn: 158502
2012-06-15 07:41:23 +00:00
Alexey Samsonov 1042454b66 [TSan] don't use too new __attribute__((unused)) for class member
llvm-svn: 158500
2012-06-15 07:33:49 +00:00
Alexey Samsonov 40e5128412 [Sanitizer] move ShadowRangeIsAvailable and several defines to common runtime
llvm-svn: 158499
2012-06-15 07:29:14 +00:00
Alexey Samsonov e4a889866d [Sanitizer] move atomic ops, min/max and sort to commnon runtime
llvm-svn: 158496
2012-06-15 07:00:31 +00:00
Alexey Samsonov 70afb91636 [Sanitizer] move more portability wrappers to common runtime: sleep, _exit, abort, atexit, pthread_self
llvm-svn: 158493
2012-06-15 06:37:34 +00:00
Alexey Samsonov ae1e171b72 [Sanitizer] move DumpProcessMap and DisableCoreDumper to common runtime
llvm-svn: 158490
2012-06-15 06:08:19 +00:00
Dmitry Vyukov ea03fc2d78 tsan: fix COMPAT mapping to not produce false reports
llvm-svn: 158473
2012-06-14 21:40:35 +00:00
Nico Weber 34fd6e9cc2 Don't build compiler-rt arm code on darwin. Fixes PR12918.
I'm not sure if this is the right fix, but this has been broken
for two weeks and pleas for review were ignored. It seems to do
the right thing.

llvm-svn: 158466
2012-06-14 20:00:25 +00:00
Nico Weber 4555d5b471 80 columns
llvm-svn: 158465
2012-06-14 19:58:46 +00:00
Alexey Samsonov c70d1086f6 [Sanitizer] move rest of mmap routines to common sanitizer runtime
llvm-svn: 158452
2012-06-14 14:42:58 +00:00
Alexey Samsonov 0c53a38abb [Sanitizer] move portable GetEnv to common sanitizer runtime
llvm-svn: 158451
2012-06-14 14:07:21 +00:00
Alexey Samsonov 96ef49a71e [Sanitizer] Move internal_memcmp to common sanitizer libc
llvm-svn: 158450
2012-06-14 14:04:54 +00:00
Alexey Samsonov aac5d0c831 [Sanitizer] Workaround for -Wunused-private-field warning - add an attribute in TSan unit test, and silence this warning as gtest has unused fields.
llvm-svn: 158449
2012-06-14 14:02:32 +00:00
Alexey Samsonov 52f946611f [ASan] don't include deleted header
llvm-svn: 158448
2012-06-14 13:15:45 +00:00
Alexey Samsonov 53daa28e77 [ASan] remove obsolete header asan_procmaps.h
llvm-svn: 158447
2012-06-14 12:51:20 +00:00
Alexander Potapenko 919b4bde28 Add test rdx, rdx to fix ASan tests on Mac OS 10.7 x64
llvm-svn: 158312
2012-06-11 15:38:07 +00:00
Alexey Samsonov bb62f555f3 [Sanitizer] Use __libc_malloc/__libc_free instead of malloc/free inside internal allocator on Linux (important for TSan)
llvm-svn: 158261
2012-06-09 09:21:44 +00:00
Alexey Samsonov f516d39c1f [TSan] use efficient real_memcpy inside runtime
llvm-svn: 158260
2012-06-09 09:14:24 +00:00
Alexey Samsonov 59036d2c06 [Sanitizer] add internal_memset and internal_strrchr to sanitizer_common/
llvm-svn: 158202
2012-06-08 14:11:12 +00:00
Alexey Samsonov 99d58521c5 [ASan] allow calls to memmove during rtl initialization
llvm-svn: 158201
2012-06-08 14:04:04 +00:00
Alexey Samsonov 6cfc34ea7f [TSan] s/internal_memset/real_memset
llvm-svn: 158200
2012-06-08 13:59:39 +00:00
Alexey Samsonov f26b842ca8 [ASan] add interceptor for strncat
llvm-svn: 158198
2012-06-08 13:27:46 +00:00
Alexey Samsonov 91e1a7eb17 [Sanitizer] move internal_strdup and internal_memcpy to common runtime. Make internal allocations from TSan runtime call InternalAlloc from common runtime
llvm-svn: 158148
2012-06-07 11:54:08 +00:00
Alexey Samsonov 8b9aea522f [Sanitizer] use unsigned int as a parameter for placement new on 32 bits
llvm-svn: 158147
2012-06-07 10:09:41 +00:00
Alexey Samsonov 8bd9098b32 [Sanitizer] move placement_new definiton from TSan to common runtime
llvm-svn: 158145
2012-06-07 09:50:16 +00:00
Alexey Samsonov 94e2b7d040 [Sanitizer] include stdlib.h header to get malloc/free
llvm-svn: 158144
2012-06-07 09:26:13 +00:00
Kostya Serebryany 0b14fd855b [asan] slow 16-byte redzones (still experimental)
llvm-svn: 158143
2012-06-07 09:15:48 +00:00
Alexey Samsonov 3a6ddb86e8 [Sanitizer] Allocator for internal runtime purposes. Currently it calls libcmalloc, but we might have to make it more low-level in future
llvm-svn: 158142
2012-06-07 08:52:56 +00:00
Alexey Samsonov cf4d3a027d [Sanitizer] Fix mac build.
llvm-svn: 158141
2012-06-07 07:32:00 +00:00
Alexey Samsonov 4b1f1031e6 [Sanitizer] factor out GetThreadStackTopAndBottom from ASan runtime to common.
llvm-svn: 158140
2012-06-07 07:13:46 +00:00
Alexey Samsonov 28a9895ee0 [Sanitizer] __asan::AsanProcMaps -> __sanitizer::ProcessMaps.
llvm-svn: 158139
2012-06-07 06:15:12 +00:00
Alexey Samsonov fe44fbd750 [Sanitizer] Move ReadFileToBuffer to sanitizer_common.
llvm-svn: 158138
2012-06-07 05:38:26 +00:00
Kostya Serebryany 112ac68d52 [asan] more compaction: don't use the next field while the chunk is in allocated state
llvm-svn: 158083
2012-06-06 16:58:21 +00:00