Commit Graph

2557 Commits

Author SHA1 Message Date
Kostya Serebryany 8fc35ca008 [asan] refactor the use-after-return API so that the size class is computed at compile time instead of at run-time. compiler-rt part
llvm-svn: 190406
2013-09-10 13:16:26 +00:00
Evgeniy Stepanov df96e863de [msan] bool -> int to make msan_interface.h C-compatible.
llvm-svn: 190402
2013-09-10 11:04:37 +00:00
Timur Iskhodzhanov 190784b21b [ASan] Don't crash in DescribeHeapAddress if we don't know the current thread's ID
Also make DescribeThread easier to use.
This was firing on Dr.ASan runs, not sure how to repro InvalidTID in a simple test.

llvm-svn: 190392
2013-09-10 08:36:21 +00:00
Eli Friedman abc1a5cb9b Delete unused variables.
llvm-svn: 190383
2013-09-10 03:27:07 +00:00
Peter Collingbourne 0dca2e5ed1 [dfsan] Initial set of DFSAN_OPTIONS flags.
llvm-svn: 190379
2013-09-10 01:51:35 +00:00
Bill Wendling 97c22c3c92 Don't allow a NULL-length file. Try to revert to the buffered version.
llvm-svn: 190359
2013-09-09 22:25:46 +00:00
Evgeniy Stepanov 842fa3f80d [msan] Intercept fstatat / fstatat64.
llvm-svn: 190306
2013-09-09 13:40:41 +00:00
Evgeniy Stepanov cf02f171a9 [sanitizer] Fix PR17138.
strerror_r on OSX returns a positive error code when the errno value is
unknown. Buffer contents are initialized in any case.

llvm-svn: 190295
2013-09-09 08:58:54 +00:00
Evgeniy Stepanov 80cc27857b [sanitizer] Delete extra whitespace.
llvm-svn: 190292
2013-09-09 06:18:07 +00:00
Alexey Samsonov 77029be19a [ASan] fix one more memory leak in test case
llvm-svn: 190277
2013-09-08 14:01:07 +00:00
Alexey Samsonov a302a1affc [Sanitizer] Use generic configs for running sanitizer_common unit tests
llvm-svn: 190276
2013-09-08 13:52:07 +00:00
Alexey Samsonov 071cc9e89d [ASan] turn on leak checking for ASan tests and fix a few discovered leaks
llvm-svn: 190274
2013-09-08 13:23:29 +00:00
Evgeniy Stepanov 73166796a3 [sanitizer] Avoid including any system headers in the system-header-free part of the runtime library.
llvm-svn: 190161
2013-09-06 15:34:17 +00:00
Evgeniy Stepanov 09d33c67e1 [sanitizer] Fix Android build.
Android actually has "__unused" macro defined in <cdefs.h>.

