Commit Graph

3242 Commits

Author SHA1 Message Date
Alexey Samsonov f2c7659cf8 [ASan] Get rid of ASan-specific functions for printing stack traces
llvm-svn: 197672
2013-12-19 11:25:05 +00:00
Alexey Samsonov 3efe401db0 [Sanitizer] Delete unused StackTrace::PrintStack argument
llvm-svn: 197671
2013-12-19 11:14:26 +00:00
Alexey Samsonov cef2e14382 [ASan] Get rid of __asan_symbolize function
llvm-svn: 197670
2013-12-19 11:08:47 +00:00
Evgeniy Stepanov 3a28dc7158 Fix -Werror compilation.
It was broken in r197601.

llvm-svn: 197665
2013-12-19 08:57:24 +00:00
Lorenzo Martignoni f073541819 [DFSan] New custom wrappers
Added the following custom wrappers:
  strstr
  strrchr
  memchr
  nanosleep
  socketpair

Tweaked a couple of existing wrappers: if a wrapper returns a pointers derived
from an input pointer, then return the label of the input pointer

Sorted tests invocation

Differential Revision: D2354

llvm-svn: 197601
2013-12-18 19:25:34 +00:00
Timur Iskhodzhanov caf7c0cdcd [Sanitizers] Fix CL compile-time warning in the symbolizer
llvm-svn: 197573
2013-12-18 14:39:23 +00:00
Timur Iskhodzhanov 1c84bd64db [Sanitizer] Implement Symbolizer class on Windows
llvm-svn: 197571
2013-12-18 14:29:16 +00:00
Timur Iskhodzhanov b5f983e4b0 [Sanitizers] Rename Symbolizer::SymbolizeCode to Symbolizer::SymbolizePC
llvm-svn: 197569
2013-12-18 14:17:39 +00:00
Evgeniy Stepanov a164bf5e89 [msan] Disable DynamoRio detection.
This code is not robust enough and triggers when simply linking with
libdynamorio.so, without any code translation at all. Disabling it is safe
(i.e. we may unpoison too much memory and see false negatives, but never false
positives).

llvm-svn: 197568
2013-12-18 13:25:45 +00:00
Sergey Matveev 149b794ec6 [lsan] Remove the LSan-specific verbosity flag.
It conflicted with the verbosity flag we had in common flags. We don't need an
LSan-specific flag anyway.

Also, shift some logging levels and remove some unnecessary code.

llvm-svn: 197512
2013-12-17 18:18:32 +00:00
Sergey Matveev b5769dbb86 [lsan] Introduce print_suppressions flag.
Introduce a flag to either always or never print matched suppressions.
Previously, matched suppressions were printed unconditionally if there were
unsuppressed leaks. Also, verbosity=1 no longer has the semantics of "always
print suppressions and summary".

llvm-svn: 197510
2013-12-17 18:01:45 +00:00
Alexey Samsonov 33a2cc1e10 Fix gen_dynamic_list.py for Python 3. Patch by Marcoen Hirschberg.
llvm-svn: 197493
2013-12-17 12:19:16 +00:00
Alexey Samsonov 25d010a98d [Sanitizer] Always initialize a Symbolizer (even if 'symbolize' is false).
If 'symbolize' flag is not set, we still want to transform virtual address
to module+offset pair in the call to Symbolizer::SymbolizeCode().
See https://code.google.com/p/address-sanitizer/issues/detail?id=251 for
more details.

llvm-svn: 197491
2013-12-17 11:15:39 +00:00
Sergey Matveev 7237879926 [lsan] Introduce __lsan_(un)register_root_region().
Add an interface for telling LSan that a region of memory is to be treated as a
source of live pointers. Useful for code which stores pointers in mapped memory.

llvm-svn: 197489
2013-12-17 11:11:23 +00:00
Alexey Samsonov 5069790b24 [LSan] Add a real test for suppressions file instead of duplicated test case.
llvm-svn: 197488
2013-12-17 11:02:52 +00:00
Evgeniy Stepanov 59bb0878e2 [msan] Tweak gethostbyname_r interceptor some more.
This is covered by msan_test depending on glibc version and/or resolver setup.

