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
875f99a6bf
[asan] fix -Wsign-compare
...
llvm-svn: 159083
2012-06-23 16:30:48 +00:00
Chandler Carruth
6e2bf8f2bb
Mechanical change to sink a #ifdef guard for a platform below the
...
include of int_lib.h.
The purpose of this change is to make the C code conform to the pedantic
rules of C99 -- an empty translation unit is not valid. It should have
absolutely no functional impact, and changes nothing about the built
libraries.
llvm-svn: 159034
2012-06-22 21:09:22 +00:00
Chandler Carruth
321916a76b
Remove extraneous semicolons outside of functions. This fixes a large
...
number of -pedantic warnings.
llvm-svn: 159033
2012-06-22 21:09:15 +00:00
Chandler Carruth
e80a289fdc
Reorder these things for clarity, and add -std=c99 to the compile flags.
...
llvm-svn: 159032
2012-06-22 21:09:10 +00:00
Chandler Carruth
84ba680c83
Disable the test subdirectory entirely until we get fresh CMake files
...
there. I didn't notice this because I had a stub that wasn't checked in
floating around in my client.
llvm-svn: 159025
2012-06-22 20:17:27 +00:00
Kostya Serebryany
278ccdacdc
[tsan] add metadata to the new tsan allocator
...
llvm-svn: 159002
2012-06-22 16:13:28 +00:00
Stephen Canon
c3b81119a7
Allow divsi3 to take advantage of a hardware unsigned divide when it is available, by replacing an explicit call to udivsi3 with the divide operator. Patch by Sébastien Bourdeauducq.
...
llvm-svn: 158996
2012-06-22 14:44:13 +00:00
Kostya Serebryany
5b01415dc0
[tsan] more code for a specialized tsan allocator
...
llvm-svn: 158991
2012-06-22 13:00:50 +00:00
Dmitry Vyukov
de1fd1c83b
tsan: do not call malloc/free in memory access handling routine.
...
This improves signal-/fork-safety of instrumented programs.
llvm-svn: 158988
2012-06-22 11:08:55 +00:00
Alexander Potapenko
245f4ae59a
Small lint fix.
...
llvm-svn: 158922
2012-06-21 16:40:59 +00:00
Alexander Potapenko
70feed27ea
Add a test for issue 81 -- AddressSanitizerMac.DISABLED_CFAllocatorDefaultDoubleFree_ChildPhread
...
llvm-svn: 158921
2012-06-21 16:08:11 +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
Alexey Samsonov
f8947a3360
[ASan] fix lint error
...
llvm-svn: 158905
2012-06-21 08:13:49 +00:00
Alexander Potapenko
15b4cafd2c
Enable AddressSanitizerMac.CFAllocatorDefaultDoubleFree and AddressSanitizerMac.CFAllocatorMallocDoubleFree, which now work fine.
...
llvm-svn: 158886
2012-06-21 01:04:30 +00:00
Alexander Potapenko
1bde28b464
Factor the common code out of cf_free and mz_free.
...
Introduce the mac_ignore_invalid_free flag (0 by default) which makes both cf_free and mz_free ignore invalid free invocations and leak memory.
llvm-svn: 158885
2012-06-21 01:01:20 +00:00
Alexander Potapenko
642371724e
Fix the output tests on Darwin
...
llvm-svn: 158870
2012-06-20 23:07:55 +00:00
Alexander Potapenko
f9f2fbacb3
Actually intercept free() to ensure that the deallocations caused by other functions directly calling it are routed to our allocator.
...
For the allocations that do not belong to any malloc zone check whether they're padded with a pointer to ASan's CFAllocator. If so, free the original (unpadded) pointer.
This should fix AddressSanitizerMac.NSURLDeallocation and issue 70.
llvm-svn: 158863
2012-06-20 22:29:09 +00:00
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