Commit Graph

4305 Commits

Author SHA1 Message Date
Evgeniy Stepanov 0b2d93c4f0 [sanitizer] Fix build on platforms where dtls support is disabled.
llvm-svn: 211684
2014-06-25 11:43:46 +00:00
Evgeniy Stepanov 7ad0bde843 [msan] Fix false positive on dynamic tls.
Use existing DTLS code in sanitizer_tls_get_addr.{h,cc} to unpoison DTLS
blocks both on allocation and deallocation.

https://code.google.com/p/memory-sanitizer/issues/detail?id=44

llvm-svn: 211683
2014-06-25 11:30:35 +00:00
Greg Fitzgerald 7c8bfd804b Remove ARM XFAIL from passing test
llvm-svn: 211608
2014-06-24 16:58:59 +00:00
Daniel Sanders 4dc8a78b04 [asan] adding support of 32-bit address sanitizer for MIPS
Summary: The patch supports both the clang cross-compiler and native compiler

Patch by Kumar Sukhani <Kumar.Sukhani@imgtec.com>

Test Plan:
Kumar had the following asan test results when compiled on a MIPS board:

  Expected Passes    : 96
  Expected Failures  : 2
  Unsupported Tests  : 84
  Unexpected Passes  : 4
  Unexpected Failures: 19

The list of unexpected failures can be found in the review.

Reviewers: kcc, petarj, dsanders

Reviewed By: kcc

Subscribers: farazs, kcc, llvm-commits

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

llvm-svn: 211587
2014-06-24 12:08:18 +00:00
Evgeniy Stepanov 8717fec9af [msan] Fix origin copying.
Conditions for the first and the last origin value in range were wrong.

llvm-svn: 211585
2014-06-24 11:50:26 +00:00
Evgeniy Stepanov ad8065f01a [msan] Print stats even on successful run with atexit=1.
llvm-svn: 211574
2014-06-24 09:04:06 +00:00
Dmitry Vyukov 9eaae3d8f6 tsan: fix code formatting
llvm-svn: 211429
2014-06-21 02:10:17 +00:00
Saleem Abdulrasool d0d1638f96 builtins: assembly routines are not static
Storage Class 3 is static storage.  These symbols need to be marked as external
(storage class 2) so that they can be referenced.  Note that this external is
not the same as ELF "external" visibility, which is indicated by DLL Storage
Class (i.e. __declspec(dllexport) or __declspec(dllimport)).

llvm-svn: 211428
2014-06-21 01:41:21 +00:00
Dmitry Vyukov 0eb1c6f2fb tsan: fix windows build script
llvm-svn: 211422
2014-06-20 23:22:31 +00:00
Dmitry Vyukov 73e1804c21 tsan: add Go build script for freebsd
llvm-svn: 211419
2014-06-20 22:53:43 +00:00
Dmitry Vyukov b820599a3a tsan: port to freebsd
llvm-svn: 211418
2014-06-20 22:51:18 +00:00
Dmitry Vyukov f9c22916d5 tsan: fix freebsd build
freebsd does not have /proc/self/environ

llvm-svn: 211417
2014-06-20 22:49:41 +00:00
Dmitry Vyukov d84ce00f75 tsan: remove unused header include
llvm-svn: 211389
2014-06-20 18:56:11 +00:00
Dmitry Vyukov 5c4a3d3118 tsan: remove unused header include
llvm-svn: 211386
2014-06-20 18:30:06 +00:00
Dmitry Vyukov 3fc095e031 tsan: remove unused header include
llvm-svn: 211385
2014-06-20 18:28:34 +00:00
Kostya Serebryany cd60ed53f6 [asan] when reporting an ODR violation, also print the stack traces where the globals have been registered (thus show the name of shared library or exe to which the global belongs). The reports become a bit too verbose but I do not see any *simple* way to make them more compact. This should be especially helpful when the ODR happens because the same .cc file is used twice in the project in differend DSOs
llvm-svn: 211343
2014-06-20 08:24:12 +00:00
Joerg Sonnenberger 61d5d38e80 Provide mul for IEEE quad. From GuanHong Liu.
Differential Revision: http://reviews.llvm.org/D2799