llvm-svn: 197484
2013-12-17 09:13:54 +00:00
Evgeniy Stepanov cb98c5f6f0 [msan] Relax gethostbyname_r test condition.
Apparently, its return value depends on the glibc version.

llvm-svn: 197390
2013-12-16 15:01:31 +00:00
Evgeniy Stepanov 43fc44007d [msan] Fix gethostbyname_r and similar interceptors.
*h_errno is written not on success, but on failure.
In fact, it seems like it can be written even when return value signals
success, so we just unpoison it in all cases.

llvm-svn: 197383
2013-12-16 13:24:33 +00:00
Kostya Serebryany 4eaa0492ca [asan] fix the test so that it works even if stack size is unlimited by default
llvm-svn: 197372
2013-12-16 09:09:31 +00:00
Kostya Serebryany 1aedf6c9e6 [asan] replace the flag uar_stack_size_log with two flags min_uar_stack_size_log/max_uar_stack_size_log
llvm-svn: 197370
2013-12-16 08:42:08 +00:00
Evgeniy Stepanov 3158ec4002 [msan] Fix strncat interceptor, add missing tests.
llvm-svn: 197244
2013-12-13 16:31:59 +00:00
Kostya Serebryany 57bfdb080b [asan] add flag uar_noreserve to use noreserve mmap for fake stack. uar_noreserve=1 will save some memory but also negatively affect performance
llvm-svn: 197233
2013-12-13 15:03:49 +00:00
Evgeniy Stepanov a643a754be [sanitizer] Disable call wrapping when building for Go.
llvm-svn: 197232
2013-12-13 14:58:21 +00:00
Evgeniy Stepanov 879c552dd9 [msan] Wrap indirect calls from sanitizer rtl when running under DR.
llvm-svn: 197226
2013-12-13 13:13:46 +00:00
Evgeniy Stepanov c8ccef49cc [msan] Add a check for recursive __msan_init.
llvm-svn: 197218
2013-12-13 09:11:14 +00:00
Evgeniy Stepanov 86d8fb5ba1 [msan] Clean stack and TLS shadow on thread exit.
llvm-svn: 197156
2013-12-12 13:48:47 +00:00
Kostya Serebryany e55d388e71 [asan] when a fake stack is being unmapped also flush the corresponding shadow
llvm-svn: 197040
2013-12-11 14:26:41 +00:00
Kostya Serebryany 7a3a93f112 [asan] if verbosity>=2, print the fake stack usage stats at thread exit; No functionality change in non-verboze mode
llvm-svn: 197037
2013-12-11 13:54:01 +00:00
Evgeniy Stepanov 9fc2b966ac [msandr] Remove one more use of std::string and put all STL headers under ifdef.
llvm-svn: 197031
2013-12-11 11:38:49 +00:00
Evgeniy Stepanov 88adc5e815 [msandr] Remove std::string in dr_init for optimized hybrid execution.
Patch by Qin Zhao.

llvm-svn: 197029
2013-12-11 11:36:05 +00:00
Tim Northover 638a424b56 Only build embedded darwin variants if the compiler supports them
We need to filter out architectures that the compiler hasn't been built to
target (most likely the ARM ones) before attemptint to build a version of
libcompiler_rt.

This can result in a completely empty library (e.g. soft-float doesn't have any
x86 variants), in which case we shouldn't even try the build

llvm-svn: 197028
2013-12-11 11:25:53 +00:00
Evgeniy Stepanov cd07898cf8 [msan] Get stack limits with pthread_create interceptor.
Before we did it lazily on the first stack unwind in the thread.
It resulted in deadlock when the unwind was caused by memory allocation
inside pthread_getattr_np:
  pthread_getattr_np   <<< not reentable
  GetThreadStackTopAndBottom
  __interceptor_realloc
  pthread_getattr_np
  

