Summary:
This test explicitly sets ASAN_OPTIONS=detect_leaks=1 which is only
supported on x86-64. The test is currently restricted to run only on
64-bit targets, but needs to be restricted further so it only runs on
x86-64.
Reviewers: kcc, eugenis, earthdok, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6189
llvm-svn: 222091
Summary:
AsanOnSIGSEGV has some heuristics for detecting stack overflow, but
they don't cope with a PowerPC store-with-update instruction which
modifies sp and stores to the modified address in one instruction.
This patch adds some PowerPC-specific code to check for this case.
This fixes the last few cases of the stack-overflow test.
Reviewers: kcc, samsonov, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6253
llvm-svn: 222001
This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.
llvm-svn: 221952
Summary:
As a follow-up to D6167, this patch fixes the test to account for
another difference between PowerPC and x86 systems.
On x86 if you branch to an invalid address, you get a SIGSEGV with PC
set to the invalid address (and si_addr in the siginfo struct also set
to the same address).
On PowerPC, you get a SIGSEGV with PC pointing at the branch
instruction, but si_addr set to the invalid address.
You can see this difference if you run the test case under gdb.
Reviewers: kcc, glider, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6226
llvm-svn: 221929
Summary:
I don't know anything about profiling but it seems to work out of the
box on PowerPC64. At least "make check-profile" works.
A few tests needed tweaking because PowerPC64 IR declares main with
"define signext i32 @main" instead of just "define i32 @main".
This also fixes the asan asan_and_llvm_coverage_test test, which
compiles with -coverage so requires that a profiling version of
libclang_rt has been built.
Reviewers: dexonsmith, kcc, samsonov
Reviewed By: samsonov
Subscribers: samsonov, llvm-commits
Differential Revision: http://reviews.llvm.org/D6233
llvm-svn: 221877
Summary: My PowerPC64 Linux box has 64k pages. The test assumes 4k pages. Fix it.
Reviewers: glider, eugenis, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6228
llvm-svn: 221875
The code in {add,sub}v.i3 routines does not trap when it should, because
it performs the actual add/subtract operation in signed arithmetic,
rather than unsigned.
Patch by Francois-Xavie Coudert!
llvm-svn: 221826
Summary: This test case is blatantly x86-specific, so skip it on other targets.
Reviewers: kcc, eugenis, earthdok, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6216
llvm-svn: 221778
Summary:
Address sanitization of ptrace(2) is only implemented for x86, so skip
the test on other targets.
Reviewers: kcc, eugenis, earthdok, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6215
llvm-svn: 221777
Summary:
The option -asan-instrument-assembly is declared in the X86 backend.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=All then the
option is tolerated but ignored.
If I test on PowerPC configured with LLVM_TARGETS_TO_BUILD=PowerPC then
the testsuite fails with:
[ 93%] Generating ASAN_INST_TEST_OBJECTS.gtest-all.cc.powerpc64-inline.o
clang (LLVM option parsing): Unknown command line argument '-asan-instrument-assembly'. Try: 'clang (LLVM option parsing) -help'
Fix this inconsistency by only adding the option if that toolchain was
built with the X86 backend included.
Reviewers: kcc, samsonov, eugenis
Reviewed By: eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6190
llvm-svn: 221687
The minimal fake SDK was very useful in allowing us to build for all
Darwin platforms without needing access to the real SDKs, but it did
not support building any of the sanitizer runtimes. It's important to
fix that. As a consequence, if you don't have the iOS SDKs installed,
we will now skip building the iOS-specific libclang_rt libraries.
rdar://problem/18825276
llvm-svn: 221621
r199996 added new x86_64h slices for all the Darwin compiler_rt libraries
that had an x86_64 slice, but that is overkill for the iOS Simulator
platform where the x86_64h slice is never used.
llvm-svn: 221610
Summary:
Tweak the asan stack overflow heuristics to cope with PowerPC64 redzones,
which are larger than on x86-64: 288 bytes for big-endian and 512 bytes
for little-endian.
Reviewers: kcc, willschm, samsonov, eugenis
Reviewed By: samsonov, eugenis
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6168
llvm-svn: 221578
Summary:
In the Power architecture, all branch instructions ignore the 2 least
significant bits of the target address. Consequently if you branch to an
invalid address, the address reported along with the SIGSEGV will have
been rounded down to a multiple of 4. Tweak this test accordingly.
This may fix the test for ARM too, in which case we could remove
the XFAIL, but I have no way of testing that.
Reviewers: kcc, willschm, glider, samsonov
Reviewed By: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6167
llvm-svn: 221542
This flag can be used to specify the format of stack frames - user
can now provide a string with placeholders, which should be printed
for each stack frame with placeholders replaced with actual data.
For example "%p" will be replaced by PC, "%s" will be replaced by
the source file name etc.
"DEFAULT" value enforces default stack trace format currently used in
all the sanitizers except TSan.
This change also implements __sanitizer_print_stack_trace interface
function in TSan.
llvm-svn: 221469
for both PPC64 Big and Little endian modes, so also eliminates the need for
the BIG_ENDIAN/LITTLE_ENDIAN #ifdeffery.
By trial and error, it also looks like the kPPC64_ShadowOffset64 value is
valid using (1ULL << 41) for both BE and LE, so that #if/#elif/#endif block
has also been simplified.
Differential Revision: http://reviews.llvm.org/D6044
llvm-svn: 221457
When the __virtual_mask is set, __offset_flags >> __offset_shift yields
an offset into the vtable. Dereferencing this vtable slot gets us the
vbase offset.
Adjust a test case to verify that this, in fact, works.
Differential Revision: http://reviews.llvm.org/D6074
llvm-svn: 221445
Summary:
This commit introduces function __sanitizer::RenderFrame()
that allows to render the contents of AddressInfo (essentially, symbolized stack frame)
using the custom format string. This function can be used to
implement stack frame formatting for both ThreadSanitizer and
generic StackTrace::Print(), used in another places. This paves the
way towards allowing user to control the format of stack frames,
obtaining them in any format he desires, and/or enforcing the consistent
output from all sanitizers.
Test Plan: compiler-rt test suite
Reviewers: kcc
Reviewed By: kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D6140
llvm-svn: 221409
The current ASan testcase Posix/allow_user_segv.cc expects SIGBUS to be triggered on 32-bit Darwin. This has apparently changed on 10.10 to trigger SIGSEGV instead, just as on 64-bit. Let's just install handlers for both SIGSEGV and SIGBUS instead of #ifdef'ing.
Reviewed at http://reviews.llvm.org/D6121
llvm-svn: 221381
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
llvm-svn: 221379
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
llvm-svn: 221356