summaryrefslogtreecommitdiff
path: root/test/ubsan
AgeCommit message (Collapse)Author
2014-11-10Enable running Ubsan tests on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6089 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221599 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10[Ubsan] Fix the missing_return.cpp test to pass on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221597 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-10[Ubsan] Fix the cast-overflow.cpp test to build on FreeBSDViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D6087 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221596 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-06UBSan: Teach isDerivedFromAtOffset and findBaseAtOffset about vbasesDavid Majnemer
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221445 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16UBSAN stable runtime more generic with arm* targetsRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219924 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-16Adds stable-runtime to ubsan to avoid broken ARM tests with asanRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219906 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14Re-enable ASAN/UBSAN tests on ARM, with VFP3 they began to passRenato Golin
When compiling with -mfpu=vfpv3, those tests began to pass, like the others with "Illegal Instruction" error, so removing the XFAIL from them should get the bot green (and have more tests!). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219721 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-14[UBSan] XFAIL test added in r219642 on DarwinAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219699 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-13Sanitize upcasts and conversion to virtual base.Alexey Samsonov
This change adds UBSan check to upcasts. Namely, when we perform derived-to-base conversion, we: 1) check that the pointer-to-derived has suitable alignment and underlying storage, if this pointer is non-null. 2) if vptr-sanitizer is enabled, and we perform conversion to virtual base, we check that pointer-to-derived has a matching vptr. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219642 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11[UBSan] Disable one run line of this test to allow the test as a wholeChandler Carruth
to pass in an opt build. The test case in question does show UBSan catching the error, but it doesn't then successfully set the exit code of the program. I'll let the UBSan folks sort out why. It should reproduce trivially with an optimized build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219563 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-11[UBSan] Fix UBSan testcase for float->int conversion after LLVM r219542.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219559 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-10Disabling main() check on UBSAN, since the noreturn check is already madeRenato Golin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219488 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09XFAIL some more sanitiser ARMv7l testsRenato Golin
Some more tests failing on the ARMv7 buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219404 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08Mark sanitizer tests XFAIL on ARMv7Renato Golin
ASAN, UBSAN and profile tests that don't work with arm-linux-gnueabi and android also don't work on armv7l-linux-gnueabihf. Some of the tests have known causes, others not yet. In order to get a green bot, I'm disabling those tests for now and will investigate when the priority rises. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219343 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01Disable the ubsan-asan config on Darwin.Alexander Potapenko
UBSan doesn't work together with ASan on Darwin yet, see http://llvm.org/bugs/show_bug.cgi?id=21112 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30[UBsan] Disable summary.cpp on Darwin. The test requires ubsan-asan, which ↵Alexander Potapenko
does not work yet. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218675 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-30[UBSan] Use <machine/endian.h> on Darwin.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218662 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26[UBSan] Adding support of MIPS32Petar Jovanovic
Changed files: config-ix.cmake: Enabled UBSan for MIPS32 sanitizer_stacktrace.cc: Program counter for MIPS32 is four byte aligned and a delay slot so subtracted PC by 8 for getting call site address. cast-overflow.cpp: Added big endian support for this test case. Patch by Sagar Thakur. Differential Revision: http://reviews.llvm.org/D4881 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218519 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-22UBSan: print 'undefined-behavior' instead of 'runtime-error' in report summaryAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218264 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19[UBSan] Introduce more flexible __ubsan_default_options function instead of ↵Alexey Samsonov
UBSAN_DEFAULT_OPTIONS compile definition git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218137 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19[UBSan] Optionally report summary in UBSan error reports.Alexey Samsonov
By default summary is not printed if UBSan is run in a standalone mode, but is printed if it's combined with another sanitizer (like ASan). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218135 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-17PR20721: Don't let UBSan print inaccessible memoryAlexey Samsonov
Summary: UBSan needs to check if memory snippet it's going to print resides in addressable memory. Similar check might be helpful in ASan with dump_instruction_bytes option (see http://reviews.llvm.org/D5167). Instead of scanning /proc/self/maps manually, delegate this check to the OS kernel: try to write this memory in a syscall and assume that memory is inaccessible if the syscall failed (e.g. with EFAULT). Fixes PR20721. Test Plan: compiler-rt test suite Reviewers: eugenis, glider Reviewed By: glider Subscribers: emaste, ygribov, llvm-commits, glider, rsmith Differential Revision: http://reviews.llvm.org/D5253 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217971 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-12Revert r217616. Problems and complexity it introduces negate its benefitAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217652 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11[UBSan] Parse common flags from UBSAN_OPTIONS runtime variable even ifAlexey Samsonov
UBSan is combined with ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-10[UBSan] Add halt_on_error runtime flagAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217535 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-08Report source location of returns_nonnull attribute in UBSan reports.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217400 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-08Implement nonnull-attribute sanitizerAlexey Samsonov
Summary: This patch implements a new UBSan check, which verifies that function arguments declared to be nonnull with __attribute__((nonnull)) are actually nonnull in runtime. To implement this check, we pass FunctionDecl to CodeGenFunction::EmitCallArgs (where applicable) and if function declaration has nonnull attribute specified for a certain formal parameter, we compare the corresponding RValue to null as soon as it's calculated. Test Plan: regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits, rnk Differential Revision: http://reviews.llvm.org/D5082 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@217389 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-28[ubsan] Follow-up for r216657: fixed the line numbers in the test.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216661 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-28[UBSan] Temporarily disable checks for stack traces in UBSan reports on DarwinAlexander Potapenko
to make the tests green. Slow stack unwinding is disabled in libsanitizer on Darwin now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216657 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22[UBSan] Add support for printing backtraces to all UBSan handlersAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216289 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22[ubsan] Follow-up for r216263: fix the expected line number.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216266 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-22[ubsan] Do not run Function/function.cpp on Darwin where -fsanitize=function ↵Alexander Potapenko
is not supported. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@216263 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-13[UBSan] Add returns-nonnull sanitizer.Alexey Samsonov
Summary: This patch adds a runtime check verifying that functions annotated with "returns_nonnull" attribute do in fact return nonnull pointers. It is based on suggestion by Jakub Jelinek: http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140623/223693.html. Test Plan: regression test suite Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4849 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215485 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08[CMake] Determine which compiler-rt libraries are supported onAlexey Samsonov
a given platform in a top-level CMakeLists.txt to use it both in lib/ and in test/ subdirectories. Move architecture/platform checks to config-ix. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215247 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05The test doesn't export ASAN_OPTIONS, so $ASAN_OPTIONS should not be used in ↵Alexander Kornienko
RUN lines. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214855 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-05[UBSan] Allow to suppress reports from vptr checker for specified types.Alexey Samsonov
Based on http://reviews.llvm.org/D4702 by Byoungyoung Lee! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214833 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29[UBSan] Try to enable pipefail in UBSan lit tests to make them behave more ↵Alexey Samsonov
predictably git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@214149 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23[UBSan] Add the ability to dump call stacks to -fsanitize=vptrAlexey Samsonov
This change introduces the first UBSan-specific runtime flag: print_stacktrace (off by default). It can be set in UBSAN_OPTIONS to unwind and print call stacks in addition to diagnostic messages. For now these stacks are printed only in vptr checker. This change is based on http://reviews.llvm.org/D4410 by Byoungyoung Lee! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213783 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23[UBSan] Introduce UBSAN_OPTIONS environment variable.Alexey Samsonov
If UBSan is run in a standalone mode (w/o any other sanitizer), it still uses functions from sanitizer_common, some of which depend on the value of runtime flags. Allow to override the default values of these flags with UBSAN_OPTIONS variable. In particular, UBSAN_OPTIONS=symbolize=0 can be used to turn off online symbolization. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213782 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARM, take 2Greg Fitzgerald
Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209856 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29Revert "light up sanitizers for ARM"Greg Fitzgerald
This commit broke the Windows build, where CMAKE_C_COMPILER can compile and link with -march=armv7-a but the just-built-clang cannot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209851 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29light up sanitizers for ARMGreg Fitzgerald
You can expect the sanitizers to be built under any of the following conditions: 1) CMAKE_C_COMPILER is GCC built to cross-compile to ARM 2) CMAKE_C_COMPILER is Clang built to cross-compile to ARM (ARM is default target) 3) CMAKE_C_COMPILER is Clang and CMAKE_C_FLAGS contains -target and --sysroot Differential Revision: http://reviews.llvm.org/D3794 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209835 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23[ubsan] temporary disable testing with -m32 as there are bots that don't ↵Kostya Serebryany
support it git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209517 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23[ubsan] handle long double in 32-bit mode; part of the patch by Marek PolacekKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209516 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-20[ubsan] fix vptr test on ARMGreg Fitzgerald
Differential Revision: http://reviews.llvm.org/D3751 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209249 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14removed redundant lit variableGreg Fitzgerald
Thanks Alexey! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208747 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14Add target flags to ubsan testsGreg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208746 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-14Add %run to tests that used %T/name.exeGreg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208744 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30Add %run to all lit testsGreg Fitzgerald
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30Allow any test to be executed via a %run command.Greg Fitzgerald
Configure %run with COMPILER_RT_EMULATOR: $ cmake -DCOMPILER_RT_EMULATOR="qemu-arm -L $SYSROOT" git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207707 91177308-0d34-0410-b5e6-96231b3b80d8