llvm-svn: 197026
2013-12-11 10:55:42 +00:00
Alexey Samsonov 4fc8098979 [TSan] Move declarations of __tsan_atomic functions to a public header
llvm-svn: 197015
2013-12-11 08:18:50 +00:00
Alexey Samsonov 2424dfa688 [TSan] Replace __tsan::OverrideFlags with __tsan::OnInitialize
llvm-svn: 197014
2013-12-11 07:31:36 +00:00
Matt Arsenault d326252d29 Fix minor gcc warnings.
C++ style comments not allowed in C90,
signed unsigned comparision.

llvm-svn: 196948
2013-12-10 19:05:43 +00:00
Kostya Serebryany b00a0e2971 [asan] relax HugeMallocTest so that it does not fail on small-RAM machines
llvm-svn: 196904
2013-12-10 10:34:55 +00:00
Kostya Serebryany b2eb3d3177 [asan] remove one test from SizedStackTest which relied on a now-wrong assumption that the left stack redzone is >= 32 bytes (PR18195)
llvm-svn: 196900
2013-12-10 09:49:31 +00:00
Timur Iskhodzhanov 89a346c2a1 [ASan] Fix StackTrace::SlowUnwindStack on Windows
llvm-svn: 196894
2013-12-10 08:30:39 +00:00
Chandler Carruth 3f697191bb Revert a final patch that was committed without the author contributing
it to the LLVM project through the appropriate channels.

This reverts:
r195837: "[Sanitizer] Add rudimentary support for using libbacktrace in ..."

llvm-svn: 196875
2013-12-10 04:40:39 +00:00
Richard Smith ab788cdc81 Unbreak build by adding an implementation of PopStackFrames function.
llvm-svn: 196809
2013-12-09 19:52:39 +00:00
Chandler Carruth 736f9fd229 Revert three patches which were committed without explicit contribution
by their authors.

This may break builds where others added code relying on these patches,
but please *do not* revert this commit. Instead, we will prepare patches
which fix the failures.

Reverts the following commits:
r168306: "[asan] support x32 mode in the fast stack unwinder. Patch by H.J. Lu"
r168356: "[asan] more support for powerpc, patch by Peter Bergner"
r196489: "[sanitizer] fix the ppc32 build (patch by Jakub Jelinek)"

llvm-svn: 196802
2013-12-09 19:25:51 +00:00
Will Dietz 3177a7f38a ubsan: Fix typo in 'TypeCheck/vptr.cpp' test to resolve 32bit failure.
llvm-svn: 196799
2013-12-09 19:04:33 +00:00
Sergey Matveev 47b02994f1 Fix Windows build.
llvm-svn: 196780
2013-12-09 13:24:44 +00:00
Alexey Samsonov 9f6218bf44 PR17977: don't assume EOWNERDEAD is always defined
Summary: See details in http://llvm.org/bugs/show_bug.cgi?id=17977

Reviewers: dvyukov

Reviewed By: dvyukov

CC: glider, llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2340

llvm-svn: 196779
2013-12-09 13:21:43 +00:00
Sergey Matveev b1b8d1aa47 [lsan] Make LSan ignore memory poisoned by ASan.
Summary:
No more (potenital) false negatives due to red zones or fake stack
frames.

Reviewers: kcc, samsonov

Reviewed By: samsonov

CC: llvm-commits, samsonov

Differential Revision: http://llvm-reviews.chandlerc.com/D2359

llvm-svn: 196778
2013-12-09 13:12:10 +00:00
Will Dietz 186507dac6 Fix integer tests on platforms where uint64_t is 'unsigned long long'.
llvm-svn: 196612
2013-12-06 21:49:18 +00:00
Kostya Serebryany 3429f78289 [asan] in SizedStackTest check the death string, also restrict one of the checks to 64-bit
llvm-svn: 196576
2013-12-06 09:33:36 +00:00
Evgeniy Stepanov 67bbf967b0 [msan] Allow strlen() (and similar functions) of shadow memory.
llvm-svn: 196572
2013-12-06 09:19:07 +00:00
Kostya Serebryany cab32309f8 [asan] rewrite asan's stack frame layout, compiler-rt part
llvm-svn: 196569
2013-12-06 09:00:25 +00:00
Alexey Samsonov 5ca3de6e91 PR16532: work around old GCC bug in interception_type_test.cc
llvm-svn: 196506
2013-12-05 13:29:46 +00:00