Commit Graph

6622 Commits

Author SHA1 Message Date
Mohit K. Bhakkad 6987e59cd1 [Compiler-rt][MSan][MIPS] Resolve gethostbyname_r_erange for MIPS
Reviewers: eugenis, kcc, samsonov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 260946
2016-02-16 08:33:37 +00:00
Jonas Hahnfeld ccb0e464be [compiler-rt] Fix test failures when switching default C++ library
1. Add two explicit -stdlib=libstdc++ in conjunction with -static-libstdc++
2. Pass -nostdinc++ when adding include paths for libc++ built for tsan. This
   prevents clang finding the headers twice which would confuse #include_next

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

llvm-svn: 260883
2016-02-15 11:28:15 +00:00
Zia Ansari 3cc265458f Fixed non-NULL terminating array bug in SanitizerCommon.StartSubprocessTest that caused them to fail sometimes and act flaky.
Differential Revision: http://reviews.llvm.org/D17228

llvm-svn: 260876
2016-02-15 05:11:51 +00:00
Dimitry Andric 042c4858b0 Fix lib/tsan/go/buildgo.sh for FreeBSD after r243051.
FreeBSD also needs to have sanitizer_linux_libcdep.cc included,
otherwise linking will fail with "undefined reference to
`__sanitizer::GetRSS()'".

While here, tabify the FreeBSD part, similar to the other parts.

llvm-svn: 260839
2016-02-14 00:26:32 +00:00
Alexey Samsonov 5b79ede65a [TSan] Adjust expectation for check_analyze.sh
r260695 caused extra push/pop instruction pair in __tsan_read1
implementation. Still, that change in InstCombine is believed to
be good, as it reduces the number of instructions performed.

Adjust the expectations to match the newly generated code.

llvm-svn: 260775
2016-02-13 00:55:58 +00:00
Evgeniy Stepanov e1556e5dd5 Fix MemorySanitizer.ptrtoint test on big-endian targets.
llvm-svn: 260749
2016-02-12 22:00:22 +00:00
Alexey Samsonov eb649bcfb9 [LSan] Print more helpful error message if LSan crashes during leak detection.
llvm-svn: 260717
2016-02-12 20:20:51 +00:00
Daniel Sanders 2f1025d68a Re-commit r260230 with a fix for clang-cmake-aarch64-42vma.
There is now a default name_suffix ('default') which should appease the buildbot
and reveal why this builder lacks a suffix.

llvm-svn: 260679
2016-02-12 14:48:19 +00:00
Daniel Sanders 6c400643cd Revert r260669 while the clang-cmake-aarch64-42vma failures is investigated.
There's no obvious reason it should fail in this way but it's the only change
on the blamelist. I suspect stale lit*.cfg's from previous builds.

llvm-svn: 260672
2016-02-12 12:09:57 +00:00
Daniel Sanders fe567fb366 [msan+tsan] Bring back the tests that disappeared after r260230 and r259512.
The lit test-suite containing the unit tests needs to be explicitly specified
as an argument to lit.py since it is no longer discovered when the other tests
are run (because they are one directory deeper).

dfsan, lsan, and sanitizer_common don't show the same problem.

llvm-svn: 260669
2016-02-12 10:35:53 +00:00
Mike Aizatsky 92cbbfcd89 [sancov] improved object files handling.
Updating sancov invocation on html_cov_dump.

sancov change: http://reviews.llvm.org/D17169

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

llvm-svn: 260629
2016-02-12 00:29:24 +00:00
Alexey Samsonov 669e87c1f1 [LSan] Test case fix: mode debug output, synchronization instead of sleep().
llvm-svn: 260564
2016-02-11 19:03:09 +00:00
Alexey Samsonov d077c29c80 [ASan] Disable test that uses profile runtime on Windows.
llvm-svn: 260561
2016-02-11 18:26:57 +00:00
Alexey Samsonov 027729c566 [LSan] Fix a crash when LSan hits a guard page while scanning thread stack for pointers.
Summary:
In some cases stack pointer register (SP) doesn't point into the thread
stack: e.g. if one is using swapcontext(). In this case LSan
conservatively tries to scan the whole thread stack for pointers.
However, thread stack (at least in glibc implementation) may also
include guard pages, causing LSan to crash when it's reading from them.

One of the solutions is to use a pthread_attr_getguardsize() to adjust
the calculated stack boundaries. However, here we're just using
IsAccessibleMemoryRange to skip guard pages and make the code (slightly)
less platform-specific.

Reviewers: kcc

Subscribers: llvm-commits

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

llvm-svn: 260554
2016-02-11 18:07:17 +00:00
Reid Kleckner ceda883e4d [Windows] Fill in read/write information in SignalContext
Implements https://github.com/google/sanitizers/issues/653

llvm-svn: 260539
2016-02-11 16:44:35 +00:00
Reid Kleckner 031bbd062b Un-XFAIL a passing test on Windows
llvm-svn: 260481
2016-02-11 02:02:56 +00:00
Reid Kleckner ddcf07d51c Move mmap_limit_mp test to Posix
This test isn't posix specific, but it doesn't pass on Windows and is
XFAILed. I suspect that this test, which is expected to fail, is causing
the hangs I'm seeing on our WinASan builder.  Moving it to Posix seems
to be the cleanest way to avoid running it on Windows.

llvm-svn: 260480
2016-02-11 02:02:52 +00:00
Reid Kleckner 5c10fa3f9a Silence MSVC warning about non-void prototypes
It thinks that these functions don't match the function pointer type
that they are passed with:

GCDAProfiling.c(578) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(579) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'
GCDAProfiling.c(580) : warning C4113: 'void (__cdecl *)()' differs in parameter lists from 'void (__cdecl *)(void)'

llvm-svn: 260475
2016-02-11 00:22:43 +00:00
Evgeniy Stepanov 89f3fbb971 [asan] Dump adb output on failure.
This is an asan/android test harness change aiming to catch
"adb pull" failures on the buildbot.

llvm-svn: 260473
2016-02-11 00:16:28 +00:00
Richard Smith 7814f7dafd Don't assume that there is only one strchr overload in the global namespace;
that's not true in general. Instead, use a preference order to pick the
standard C++ signature 'char*(char*, int)' where possible and fall back to the
C signature 'char*(const char*, int)' only when it's unavailable.

llvm-svn: 260425
2016-02-10 20:02:04 +00:00
Xinliang David Li 00ec96b5a0 Rollback 260394 -- 32bit test needs more config support
llvm-svn: 260402
2016-02-10 18:38:27 +00:00
Xinliang David Li ee195caf66 Add tests for -m32
llvm-svn: 260394
2016-02-10 17:57:55 +00:00
Kostya Serebryany 8c4b9ff921 [asan] update the scariness score: tweak a few weights and add tests
llvm-svn: 260327
2016-02-09 23:46:43 +00:00
Daniel Sanders f6678a635c [lsan] Run the tests for each supported arch and suffix each one to distinguish them.
Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when lsan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260232
2016-02-09 16:22:39 +00:00
Daniel Sanders 922f95ce4b [dfsan] Run the tests for each supported arch and suffix each one to distinguish them.
Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, llvm-commits, srhines

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

llvm-svn: 260231
2016-02-09 16:20:37 +00:00
Daniel Sanders 958d69e0fc [msan] Run the tests for each supported arch and suffix each one to distinguish them.
Summary:
Previously, the tests only ran for the 64-bit equivalent of the default target
(see -m64).
Given the supported architecture list only contains 64-bit targets, this happens
to work out the same as the supported targets in most cases but may matter for
X86_64/X86_64h on Darwin.

For other targets, the practical effect is that the test names contain the
architecture. This resolves some confusion when msan tests fail since their
name no longer implies that they are trying to test the default target.

Reviewers: samsonov

Subscribers: tberghammer, danalbert, srhines, llvm-commits

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

llvm-svn: 260230
2016-02-09 16:18:15 +00:00
Daniel Sanders f1884ccb59 [sanitizer_common] Correct the nits that should have been committed as part of r260227.
llvm-svn: 260229
2016-02-09 16:14:31 +00:00
Daniel Sanders 07f854e726 [sanitizer_common] Add suffix to lit testsuite name to distinguish subtargets.
Summary:
This fixes duplicate test names in the test results, so:
  PASS: SanitizerCommon-asan :: fopen_nullptr.c (304 of 431)
  PASS: SanitizerCommon-asan :: fopen_nullptr.c (305 of 431)
is now:
  PASS: SanitizerCommon-asan-i386-Linux :: fopen_nullptr.c (282 of 431)             
  PASS: SanitizerCommon-asan-x86_64-Linux :: fopen_nullptr.c (316 of 431)

Reviewers: samsonov

Subscribers: llvm-commits

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

llvm-svn: 260227
2016-02-09 15:52:35 +00:00
Evgeniy Stepanov aa42f29221 [asan] Fix build on Windows and PowerPC.
llvm-svn: 260175
2016-02-09 00:28:57 +00:00
Evgeniy Stepanov 0d7839d0d3 [asan] Fix Windows build.
llvm-svn: 260167
2016-02-08 23:01:06 +00:00
Evgeniy Stepanov bc937a10a2 [asan] Remove leftover debug print statement.
llvm-svn: 260165
2016-02-08 22:54:46 +00:00
Evgeniy Stepanov 52f6c262d9 [asan] Implement SEGV read vs write detection for ARM and AArch64.
llvm-svn: 260163
2016-02-08 22:50:25 +00:00
Rong Xu 05ddacc01c [PGO] Update InstrProfData.inc to sync with llvm
Sync InstrProfData.inc with the one in llvm.

llvm-svn: 260148
2016-02-08 21:18:18 +00:00
George Burgess IV ce1437abaa Fix typo in asan_flags.
Patch by Michael Stapelberg.

llvm-svn: 260147
2016-02-08 21:10:00 +00:00
Xinliang David Li a3be895b61 [PGO] Simpflify test and increase coverage
llvm-svn: 260142
2016-02-08 20:46:26 +00:00
Kostya Serebryany bc130af434 [asan] fix the Windows build (MSVC says: cannot specify explicit initializer for arrays)
llvm-svn: 260132
2016-02-08 19:33:36 +00:00
Kostya Serebryany e4ddfd14f1 [asan] re-commit r259961, this time making the test Linux-Only
llvm-svn: 260128
2016-02-08 19:21:08 +00:00
Xinliang David Li 73fe6ce118 Fix windows build bot failure
llvm-svn: 260120
2016-02-08 18:27:04 +00:00
Xinliang David Li 5b7e2e2fa7 [PGO] Enable compression in pgo instrumentation
This reduces sizes of instrumented object files, final binaries,
process images, and raw profile data.

The format of the indexed profile data remain the same.

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

llvm-svn: 260118
2016-02-08 18:14:02 +00:00
Maxim Ostapenko 3dd0ec12d7 [asan] XFAIL local_alias.cc testcase on android in order to fix sanitizer-x86_64-linux buildbot.
llvm-svn: 260090
2016-02-08 12:58:05 +00:00
Maxim Ostapenko 08a70542b1 [asan] XFAIL local alias related tests on Mips due to https://llvm.org/bugs/show_bug.cgi?id=26525.
llvm-svn: 260079
2016-02-08 09:50:57 +00:00
Maxim Ostapenko 9ab99ab985 [asan] Introduce new approach for ODR violation detection based on odr indicator symbols.
This is a compiler-rt part of this http://reviews.llvm.org/D15642 patch. Here,
we add a new approach for ODR violation detection.
Instead of using __asan_region_is_poisoned(g->beg, g->size_with_redzone) on
global address (that would return false now due to using private alias), we can
use new globally visible indicator symbol to perform the check.

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

llvm-svn: 260076
2016-02-08 08:39:59 +00:00
Nico Weber d64186f5da Revert r259961, r259978, r259981.
The "sanitizer-windows" buildbot has been failing for two days because of this:

FAILED: cl.exe asan_report.cc
asan_scariness_score.h(60) : error C2536:
  '__asan::ScarinessScore::__asan::ScarinessScore::descr' :
      cannot specify explicit initializer for arrays
asan_scariness_score.h(60) : see declaration of '__asan::ScarinessScore::descr'

llvm-svn: 260059
2016-02-07 21:41:37 +00:00
Xinliang David Li 879e14330e Test update : tighten up checks
llvm-svn: 260052
2016-02-07 20:08:36 +00:00
Xinliang David Li e5c9b5fe5c Revert 260050 -- new test case should not be included
llvm-svn: 260051
2016-02-07 20:06:36 +00:00
Xinliang David Li c1cf60b339 Test update : tighten up checks
llvm-svn: 260050
2016-02-07 20:05:06 +00:00
Dimitry Andric 927e986ac4 Fix build on FreeBSD after r259741.
On FreeBSD, the uc_mcontext member of ucontext_t has a member called
mc_err, which corresponds to the Linux member gregs[REG_ERR].

Reviewed by:	rdivacky@FreeBSD.org

llvm-svn: 260046
2016-02-07 17:40:45 +00:00
Xinliang David Li abf6d973f4 Add coverage tests (defaulted constructors/destructor)
llvm-svn: 260041
2016-02-07 16:31:13 +00:00
Kostya Serebryany bafa729e26 [asan] trying to fix the non-x86 bots
llvm-svn: 259981
2016-02-06 04:50:30 +00:00
Kostya Serebryany c02ed2a8e2 [asan] properly report an un-aligned global variable instead of just crashing
llvm-svn: 259979
2016-02-06 03:22:24 +00:00