llvm-svn: 211313
2014-06-19 20:34:03 +00:00
Joerg Sonnenberger 361519f409 Provide add and sub for IEEE quad. From GuanHong Liu.
Differential Revision: http://reviews.llvm.org/D2798

llvm-svn: 211312
2014-06-19 20:24:49 +00:00
Evgeniy Stepanov a2327c3a65 [sanitizer] Intercept pthread_*attr_get*.
This is a resubmit of r211166 reverted due to osx breakage.

llvm-svn: 211264
2014-06-19 10:19:57 +00:00
Arnold Schwaighofer 868050a667 Revert "[sanitizer] Intercept pthread_*attr_get*."
This reverts commit r211166. It broke public mac os x bots.

llvm-svn: 211206
2014-06-18 19:04:47 +00:00
Evgeniy Stepanov b87f1efc5f [sanitizer] Intercept pthread_*attr_get*.
llvm-svn: 211166
2014-06-18 14:16:41 +00:00
Evgeniy Stepanov 2c27df9a33 [msan] Intercept __getdelim.
llvm-svn: 211162
2014-06-18 13:35:13 +00:00
Evgeniy Stepanov 4ea1647e8b [msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
llvm-svn: 211156
2014-06-18 12:02:29 +00:00
Alexander Potapenko 853a232e66 [ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=321 for time() and frexp()
Add a test for the frexp() interceptor.
Annotate the interceptors that may potentially corrupt stack IDs of freed buffers with FIXME comments.

llvm-svn: 211153
2014-06-18 09:27:40 +00:00
Evgeniy Stepanov df187feae4 [msan] Fix handling of multiplication by a constant with a number of trailing zeroes.
Multiplication by an integer with a number of trailing zero bits leaves
the same number of lower bits of the result initialized to zero.
This change makes MSan take this into account in the case of multiplication by
a compile-time constant.

We don't handle the general, non-constant, case because
(a) it's not going to be cheap (computation-wise);
(b) multiplication by a partially uninitialized value in user code is
    a bad idea anyway.

Constant case must be handled because it appears from LLVM optimization of a
completely valid user code, as the test case in compiler-rt demonstrates.

llvm-svn: 211092
2014-06-17 09:23:12 +00:00
Saleem Abdulrasool 8f2efc3a91 builtins: add it blocks for Thumb-2
Add the missing IT-blocks for Thumb-2 compilation for code paths exercised by
older ARM CPUs.  This should fix the buildbots.

llvm-svn: 211035
2014-06-16 16:36:25 +00:00
Saleem Abdulrasool 1b8f1a4430 compiler-rt: prefer thumb over ARM
When possible, use Thumb or Thumb-2 over ARM instructions.  This is particularly
important for pure-Thumb environments (e.g. Windows on ARM).  Although, it is
possible to conditionalise this for that target specifically, this is available
on most newer ARM CPUs, and the code remains compatible with older CPUs with no
adverse effects.  It therefore feels better to always prefer Thumb when
possible.

llvm-svn: 211032
2014-06-16 16:05:24 +00:00
Dan Albert 1236ac388d Swap getdtablesize() for sysconf(_SC_OPEN_MAX).
Bionic is no removing this as it was removed from POSIX 2004.

llvm-svn: 211027
2014-06-16 14:51:11 +00:00
Sergey Matveev 998d991b2d [sanitizer] Support PTRACE_GETEVENTMSG in the ptrace() interceptor.
llvm-svn: 211022
2014-06-16 13:49:13 +00:00
Joerg Sonnenberger 739f4302b5 Add Guan-Hong Liu.
llvm-svn: 211009
2014-06-16 08:38:19 +00:00
Kostya Serebryany 9f5d48c0a0 [asan] initialze varaibles to avoid a (false positive) report from gcc's -Wmaybe-uninitialized
llvm-svn: 211008
2014-06-16 08:32:02 +00:00
Viktor Kutuzov 9101af0612 Fix building InstrProfilingFile.c on FreeBSD
llvm-svn: 210989
2014-06-15 14:01:18 +00:00
Viktor Kutuzov 1f386f0f36 Fix getting IP, BP and SP for address sanitizer's needs on FreeBSD in 32-bit mode
llvm-svn: 210988
2014-06-15 13:56:28 +00:00
Dan Albert 1c71fde161 Exclude Android from the tests for valloc/pvalloc.
These functions are being removed from Android because they were removed
from POSIX 2004.

llvm-svn: 210962
2014-06-14 00:50:03 +00:00
Alexey Samsonov e287ef847a [Sanitizer] Merge AnsiColorDecorator and SanitizerCommonDecorator, use the latter in UBSan
llvm-svn: 210959
2014-06-13 23:46:37 +00:00
Alexey Samsonov 3e61c52352 [UBSan] Respect runtime flag for colorizing reports
llvm-svn: 210950
2014-06-13 22:48:40 +00:00
Alexey Samsonov e595e1ade0 Remove top-level Clang -fsanitize= flags for optional ASan features.
Init-order and use-after-return modes can currently be enabled
by runtime flags. use-after-scope mode is not really working at the
moment.

The only problem I see is that users won't be able to disable extra
instrumentation for init-order and use-after-scope by a top-level Clang flag.
But this instrumentation was implicitly enabled for quite a while and
we didn't hear from users hurt by it.

llvm-svn: 210924
2014-06-13 17:53:44 +00:00
Evgeniy Stepanov dfa5439652 [asan] Fix mmap-ed coverage with coverage=0.
llvm-svn: 210655
2014-06-11 15:11:26 +00:00
Evgeniy Stepanov 9ae3d02193 [asan] Run Android test with asanwrapper.
This better replicates the target environment.

llvm-svn: 210650
2014-06-11 10:37:06 +00:00
Evgeniy Stepanov b2b4c3ab32 [asan] Exclude non-executable mappings from coverage.
llvm-svn: 210649
2014-06-11 10:11:51 +00:00
Evgeniy Stepanov 46fa9f2d9e [asan] One more coverage test.
Test that coverage is dumped correctly (and completely) even when the processed
gets SIGKILL-ed.

llvm-svn: 210647
2014-06-11 09:23:25 +00:00
Evgeniy Stepanov 125a302257 [asan] Fix coverage-android test to avoid name conflict.
And re-enable it.

llvm-svn: 210646
2014-06-11 09:09:09 +00:00
Alexander Potapenko 14f8ac04e3 Add detection of OS X relocatable SDK to compiler-rt as a lit.util function
Clang's lit cfg already detects the currently selected SDK via
"xcrun --show-sdk-path". The same thing should be done for compiler-rt tests,
to make them work on recent OS X versions. Instead of duplicating the detection
code, this patch extracts the detection function into a lit.util method.

Patch by Kuba Brecka (kuba.brecka@gmail.com),
reviewed at http://reviews.llvm.org/D4072

llvm-svn: 210534
2014-06-10 14:22:00 +00:00
Evgeniy Stepanov 9cc3ebdd3b [sanitizer] Relax sanity checks in ioctl decoding.
Standard KVM ioctls don't pass currect ioctl_decode().

llvm-svn: 210533
2014-06-10 13:54:15 +00:00
Evgeniy Stepanov 48eccb7fb3 [asan] Disable a flaky test.
llvm-svn: 210517
2014-06-10 08:32:01 +00:00
Alexey Samsonov f0d1fd6b32 [TSan] Exclude blacklist tests from manual test runner
llvm-svn: 210494
2014-06-09 22:02:14 +00:00
Evgeniy Stepanov b22b963669 [asan] Remove dependency of tests on runtime library in standalone build.
llvm-svn: 210465
2014-06-09 11:17:37 +00:00
Evgeniy Stepanov 9959915890 [msan] Intercept __strto*_internal.
This should fix strtoimax/strtoumax on newer glibc.
https://code.google.com/p/memory-sanitizer/issues/detail?id=36

llvm-svn: 210463
2014-06-09 10:41:22 +00:00
Evgeniy Stepanov 2be29929be Fix line numbers for code inlined from __nodebug__ functions.
Instructions from __nodebug__ functions don't have file:line
information even when inlined into no-nodebug functions. As a result,
intrinsics (SSE and other) from <*intrin.h> clang headers _never_
have file:line information.

With this change, an instruction without !dbg metadata gets one from
the call instruction when inlined.

Fixes PR19001.

llvm-svn: 210459
2014-06-09 09:09:19 +00:00
Evgeniy Stepanov 66c6a18d39 [msan] Add a test for mmx.packuswb.
llvm-svn: 210458
2014-06-09 08:58:41 +00:00