llvm-svn: 190160
2013-09-06 14:58:49 +00:00
Evgeniy Stepanov 5c1035e7fa [sanitizer] A bunch of linux system call handlers.
llvm-svn: 190157
2013-09-06 14:20:01 +00:00
Alexander Potapenko 2a54274c25 [ASan] make the check for NULL more portable.
llvm-svn: 190139
2013-09-06 12:04:37 +00:00
Alexey Samsonov 6985f3f67b Fix compiler warning introduced in r190022
llvm-svn: 190137
2013-09-06 11:08:12 +00:00
Alexey Samsonov 16516b9b00 Migrate ATTRIBUTE_NO_ADDRESS_SAFETY_ANALYSIS to new spelling - ATTRIBUTE_NO_SANITIZE_ADDRESS
llvm-svn: 190136
2013-09-06 11:07:33 +00:00
Kostya Serebryany 895ff83e47 [tsan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
llvm-svn: 190135
2013-09-06 11:04:14 +00:00
Kostya Serebryany 6c5b034d7b [msan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
llvm-svn: 190132
2013-09-06 10:58:55 +00:00
Kostya Serebryany e009ef4ac1 [asan] make calloc crash instead of returning 0 on overflow (controlled by the allocator_may_return_null flag)
llvm-svn: 190128
2013-09-06 09:51:50 +00:00
Kostya Serebryany ada5a7b7ef [sanitizer] make the allocator crash instead of returning 0 on huge size (controlled by the allocator_may_return_null flag)
llvm-svn: 190127
2013-09-06 09:25:11 +00:00
Kostya Serebryany 5e0b2085c8 [tsan] add colors to tsan output
llvm-svn: 190045
2013-09-05 11:23:27 +00:00
Reid Kleckner d483c072af sanitizers: Make sure Visual Studio gets error reports
Visual Studio appears to close stderr before launching a non-console
win32 program.  This means we don't see any sanitizer reports.  If
stderr printing fails, call OutputDebugStringA to get the reports into
the Visual Studio debugger console.

llvm-svn: 190030
2013-09-05 03:19:57 +00:00
Reid Kleckner 0071525492 asan: Add a wcslen interceptor mirroring strlen
Tested on Linux, since I can't build the tests on Windows yet.

llvm-svn: 190022
2013-09-05 01:13:49 +00:00
Kostya Serebryany 2e57127cf7 [asan] add a test that demonstrates why the current use-after-return is not signal-safe
llvm-svn: 189943
2013-09-04 14:39:43 +00:00
Kostya Serebryany 1f13414d45 [asan] make use-after-return handle very deep recursion; fixes 483.xalancbmk in UAR mode
llvm-svn: 189929
2013-09-04 10:59:32 +00:00
Alexey Samsonov 5b2000e4d9 Disable FindPathToBinary test on Android
llvm-svn: 189923
2013-09-04 06:40:48 +00:00
Timur Iskhodzhanov 2eea5894fe [asan] Hopefully un-break the RTL on Windows
llvm-svn: 189821
2013-09-03 15:50:13 +00:00
Timur Iskhodzhanov 2b8d35f8ac [asan] Hopefully fix the RTL build on Windows (part 2)
llvm-svn: 189817
2013-09-03 15:09:21 +00:00
Dmitry Vyukov 4e27d1fdaf tsan: catch races on condition variables
llvm-svn: 189816
2013-09-03 15:04:15 +00:00
Kostya Serebryany 14b7caca13 [asan] attemping to fix the Windows build
llvm-svn: 189814
2013-09-03 14:53:02 +00:00
Timur Iskhodzhanov 8a9f07626f Revert r185536 as it neither fixes any memory leaks, nor is it necessary (see the example from "man pthread_getattr_np")
llvm-svn: 189810
2013-09-03 14:21:21 +00:00
Kostya Serebryany 6bafcd1949 implement PR17059: more visible diagnostics for stack-buffer-overflow
llvm-svn: 189806
2013-09-03 13:58:04 +00:00
Sergey Matveev b9d34443f2 [lsan] Colorize LSan reports.
llvm-svn: 189804
2013-09-03 13:31:03 +00:00
Alexey Samsonov 5b5c99d219 ASan, LSan, MSan: try to find llvm-symbolizer binary in PATH if it is not provided. Now we don't need to explicitly set the location of llvm-symbolizer in lit test configs.
llvm-svn: 189801
2013-09-03 13:22:51 +00:00
Alexey Samsonov de647ddc8b [Sanitizer] Add the way to find binary in PATH
llvm-svn: 189799
2013-09-03 13:20:48 +00:00
Alexey Samsonov 249c7fb10e Add internal_strchrnul function
llvm-svn: 189797
2013-09-03 13:09:28 +00:00
Alexey Samsonov 1ecb96f652 [TSan] fixup for r189791: don't put ; on the newline
llvm-svn: 189792
2013-09-03 11:50:48 +00:00
Dmitry Vyukov ed93fbf93e tsan: add suppressions for true/false positives in standard libraries
llvm-svn: 189791
2013-09-03 11:43:04 +00:00
Alexander Potapenko 94377c337b [libsanitizer] Remove an unused variable introduced in r189789
llvm-svn: 189790
2013-09-03 11:30:07 +00:00
Alexander Potapenko 7e1c51988d [TSan] Move the /proc/self/maps parsing logic to sanitizer_common
Provide a generic way for the tools to generate memory profiles from contents of /proc/self/maps

llvm-svn: 189789
2013-09-03 11:09:16 +00:00
Dmitry Vyukov e2391f66f9 tsan: fix linking when -ltsan is passed before -lpthread
libpthread is weird:
/lib/x86_64-linux-gnu/libpthread.so.0:000000000000b9b0 T pthread_cond_init@@GLIBC_2.3.2
/lib/x86_64-linux-gnu/libpthread.so.0:000000000000c720 T pthread_cond_init@GLIBC_2.2.5
let's do it with @@ for now
we can always introduce more macros parameters later

llvm-svn: 189788
2013-09-03 10:16:44 +00:00
Evgeniy Stepanov 499d480be5 [msan] Another regression test for r189786.
llvm-svn: 189787
2013-09-03 10:08:14 +00:00
Evgeniy Stepanov f9ddb43975 [msan] A regression test for r189785.
llvm-svn: 189786
2013-09-03 10:05:45 +00:00
Kostya Serebryany 8d42228e47 fix PR17061 (and pleeease, don't ask me for a test, this is just a minor output formatting issue :)
llvm-svn: 189783
2013-09-03 09:44:56 +00:00
Dmitry Vyukov 23b80ab87f asan: fix android build
android does not have dlvsym

llvm-svn: 189781
2013-09-03 07:53:49 +00:00
Dmitry Vyukov 3a6c7cea77 tsan: properly intercept pthread_cond functions
llvm-svn: 189767
2013-09-02 18:06:28 +00:00
Evgeniy Stepanov bbca4903c4 [msan] Update MSanDR build instructions.
llvm-svn: 189760
2013-09-02 14:21:12 +00:00
Sergey Matveev 69931c5841 [sanitizer_common] Add internal_clone().
Add a wrapper for the clone syscall for use in StopTheWorld. We
implement it only for x86_64, so stop building StopTheWorld for other platforms
(no one uses it outside x86_64 anyway).

See https://code.google.com/p/address-sanitizer/issues/detail?id=214 for why we
can't use the glibc clone() wrapper.

llvm-svn: 189753
2013-09-02 11:36:19 +00:00