[TSan] Fix signed-compare warning in the unit test

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221190 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan} Build Go version with -std=c++11

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221192 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Use StackTrace from sanitizer_common where applicable

Summary:
This change removes `__tsan::StackTrace` class. There are
now three alternatives:
  # Lightweight `__sanitizer::StackTrace`, which doesn't own a buffer
  of PCs. It is used in functions that need stack traces in read-only
  mode, and helps to prevent unnecessary allocations/copies (e.g.
  for StackTraces fetched from StackDepot).
  # `__sanitizer::BufferedStackTrace`, which stores buffer of PCs in
  a constant array. It is used in TraceHeader (non-Go version)
  # `__tsan::VarSizeStackTrace`, which owns buffer of PCs, dynamically
  allocated via TSan internal allocator.

Test Plan: compiler-rt test suite

Reviewers: dvyukov, kcc

Reviewed By: kcc

Subscribers: llvm-commits, kcc

Differential Revision: http://reviews.llvm.org/D6004

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221194 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Remove bogus unused global variables

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221195 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Don't strip binary/library name until the moment we print it.

This commit changes the place where TSan runtime turns full path
to binary or shared library into its basename
(/usr/foo/mybinary -> mybinary). Instead of doing it as early as possible
(when we obtained the full path from the symbolizer), we now do it as
late as possible (right before printing the error report).

This seems like a right thing to do - stripping to basename is a detail
of report formatting implementation, and should belong there. Also, we
might need the full path at some point - for example, to match the
suppressions.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221225 91177308-0d34-0410-b5e6-96231b3b80d8
Use @rpath as LC_ID_DYLIB for ASan dylib on OS X

Change the LC_ID_DYLIB of ASan's dynamic libraries on OS X to be set to "@rpath/libclang_rt.asan_osx_dynamic.dylib" and similarly for iossim. Clang driver then sets the "-rpath" to be the real path to where clang currently has the dylib (because clang uses the relative path to its current executable). This means if you move the compiler or install the binary release, -fsanitize=address will link to the proper library.

Reviewed at http://reviews.llvm.org/D6018




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221278 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Keep original function and filename in ReportStack.

TSan used to do the following transformations with data obtained
from the symbolizer:
1) Strip "__interceptor_" prefix from function name.
2) Use "strip_path_prefix" runtime flag to strip filepath.

Now these transformations are performed right before the stack trace
is printed, and ReportStack structure contains original information.

This seems like a right thing to do - stripping is a detail of report
formatting implementation, and should belong there. We should, for
example, use original path to source file when we apply suppressions.

This change also make "strip_path_prefix" flag behavior in TSan
consistent with all the other sanitizers - now it should actually
match *the prefix* of path, not some substring. E.g. earlier TSan
would turn "/usr/lib/libfoo.so" into "libfoo.so" even if strip_path_prefix
was "/lib/".

Finally, strings obtained from symbolizer come from internal allocator,
and "stripping" them early by incrementing a "char*" ensures they can
never be properly deallocated, which is a bug.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221283 91177308-0d34-0410-b5e6-96231b3b80d8
[Sanitizer] Get rid of unnecessary allocations in StripModuleName. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221287 91177308-0d34-0410-b5e6-96231b3b80d8
[asan] [mips] changed ShadowOffset32 for systems having 16kb PageSize; patch by Kumar Sukhani

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221288 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Make ReportStack contain __sanitizer::AddressInfo object.

AddressInfo contains the results of symbolization. Store this object
directly in the symbolized stack, instead of copying data around and
making unnecessary memory allocations.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221294 91177308-0d34-0410-b5e6-96231b3b80d8
Correct the usage of DataInfo structure in TSan

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221297 91177308-0d34-0410-b5e6-96231b3b80d8
[TSan] Refactor/simplify ReportLocation structure.

  # Make DataInfo (describing a global) a member of ReportLocation
    to avoid unnecessary copies and allocations.
  # Introduce a constructor and a factory method, so that
    all structure users don't have to go to internal allocator directly.
  # Remove unused fields (file/line).

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221302 91177308-0d34-0410-b5e6-96231b3b80d8
Get the Linux ptrace test working on PowerPC64

The test refers to user_regs_struct.rip so it can only ever have worked
on x86-64. Put this code inside an appropriate #if, and add a similar
case for PowerPC64. (If we do likewise for ARM we can probably remove
the XFAILs, but I have no way of testing that.)

Those changes are enough to get the test working for me on big-endian
PowerPC64 Fedora 19.

Differential Revision: http://reviews.llvm.org/D6108


git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221337 91177308-0d34-0410-b5e6-96231b3b80d8
Disable XFAIL on ARM since the x86_64 specific code is isolated

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221347 91177308-0d34-0410-b5e6-96231b3b80d8
When run on a ppc64le based platform, the check-sanitizer build looks for
objects with the powerpc64le name. i.e. asan-powerpc64le.a
This change allows those objects to be built.

Differential Revision: http://reviews.llvm.org/D6043




git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221356 91177308-0d34-0410-b5e6-96231b3b80d8
[dfsan] Modify build-libc-list.py to filter out local functions in generated
ABI list.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221361 91177308-0d34-0410-b5e6-96231b3b80d8
[dfsan] Upgrade ABI list to Ubuntu 14.04.

This incorporates some of the newer functions used by (e.g.) the Go runtime.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221362 91177308-0d34-0410-b5e6-96231b3b80d8
[dfsan] Add libgo functions to ABI list.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221363 91177308-0d34-0410-b5e6-96231b3b80d8
[dfsan] Add runtime function for aborting on indirect calls to
uninstrumented vararg functions.

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221364 91177308-0d34-0410-b5e6-96231b3b80d8
Extend Mac OS versions to Yosemite

This also fixes the test/asan/TestCases/Darwin/malloc_zone-protected.cc test failure on OS X 10.10.

Reviewed at http://reviews.llvm.org/D6119



git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221379 91177308-0d34-0410-b5e6-96231b3b80d8