Kostya Serebryany
734f1eb5f4
[asan/tsan] do not use __WORDSIZE macro, as it is glibc-private thing. Instead, define our own SANITIZER_WORDSIZE
...
llvm-svn: 168424
2012-11-21 12:38:58 +00:00
Alexander Potapenko
bcc00a4174
[ASan] Revert r168040 and r168043 and take a cleaner solution suggested by Kostya: return the known frame name for fake stack instead of looking it up.
...
llvm-svn: 168046
2012-11-15 15:24:42 +00:00
Alexander Potapenko
b34db9e883
[ASan] Poison the leftmost shadow byte with a special value so that we can find
...
the beginning of the fake frame when reporting an use-after-return error.
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=126
llvm-svn: 168040
2012-11-15 13:40:44 +00:00
Alexey Samsonov
8661465edd
[ASan] Move printing descriptions of heap addresses in error report from allocator internals to asan_report.cc.
...
llvm-svn: 164112
2012-09-18 07:38:10 +00:00
Alexey Samsonov
c402cb62fd
[ASan] Add print_full_thread_history runtime option (on by default) that prints all full thread creation paths for threads involved in ASan error report
...
llvm-svn: 163200
2012-09-05 07:37:15 +00:00
Alexey Samsonov
c3a8119a41
Whitespace/lint
...
llvm-svn: 162909
2012-08-30 14:22:21 +00:00
Chandler Carruth
1aa4fef601
Relocate the external headers provided by ASan and the common sanitizer
...
library.
These headers are intended to be available to user code when built with
AddressSanitizer (or one of the other sanitizer's in the future) to
interface with the runtime library. As such, they form stable external
C interfaces, and the headers shouldn't be located within the
implementation.
I've pulled them out into what seem like fairly obvious locations and
names, but I'm wide open to further bikeshedding of these names and
locations.
I've updated the code and the build system to cope with the new
locations, both CMake and Makefile. Please let me know if this breaks
anyone's build.
The eventual goal is to install these headers along side the Clang
builtin headers when we build the ASan runtime and install it. My
current thinking is to locate them at:
<prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h
<prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h
<prefix>/lib/clang/X.Y/include/sanitizer/...
But maybe others have different suggestions?
Fixing the style of the #include between these headers at least unblocks
experimentation with installing them as they now should work when
installed in these locations.
llvm-svn: 162822
2012-08-29 02:27:54 +00:00
Kostya Serebryany
a57b4e823a
[asan] even more refactoring to move StackTrace to sanitizer_common
...
llvm-svn: 162754
2012-08-28 13:49:49 +00:00
Kostya Serebryany
6b0d775229
[asan] some renaming before we move StackTrace into sanitizer_common
...
llvm-svn: 162747
2012-08-28 11:54:30 +00:00
Kostya Serebryany
bb6f165952
[asan] get rid of AsanPrintf in favor of Printf from sanitizer_common
...
llvm-svn: 162746
2012-08-28 11:34:40 +00:00
Alexey Samsonov
de17f86655
[ASan] make ASan malloc/free hooks weak interface functions, overridable by user. Now the user can control malloc/free hooks without recompiling ASan runtime
...
llvm-svn: 162355
2012-08-22 10:12:47 +00:00
Alexander Potapenko
9a168a7405
Use SANITIZER_INTERFACE_ATTRIBUTE instead of __attribute__((visibility("default")))
...
Export CheckFailed, asan_malloc, asan_free, asan_memalign, AsanStackTrace::CompressStack, AsanStackTrace::UncompressStack from the dynamic runtime library.
llvm-svn: 161943
2012-08-15 11:57:52 +00:00
Alexander Potapenko
55df945db2
Make __asan::asan_{malloc,free,memalign} globally visible, so that the dynamic version of the runtime will export them.
...
llvm-svn: 161942
2012-08-15 11:32:15 +00:00
Alexey Samsonov
b4b316fc5b
[ASan] Move error reports away from ASan allocator. Add new source file to CMakeLists as well
...
llvm-svn: 161569
2012-08-09 08:15:46 +00:00
Alexander Potapenko
8f6dd3537c
AllocationSize(ptr) should check that |ptr| actually points to the beginning of the chunk it belongs to.
...
Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=86
llvm-svn: 161320
2012-08-06 12:24:39 +00:00
Alexey Samsonov
37d5134f38
[ASan] minor fixes to silence cmake build warnings
...
llvm-svn: 160624
2012-07-23 09:11:58 +00:00
Alexey Samsonov
34efb8e9b9
[ASan] Use common flags parsing machinery.
...
llvm-svn: 159933
2012-07-09 14:36:04 +00:00
Dmitry Vyukov
6fa46f7003
tsan/asan: unify atomics (move atomics from tsan to sanitizer_common)
...
llvm-svn: 159437
2012-06-29 16:58:33 +00:00
Alexey Samsonov
70386aaffa
[ASan] cleanup: trailing semicolons, trailing colons in enums
...
llvm-svn: 159338
2012-06-28 08:27:24 +00:00
Kostya Serebryany
0b14fd855b
[asan] slow 16-byte redzones (still experimental)
...
llvm-svn: 158143
2012-06-07 09:15:48 +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
Kostya Serebryany
c0bbfbfba2
[asan] more allocator compaction
...
llvm-svn: 158082
2012-06-06 16:33:46 +00:00
Alexey Samsonov
40d5b772e5
[Sanitizer] Switch to common mmap/munmap routines in ASan run-time.
...
llvm-svn: 158078
2012-06-06 16:15:07 +00:00
Kostya Serebryany
00e22d2b2c
[asan] more compaction for allocator
...
llvm-svn: 158076
2012-06-06 15:30:55 +00:00
Kostya Serebryany
79437fe376
[asan] make tid u32 instead of int
...
llvm-svn: 158074
2012-06-06 15:06:58 +00:00
Kostya Serebryany
53b74ac256
[asan] start compacting the allocator header, the goal is to make it 16 bytes w/o losing any information
...
llvm-svn: 158072
2012-06-06 14:46:38 +00:00
Alexey Samsonov
51ae983718
[Sanitizer]: Introduce a common internal printf function. For now, also use tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms).
...
llvm-svn: 158065
2012-06-06 13:11:29 +00:00
Alexey Samsonov
461820ad67
[ASan] Make printf arguments match format strings better.
...
llvm-svn: 158059
2012-06-06 10:46:00 +00:00
Alexey Samsonov
485d3dc363
Remove file-type tags for .cc files in ASan run-time library
...
llvm-svn: 157927
2012-06-04 13:50:10 +00:00
Kostya Serebryany
1d35d155fd
[asan] more renaming
...
llvm-svn: 157747
2012-05-31 15:02:07 +00:00
Kostya Serebryany
8d03204204
[asan] more renaming
...
llvm-svn: 157746
2012-05-31 14:35:53 +00:00
Kostya Serebryany
1b71207f48
[asan,tsan] introduce sanitizer_common/sanitizer_defs.h and perform some renaming in asan rt. More to come.
...
llvm-svn: 157743
2012-05-31 14:11:07 +00:00
Alexander Potapenko
442002568c
Introduce the check_malloc_usable_size flag (on by default).
...
When the flag is set to zero, we do not check for errors in malloc_usable_size.
This may be useful to work around a bug in Nvidia drivers prior to 295.*
llvm-svn: 157472
2012-05-25 15:20:13 +00:00
Timur Iskhodzhanov
ea365131a2
[ASan] Make for-Windows RTL compileable using Clang++
...
llvm-svn: 157188
2012-05-21 14:25:36 +00:00
Kostya Serebryany
c5bf3ad922
[asan] fix asan issue #66 (correctly report type of the bug)
...
llvm-svn: 155344
2012-04-23 10:08:16 +00:00
Kostya Serebryany
7a8f5e4d1e
[asan] make __asan::Deallocate immune to racy double-free (issue #57 )
...
llvm-svn: 154097
2012-04-05 15:55:09 +00:00
Alexander Potapenko
8418de1689
Log the allocator messages at a higher verbosity level.
...
llvm-svn: 153514
2012-03-27 16:37:16 +00:00
Evgeniy Stepanov
823085a8f4
[asan] Support for %z to Printf()
...
At the moment, asan internal Printf() uses %l modifier for printing
values of size_t and related types. This works, because we control
both the implementation of Printf and all its uses, but can be a
little misleading.
This change adds support for %z to Printf(). All callers that print
sizes and pointers as integers are switched to %zu / %zx.
llvm-svn: 153177
2012-03-21 11:32:46 +00:00
Alexey Samsonov
8b5f7c5aa2
AddressSanitizer: fix a couple of typos
...
llvm-svn: 152617
2012-03-13 06:46:32 +00:00
Kostya Serebryany
b0f9354168
[asan] use O(log(N)) algorithm instead of O(N) in __asan_get_ownership
...
llvm-svn: 152467
2012-03-10 01:30:01 +00:00
Evgeniy Stepanov
d84e16e6a3
Replace some #ifdef(s) with plain if(s).
...
llvm-svn: 151526
2012-02-27 13:07:29 +00:00
Alexey Samsonov
a1a3a2ffc3
AddressSanitizer: add some checks to AsanChunkFifoList::PushList
...
llvm-svn: 151521
2012-02-27 09:06:10 +00:00
Timur Iskhodzhanov
f2061453bd
[ASan] Remove one FIXME - re-enable "free-not-malloced" reports on Windows
...
llvm-svn: 151051
2012-02-21 09:58:39 +00:00
Alexey Samsonov
8e7bfceb98
AddressSanitizer: fix lint
...
llvm-svn: 150802
2012-02-17 08:31:10 +00:00
Evgeniy Stepanov
5d47e9164c
[asan] Allocator tweaks for low memory systems.
...
llvm-svn: 150689
2012-02-16 13:35:11 +00:00
Timur Iskhodzhanov
7ce3e5bb8e
[asan] The first version of the RTL for Windows, reviewed at http://codereview.appspot.com/5647052
...
llvm-svn: 150185
2012-02-09 17:20:14 +00:00
Alexey Samsonov
e725478e2f
AddressSanitizer: replace all "real_X" calls with "REAL(X)"
...
llvm-svn: 150073
2012-02-08 13:45:31 +00:00
Kostya Serebryany
9716914b2d
[asan] better warning messages for double-free bugs (provide allocation/deallocation stack traces)
...
llvm-svn: 150027
2012-02-08 00:42:29 +00:00
Alexey Samsonov
f9fef3d275
AddressSanitizer: simplify RoundUpToPowerOfTwo/clz; add a couple of CHECKs for real_X calls. Patch by timurrrr@google.com
...
llvm-svn: 149687
2012-02-03 08:50:16 +00:00
Kostya Serebryany
510850c345
[asan] minor ifdef cleanup
...
llvm-svn: 149274
2012-01-30 20:55:02 +00:00