Commit Graph

1772 Commits

Author SHA1 Message Date
Keno Fischer 8dc0e0943b [sanitizer] Add interceptor for ttyname_r
Reviewers: eugenis

Subscribers: kubabrecka, llvm-commits

Differential Revision: https://reviews.llvm.org/D24375

llvm-svn: 281116
2016-09-09 23:09:34 +00:00
Evgeniy Stepanov 627d78f6c2 [asan] Disable handle_abort in Android tests.
The same thing is already done on Mac. handle_abort slows down tests
significantly because it triggers tombstone collection on Android;
also, it changes failed test outcome from "not-crash" to "crash" (as
in "bin/not --crash").

This change adds handle_abort=0 to asan options on android (test
only!), and also tweaks android_run.py to semi-correctly pass the
crash/no-crash status to the caller.

llvm-svn: 281075
2016-09-09 18:43:24 +00:00
Filipe Cabecinhas e3c7f54e93 [asan] Since r280945 fixed the OS X abort() problem, merge scariness_score_test.cc and make it a general test.
Summary: Merges back both scariness_score_test.cc files, since the Linux-specific version shouldn't be needed any more.

Reviewers: kcc, eugenis, vitalybuka

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24347

llvm-svn: 281048
2016-09-09 14:18:22 +00:00
Kostya Serebryany d77e8c0269 [sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc (need to put a zero after strncmp). LOL
llvm-svn: 281015
2016-09-09 02:13:27 +00:00
Qin Zhao 0ab52b97e8 Revert "[ESan][MIPS] Adds support for MIPS64"
Summary:
This reverts commit 62b3eecdbe72af0255f0639b0446087a47efbf48. (D23799)

The CL cause 13 ESan test failure on x86_64:
Failing Tests (13):
    EfficiencySanitizer-x86_64 :: TestCases/large-stack-linux.c
    EfficiencySanitizer-x86_64 :: TestCases/libc-intercept.c
    EfficiencySanitizer-x86_64 :: TestCases/mmap-shadow-conflict.c
    EfficiencySanitizer-x86_64 :: TestCases/struct-simple.cpp
    EfficiencySanitizer-x86_64 :: TestCases/verbose-simple.c
    EfficiencySanitizer-x86_64 :: TestCases/workingset-early-fault.c
    EfficiencySanitizer-x86_64 :: TestCases/workingset-memset.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-midreport.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-samples.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-signal-posix.cpp
    EfficiencySanitizer-x86_64 :: TestCases/workingset-simple.cpp
    EfficiencySanitizer-x86_64 :: Unit/circular_buffer.cpp
    EfficiencySanitizer-x86_64 :: Unit/hashtable.cpp

  Unexpected Failures: 13

Reviewers: bruening, slthakur

Subscribers: sdardis, kubabrecka, beanz

Differential Revision: https://reviews.llvm.org/D24350

llvm-svn: 280954
2016-09-08 16:09:46 +00:00
Kuba Brecka 419ebb2891 [tsan] Support C++11 call_once in TSan on Darwin
This patch adds a wrapper for call_once, which uses an already-compiled helper __call_once with an atomic release which is invisible to TSan. To avoid false positives, the interceptor performs an explicit atomic release in the callback wrapper.

Differential Revision: https://reviews.llvm.org/D24188

llvm-svn: 280920
2016-09-08 10:15:20 +00:00
Vitaly Buka b638c48819 [asan] Test that asan does not report use-after-scope if program jumped over variable declaration.
Summary:
Test to check if PR28267 workaround works.

PR28267
PR27453

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D24323

llvm-svn: 280908
2016-09-08 06:43:02 +00:00
Evgeniy Stepanov 337e40f157 [sanitizer] Fix a conflict between abort_on_error and handle_abort.
Reset the SIGABRT signal handler before calling abort().

Also, change the error message when catching SIGABRT to say "ABRT"
instead of "SEGV".

llvm-svn: 280885
2016-09-07 23:40:53 +00:00
Sagar Thakur 41f08b4422 [ESan][MIPS] Adds support for MIPS64
With this patch 10 out of 13 tests are passing.

Following is the list of failing tests:

    struct-simple.cpp
    workingset-signal-posix.cpp
    mmap-shadow-conflict.c

Reviewed by bruening
Differential: D23799

llvm-svn: 280795
2016-09-07 09:09:03 +00:00
Filipe Cabecinhas 3121ddf7fa [asan] Move scariness_score_test.cc to a common subdirectory
Summary:
Only one of the tests in it doesn't work on OS X.
On Windows it seems that everything that is being moved is also
supported.

The abort() test wasn't copied over (original case 22). This is because
it doesn't work on OS X.

Reviewers: kcc, eugenis, vitalybuka

Subscribers: kubabrecka, llvm-commits
llvm-svn: 280469
2016-09-02 07:18:35 +00:00
Reid Kleckner 0c4dd8de47 Un-XFAIL cfi/stats.cpp, it passes since fixing llvm-symbolizer to look for dwarf again
llvm-svn: 280422
2016-09-01 22:46:26 +00:00
Filipe Cabecinhas d2fb1e4a6c Revert "Copy over most of the scariness_score test to the general tests"
This reverts commit r280361 until we have the proper change in place.

llvm-svn: 280398
2016-09-01 18:40:12 +00:00
Chris Bieneman 5f2546273d [CMake] Adding compiler-rt-test-depends target
This exposes a target for building the compiler-rt test dependencies and matches llvm-test-depends.

llvm-svn: 280393
2016-09-01 18:26:51 +00:00
Renato Golin fbd3de7851 Try to fix another profile test
Another CFG optimisation patch (280364) has broken bad profile tests, and this
is a similar attempt to fix the test without changing the semantics.

llvm-svn: 280373
2016-09-01 14:44:02 +00:00
Renato Golin 0f298a2655 Fix profile test assuming dumb compiler
Commit r280364 has introduced some call-graph optmisations making a profiler
test "fail" due to not expecting the compiler to be "smart", and fold constants
across functions. This commit works around the issue, leaving the origial
semantics intact.

llvm-svn: 280365
2016-09-01 13:45:47 +00:00
Filipe Cabecinhas 6e903def8b Copy over most of the scariness_score test to the general tests
The abort() test wasn't copied over (original case 22). This is because
it doesn't work on OS X.

If theres no buildbot problem with this test later today, I will
minimize the Linux version.

llvm-svn: 280361
2016-09-01 12:29:13 +00:00
Reid Kleckner c213685f69 XFAIL cfi/stats.cpp on Windows until we fix our DIA usage
llvm-svn: 280106
2016-08-30 16:13:07 +00:00
Vasileios Kalintiris 7931529905 [mips][tsan] XFAIL on every MIPS platform an x86_64-specific test.
The map32bit.cc test uses the MMAP_32BIT flag which is supported only
on x86-64.

llvm-svn: 280084
2016-08-30 13:01:04 +00:00
Akira Hatanaka c80f7b866e [asan] Mark failing test as UNSUPPORTED.
llvm-svn: 280055
2016-08-30 03:10:19 +00:00
Vitaly Buka c84d4f5905 [asan] Disable test on darwin bot
According logs asan detects the bug but string with file name is not found.
I will investigate and fix the test.

llvm-svn: 280038
2016-08-30 00:57:40 +00:00
Vitaly Buka 98c3245dc9 [asan] Attempt to fix test on darwin bot
llvm-svn: 280026
2016-08-29 22:59:02 +00:00
Vitaly Buka ac644fa917 [asan] Remove runtime flag detect_stack_use_after_scope
Summary:
We are going to use store instructions to poison some allocas.
Runtime flag will require branching in instrumented code on every lifetime
intrinsic. We'd like to avoid that.

Reviewers: eugenis

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23967

llvm-svn: 279981
2016-08-29 17:16:59 +00:00
Akira Hatanaka 0b2628df1a [asan] Disable tests more selectively.
Add "target-arch+host-os" to the feature list to enable disabling the
tests I committed in r279614 and r279880 more selectively.

llvm-svn: 279918
2016-08-27 16:06:36 +00:00
Akira Hatanaka 56658af2cb [asan] Use "REQUIRES: x86_64-target-arch" to disable the test on i386.
My attempt to disable this test on i386 by adding "UNSUPPORTED: i386-apple"
in r279880 wasn't succesful, so I'm using REQUIRES instead.

llvm-svn: 279916
2016-08-27 05:57:50 +00:00
Kostya Serebryany 42034d009d [asan] restrict release_to_os_test.cc to x86_64
llvm-svn: 279898
2016-08-27 00:36:20 +00:00
Kostya Serebryany b72479b84a [asan] first attempt at releasing free-d memory back to the system using madvise. Requires quite some tuning.
llvm-svn: 279887
2016-08-26 23:58:42 +00:00
Akira Hatanaka 0ac01607b6 [asan] Mark symbolize_pc.cc as UNSUPPORTED on i386-apple.
atos currently doesn't work well when loaded from 32-bit binaries, which
was causing some of the bots to fail. Disable this test until we can
come up with a better fix.

llvm-svn: 279880
2016-08-26 23:08:28 +00:00
Dean Michael Berris f50eb93da7 [compiler-rt][XRay] Initial per-thread inmemory logging implementation
Depends on D21612 which implements the building blocks for the compiler-rt
implementation of the XRay runtime. We use a naive in-memory log of fixed-size
entries that get written out to a log file when the buffers are full, and when
the thread exits.

This implementation lays some foundations on to allowing for more complex XRay
records to be written to the log in subsequent changes. It also defines the format
that the function call accounting tool in D21987 will start building upon.

Once D21987 lands, we should be able to start defining more tests using that tool
once the function call accounting tool becomes part of the llvm distribution.

Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge

Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini

Differential Revision: https://reviews.llvm.org/D21982

llvm-svn: 279805
2016-08-26 06:39:33 +00:00
Dean Michael Berris 510911f7bd Include tests only if COMPILER_RT_BUILD_XRAY is ON.
This should un-break users that have not re-generated their CMake
configs when they ran it when this was defaulted to OFF. Related to
r277975 post-commit review.

llvm-svn: 279802
2016-08-26 02:39:09 +00:00
Kostya Serebryany 7c5ae7cbc6 [sanitizer] enable random shuffling the memory chunks inside the allocator, under a flag. Set this flag for the scudo allocator, add a test.
llvm-svn: 279793
2016-08-26 00:06:03 +00:00
Kostya Serebryany 9aab75f697 [sanitizer] add __sanitizer_symbolize_pc. https://github.com/google/sanitizers/issues/322
llvm-svn: 279780
2016-08-25 21:35:29 +00:00
Kostya Serebryany 3a46def40c [lsan] one more test fix to please the Debian Sid bot (this time, confirmed on the proper machine). Apparently, newer glibc uses slightly more stack
llvm-svn: 279768
2016-08-25 19:08:10 +00:00
Adhemerval Zanella 1005b7d90c msan: Enable 48-bit VMA support on aarch64
This patch adds 48-bits VMA support for msan on aarch64. As current
mappings for aarch64, 48-bit VMA also supports PIE executable. The
48-bits segments only cover the usual PIE/default segments plus some
more segments (262144GB total, 0.39% total VMA). Memory avaliability
can be increase by adding multiple application segments like 39 and
42 mapping (some mappings were added on this patch as well).

Tested on 39 and 48-bit VMA kernels on aarch64.

llvm-svn: 279752
2016-08-25 17:05:56 +00:00
Kostya Serebryany db0fcdb03b [lsan] give a test a bit more stack -- it started failing after r279664 on the debian bot, hopefully this is a fix.
llvm-svn: 279674
2016-08-24 22:10:35 +00:00
Kostya Serebryany 6d03d84fac [ubsan] fix the test to me more resistent against changes in the sanitizer allocator
llvm-svn: 279661
2016-08-24 21:03:28 +00:00
Akira Hatanaka 1164cae527 [asan] Mark asan-symbolize-sanity-test.cc as UNSUPPORTED on x86_64-apple
and x86_64h-apple.

Mark the test as UNSUPPORTED to fix a bot that is failing.

http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check

The bot is failing because asan_symbolize.py cannot tell whether the
reported address is from an x86_64 slice or an x86_64h slice by the
length of the address alone, so it ends up passing the wrong arch to
atos.

rdar://problem/27907889

llvm-svn: 279614
2016-08-24 06:49:28 +00:00
Vitaly Buka 8176ee9b5d [asan] Rename asan-instrument-allocas -> asan-instrument-dynamic-allocas
Summary: Depends on D23707.

Subscribers: kubabrecka

Differential Revision: https://reviews.llvm.org/D23709

llvm-svn: 279377
2016-08-20 17:22:36 +00:00
Chris Bieneman 5968c3ac1f [CMake] Add check-compiler-rt target for runtimes build
Durning standalone builds (which includes runtimes builds) we want to create a target named check-compiler-rt. Additionally we also create check-all if it doesn't already exist as a convienence target that depends on check-compiler-rt.

This allows us to generate a single check target that invokes lit for all test suites in the runtimes projects, while avoiding name collision of check-all and not breaking existing workflows.

llvm-svn: 279334
2016-08-19 22:17:48 +00:00
Vitaly Buka 8075b82322 [asan] Temporarily mark test as broken on Windows
llvm-svn: 279318
2016-08-19 20:48:09 +00:00
Vitaly Buka 3efaaeb79d [asan] Add one more test for __asan_set_shadow_*
Reviewers: eugenis, filcab

Subscribers: llvm-commits, kubabrecka

Differential Revision: https://reviews.llvm.org/D23676

llvm-svn: 279108
2016-08-18 18:15:15 +00:00
Oleg Ranevskyy 8a8b7b6df7 [compiler-rt][tests] cpu_model_test.c test fails to compile if X86 is not clang's default target
Summary:
test/builtins/Unit/cpu_model_test.c tests the X86 specific builtin `__builtin_cpu_supports`.
It fails if the clang's default target is not X86.

The proposed patch adds an additional requirement for the X86 target to the test, making lit ignore the test if the target is different.

Reviewers: asbirlea

Subscribers: dberris, llvm-commits

Differential Revision: https://reviews.llvm.org/D23633

llvm-svn: 279071
2016-08-18 14:39:39 +00:00
Daniel Sanders 93c0f382b4 [mips][msan] Fix all the XPASSes following r278793 and r278795
All msan tests are now passing for mipsel and mips64el except for
allocator_mapping.cc which is marked unsupported.

llvm-svn: 279048
2016-08-18 10:50:46 +00:00
Sagar Thakur 49307c0297 [MSAN][MIPS] Changed memory mapping to support pie executable.
Reviewed by eugenis
Differential: D22993

llvm-svn: 278793
2016-08-16 12:49:54 +00:00
Sagar Thakur 19b84a0224 [TSan][MIPS] Implements setjmp assembly for MIPS64
Reviewed by dvyukov
Differential: https://reviews.llvm.org/D23494

llvm-svn: 278775
2016-08-16 05:06:56 +00:00
Daniel Sanders edfed3deeb [msan] Correct @LINE expression in obstack.cc
Summary:

[[@LINE-30]] only worked because the resulting 3 matches the first character of
30. With the additional blank lines the resulting 5 no longer matches 30.

Reviewers: eugenis

Subscribers: eugenis, llvm-commits

Differential Revision: https://reviews.llvm.org/D23515

llvm-svn: 278715
2016-08-15 18:56:54 +00:00
Daniel Sanders dab0556112 [msan] Fix line number sensitivity in chained_origin.cc and chained_origin_memcpy.cc
Reviewers: eugenis

Subscribers: eugenis, llvm-commits

Differential Revision: https://reviews.llvm.org/D23512

llvm-svn: 278712
2016-08-15 18:50:36 +00:00
Daniel Sanders 67f22ee24a [mips] XFAIL mips64el tests that fail on clang-cmake-mipsel
These tests were recently enabled and have never worked on this builder.

Three tests were sensitive to line number changes:
  test/msan/Linux/obstack.cc
  test/msan/chained_origin.cc
  test/msan/chained_origin_memcpy.cc
and this sensitivity will be addressed in a follow-up patch. Of these,
obstack.cc's sensitivity to line numbers is unexplained since it already uses
[[@LINE]].

llvm-svn: 278671
2016-08-15 15:14:08 +00:00
Ivan Krasin 88661f55c3 Add compiler-rt side test for no_sanitize("cfi") attribute
Summary: Add a test case for __attribute__((no_sanitize("cfi"))) being effective.

Reviewers: kcc

Subscribers: dberris

Differential Revision: https://reviews.llvm.org/D23425

llvm-svn: 278530
2016-08-12 17:26:37 +00:00
Daniel Sanders 875671185e [mips] Remove obstack.cc XFAIL added in r278504 since it broke X86 and PPC somehow.
Adding the XFAIL has caused msan to report a different line number in the call
stack (@LINE-3 rather than @LINE-30). The new line number looks more correct
at first glance since it's the line that uses uninitialized memory rather than
the first non-whitespace line of the file but this needs investigating.

llvm-svn: 278516
2016-08-12 15:34:35 +00:00
Daniel Sanders 6a540c1f38 [mips] XFAIL the new mips64el compiler-rt tests that fail on clang-cmake-mipsel.
The mips64el compiler-rt build has recently been enabled. XFAIL the failing
tests to make the buildbot green again.

The two asan tests require the integrated assembler. This will be fixed soon
for Debian mips64el but not for any other mips64el targets since doing so
requires triple-related issues to be fixed..
The msan tests are largely failing because caused by a kernel update (a patch
has already been posted for this).
I'm not sure why the dfsan test fails yet.

llvm-svn: 278504
2016-08-12 11:56:36 +00:00