Alexey Samsonov
4ce12349d6
[ASan] move some functions that describe addresses to asan_report.cc
...
llvm-svn: 161571
2012-08-09 09:06:52 +00:00
Alexey Samsonov
0295edbfd5
[ASan] add new ASan option 'strip_path_prefix' to remove useless prefices from filenames in stack traces
...
llvm-svn: 161321
2012-08-06 13:00:21 +00:00
Kostya Serebryany
bb0ade6daa
[asan] don't return from a never-return function. fix a test that had a chain of bugs instead of just one
...
llvm-svn: 160719
2012-07-25 10:56:09 +00:00
Alexey Samsonov
c145b02607
[ASan] fixup for r160712: provide a default definition for weak __asan_default_options()
...
llvm-svn: 160718
2012-07-25 10:40:57 +00:00
Alexander Potapenko
9bac1cedbc
Make __asan_default_options a weak function that returns a const char*.
...
Users may define it to override the default ASan options.
This function has to be marked with __attribute__((no_address_safety_analysis)), because it is called before ASan is fully initialized.
Add an output test checking the __asan_default_options functionality.
llvm-svn: 160712
2012-07-25 09:18:43 +00:00
Alexander Potapenko
7f3e84c9fd
For wild addresses in the shadow or shadow gap areas print an error message instead of crashing on a check.
...
Add AddressSanitizer.MemsetWildAddressTest that makes sure a proper error message is printed.
llvm-svn: 160620
2012-07-23 08:22:27 +00:00
Kostya Serebryany
78713bc574
[asan] get rid of the last operator new call in asan rtl
...
llvm-svn: 160347
2012-07-17 07:20:13 +00:00
Alexey Samsonov
2d4bd13eb6
[Sanitizer] fix CMake build
...
llvm-svn: 159988
2012-07-10 09:17:06 +00:00
Alexey Samsonov
9f666ea6ca
[ASan] move flags description to separate header, add comments about them.
...
llvm-svn: 159985
2012-07-10 07:41:27 +00:00
Alexey Samsonov
2467ca5010
[ASan] cleanup: remove dead flag
...
llvm-svn: 159934
2012-07-09 15:11:28 +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
Kostya Serebryany
875f99a6bf
[asan] fix -Wsign-compare
...
llvm-svn: 159083
2012-06-23 16:30:48 +00:00
Alexey Samsonov
f8947a3360
[ASan] fix lint error
...
llvm-svn: 158905
2012-06-21 08:13:49 +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
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
40e5128412
[Sanitizer] move ShadowRangeIsAvailable and several defines to common runtime
...
llvm-svn: 158499
2012-06-15 07:29:14 +00:00
Alexey Samsonov
ae1e171b72
[Sanitizer] move DumpProcessMap and DisableCoreDumper to common runtime
...
llvm-svn: 158490
2012-06-15 06:08:19 +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
Kostya Serebryany
0b14fd855b
[asan] slow 16-byte redzones (still experimental)
...
llvm-svn: 158143
2012-06-07 09:15:48 +00:00
Alexey Samsonov
fe44fbd750
[Sanitizer] Move ReadFileToBuffer to sanitizer_common.
...
llvm-svn: 158138
2012-06-07 05:38:26 +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
Alexey Samsonov
e428779dbf
[Sanitizer] Use common CHECK machinery. Currently each tool has to define its own CheckFailed function.
...
llvm-svn: 158075
2012-06-06 15:22:20 +00:00
Kostya Serebryany
79437fe376
[asan] make tid u32 instead of int
...
llvm-svn: 158074
2012-06-06 15:06:58 +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
cd96c44dce
[ASan] more format fixes
...
llvm-svn: 158060
2012-06-06 10:54:25 +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
c4b201308b
[ASan] Use __sanitizer::Die() in ASan runtime.
...
llvm-svn: 158051
2012-06-06 07:02:44 +00:00
Alexey Samsonov
8602c65719
[Sanitizer] remove using namespace __sanitizer lines
...
llvm-svn: 157999
2012-06-05 14:05:09 +00:00
Alexey Samsonov
ef2e2cfd33
[Sanitizer] Use common defines for ASan and TSan runtime. Split defines between interface defines (can be visible in user code that includes interface ASan/TSan headers) and internal defines.
...
llvm-svn: 157998
2012-06-05 13:50:57 +00:00
Alexey Samsonov
1b12eda7ec
[ASan] use internal_{close,read,write} in ASan runtime.
...
llvm-svn: 157991
2012-06-05 08:48:10 +00:00
Alexey Samsonov
f5e2dc3c3d
[ASan] use internal_open from sanitizer_libc in ASan runtime
...
llvm-svn: 157986
2012-06-05 07:25:47 +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
Alexey Samsonov
4ecc8f43c7
[ASan] Use ASan option symbolize to turn on internal symbolizer (in development)
...
llvm-svn: 157924
2012-06-04 11:20:17 +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
6e216bea86
Fix a bug in parsing boolean flags: we used to take the first char of the key=value string
...
instead of the first character of the value.
llvm-svn: 157692
2012-05-30 15:28:45 +00:00
Alexander Potapenko
93b2c7d516
Be less verbose when parsing the default options.
...
llvm-svn: 157691
2012-05-30 14:12:20 +00:00
Kostya Serebryany
458b4006b2
[asan,tsan] Add a new directory compiler-rt/lib/sanitizer_common
...
which will contain code shared between asan and tsan run-times.
Naming is hard. If you can suggest a better name for the directory -- speak up.
llvm-svn: 157611
2012-05-29 12:18:18 +00:00
Alexey Samsonov
1cbe656d66
Fixing ASan build on Win: don't use __asan_default_options
...
llvm-svn: 157608
2012-05-29 09:39:01 +00:00
Alexander Potapenko
0efd915d92
Rework the flags machinery a bit.
...
Clients may define the __asan_default_options char string containing the default options for the tool now.
llvm-svn: 157582
2012-05-28 16:21:19 +00:00
Alexander Potapenko
4e424b85e3
Typo fix.
...
llvm-svn: 157477
2012-05-25 15:56:40 +00:00
Alexander Potapenko
85e93ef612
Factor ParseAsanOptions outside __asan_init
...
llvm-svn: 157473
2012-05-25 15:37:16 +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
Alexander Potapenko
a1c3c6582c
Increase error_message_buffer_size to 64K (16K is insufficient for large programs)
...
llvm-svn: 156711
2012-05-12 12:33:41 +00:00
Alexander Potapenko
66e6de10cf
Fix ReadFileToBuffer to return 0 on failure (-1 is too large if returned as size_t).
...
llvm-svn: 156538
2012-05-10 12:03:09 +00:00
Kostya Serebryany
b7f68dee45
[asan] minor change to please gcc
...
llvm-svn: 154201
2012-04-06 20:19:59 +00:00
Alexey Samsonov
6a19d5d209
[ASan] move replacements for new/delete to separate file
...
llvm-svn: 154167
2012-04-06 08:21:08 +00:00