Commit Graph

5625 Commits

Author SHA1 Message Date
Ismail Pazarbasi 0da8da5898 Include missing 'sanitizer_platform_limits_posix.h'
Unbreak Mac builds. `#include` seems to be forgotten during staging.

llvm-svn: 237190
2015-05-12 21:30:16 +00:00
Ismail Pazarbasi 6fb3b4ba89 Call system's sigfillset and sigprocmask functions from sanitizers
Reviewers: kcc, glider, dvyukov

Subscribers: llvm-commits

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

llvm-svn: 237177
2015-05-12 20:56:44 +00:00
Ismail Pazarbasi b981dc8479 Sanitizers: Implement `GetRSS` on Mac OS X
Reviewers: kcc, glider, dvyukov

Subscribers: llvm-commits

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

llvm-svn: 237173
2015-05-12 20:47:21 +00:00
Ahmed Bougacha f1ac850e77 [Builtins] Implement half-precision conversions.
Mostly uninteresting, except:
- in __extendXfYf2, when checking if the number is normal, the old
  code relied on the unsignedness of src_rep_t, which is a problem
  when sizeof(src_rep_t) < sizeof(int): the result gets promoted to
  int, the signedness of which breaks the comparison.
  I added an explicit cast; it shouldn't affect other types.
- we can't pass __fp16, so src_t and src_rep_t are the same.
- the gnu_*_ieee symbols are simply duplicated definitions, as aliases
  are problematic on mach-o (where only weak aliases are supported;
  that's not what we want).

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

llvm-svn: 237161
2015-05-12 18:33:42 +00:00
Sergey Matveev f57fb6ce1a [sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().
llvm-svn: 237149
2015-05-12 16:46:54 +00:00
Sergey Matveev 2680fe5f07 [sanitizer] Override pipefail in coverage-missing test.
This should finally fix it.

llvm-svn: 237147
2015-05-12 16:32:41 +00:00
Sergey Matveev 1a66c0ba53 [sanitizer] Re-enable a broken test with debug output.
llvm-svn: 237137
2015-05-12 14:43:31 +00:00
Evgeniy Stepanov d7b3ef65bb [asan] Disable coverage-missing test failing on the bots.
llvm-svn: 237049
2015-05-11 21:16:18 +00:00
Alexey Samsonov c200b5c6ea [UBSan] Add missing header that defines SANITIZER_CAN_USE_PREINIT_ARRAY
Otherwise this compile definition was undefined, and .preinit_array
was never used on the platforms that support it.

llvm-svn: 237045
2015-05-11 21:06:49 +00:00
Viktor Kutuzov 104a383e12 [Msan] Fix the if_indextoname.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9456

llvm-svn: 236999
2015-05-11 14:46:16 +00:00
Kostya Serebryany 8fd66a71c4 [asan/fuzzer] define a dummy weak __sanitizer_cov_trace_cmp
llvm-svn: 236907
2015-05-08 21:32:03 +00:00
Sergey Matveev 42cc8fa592 [sanitizer] Attempt to fix the test for missing coverage script.
llvm-svn: 236877
2015-05-08 16:30:01 +00:00
Sagar Thakur 3e493037be [TSan][MIPS] XFAIL long jump tests for MIPS64
Mark longjmp tests as XFAIL because longjmp assembly for mips is not yet implemented.

Reviewers: dsanders, dvyukov, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9526

llvm-svn: 236847
2015-05-08 12:58:03 +00:00
Sagar Thakur 6c253006b8 [ASAN] Use regex for addresses in kernel_area.cc test
This test was failing on mips because mips addresses are 40-bit long.
Using regex for address solves this issue.

Reviewers: dsanders, kcc, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9516

llvm-svn: 236844
2015-05-08 12:47:10 +00:00
Viktor Kutuzov b0d28db6f1 [Msan] Fix the report-demangling.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9554

llvm-svn: 236833
2015-05-08 12:10:46 +00:00
Viktor Kutuzov 7d5dfe1f34 [Msan] Make the obstack.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9552

llvm-svn: 236831
2015-05-08 12:07:20 +00:00
Justin Bogner fa7525935b builtins: Implement the functions from stdatomic.h
Talking to John and Doug, we concluded that these functions from
stdatomic really do belong here in compiler-rt rather than in libc,
since the compiler owns stdatomic.h and these need to refer to
clang-specific builtins. Nonetheless, I've only added these on darwin
for now - other platforms should probably do the same unless their
libc does implement these functions.

llvm-svn: 236805
2015-05-08 05:39:05 +00:00
Alexey Samsonov 8e5e8fb2f3 [SanitizerCoverage] Upgrade lit tests to new -fsanitize-coverage= flags.
llvm-svn: 236796
2015-05-07 23:20:47 +00:00
Viktor Kutuzov d046d24461 Intercept scandir() on FreeBSD
Committed unreviewed with premission.

llvm-svn: 236720
2015-05-07 12:14:32 +00:00
Viktor Kutuzov 03a909f4b6 Intercept rand_r() on FreeBSD
Committed unreviewed with premission.

llvm-svn: 236719
2015-05-07 12:11:10 +00:00
Viktor Kutuzov 28c99980e6 [Msan] Make the mallinfo.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9461

llvm-svn: 236718
2015-05-07 12:06:35 +00:00
Viktor Kutuzov bea3ca2abf [Msan] Make the ioctl_sound.cc test Linux-specific
Differential Revision: http://reviews.llvm.org/D9460

llvm-svn: 236717
2015-05-07 12:03:07 +00:00
Kostya Serebryany 13c03581ac Add dfsan_weak_hook_memcmp
Summary:
Add a weak hook to be called from dfsan's custom memcmp.
The primary user will be lib/Fuzzer.
If this works well we'll add more hooks (strcmp, etc).

Test Plan: Will be covered by lib/Fuzzer tests.

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 236679
2015-05-07 00:04:39 +00:00
Kostya Serebryany a86398e3fd Add api_list entries for the dfsan-based fuzzer
Summary: Add api_list entries for the dfsan-based fuzzer

Test Plan: covered by check-fuzzer

Reviewers: pcc

Reviewed By: pcc

Subscribers: llvm-commits

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

llvm-svn: 236657
2015-05-06 22:41:34 +00:00
Sergey Matveev a4cf7d71b8 [sanitizer] Restrict the missing coverage test to x86/x86_64.
Contrary to my hopes, it didn't magically work on other platforms.

llvm-svn: 236645
2015-05-06 21:50:42 +00:00
Sergey Matveev c2de346e48 [sanitizer] Extend sancov.py to show which PCs are missing from coverage.
Example usage:

sancov.py print a.out.1234.sancov | sancov.py missing a.out

llvm-svn: 236637
2015-05-06 20:48:29 +00:00
Evgeniy Stepanov 6153377219 [asan] Fall back to /proc/$PID/maps on Android L.
dl_iterate_phdr is somewhat broken in L (see the code for details).
We add runtime OS version detection and fallback to /proc/maps on L or earlier.
This fixes a number of ASan tests on L.

llvm-svn: 236628
2015-05-06 18:55:31 +00:00
Viktor Kutuzov 179ceff160 [Msan] Fix the mmap_below_shadow.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9462

llvm-svn: 236582
2015-05-06 09:31:33 +00:00
Viktor Kutuzov 385d3f2241 [Msan] Fix the ioctl_custom.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9459

llvm-svn: 236581
2015-05-06 09:28:48 +00:00
Viktor Kutuzov a26d2d4d5e [Msan] Fix the initgroups.cc test to build on FreeBSD
Differential Revision: http://reviews.llvm.org/D9458

llvm-svn: 236580
2015-05-06 09:26:35 +00:00
Viktor Kutuzov d04e0d7292 [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9457

llvm-svn: 236579
2015-05-06 09:24:02 +00:00
Sagar Thakur 26f165b04e [ASan][MIPS] Fix null_deref.cc test on MIPS64
Symbol for pc used in ucontext->uc_mcontext was wrong.

Reviewers: dsanders, kcc, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential Revision: http://reviews.llvm.org/D9246

llvm-svn: 236572
2015-05-06 06:53:09 +00:00
Sagar Thakur 1d2854477c [sanitizer][MIPS] Implement clone for MIPS
Reviewers: kcc, samsonov, earthdok
Subscribers: dsanders, jaydeep, Anand.Takale, mohit.bhakkad, llvm-commits
Differential Revision: http://reviews.llvm.org/D8318

llvm-svn: 236570
2015-05-06 05:38:21 +00:00
Evgeniy Stepanov ce29096614 [asan] Fix dynamic-runtime tests.
They are not part of check-all :(

This change adds sized-delete operators to the version list, and disables the
hack that excluded versioned symbols from the dynamic list - this is not an
issue in this case.

llvm-svn: 236559
2015-05-06 00:29:57 +00:00
Evgeniy Stepanov 8af114d93c [asan] Fix compiler-rt build.
i386 runtime library was accidentally using the x86_64 version script without a dependency.

llvm-svn: 236556
2015-05-05 23:13:50 +00:00
Evgeniy Stepanov e8b9d791c2 [asan] Use a version script to limit the symbols exported by the ASan shared runtime library.
llvm-svn: 236551
2015-05-05 22:51:35 +00:00
Kostya Serebryany f3343c5b38 [asan] fix IsDeadlySignal
llvm-svn: 236545
2015-05-05 21:38:50 +00:00
Evgeniy Stepanov 91960900f8 Build ASan runtime library with -z global on Android.
llvm-svn: 236537
2015-05-05 20:13:39 +00:00
Reid Kleckner 60bdf6e4c0 Disable exceptions with Clang on Windows in lib/sanitizer-common/tests
While I'm here, fix a copy-paste bug so we get debug info for these
tests.

llvm-svn: 236505
2015-05-05 16:52:50 +00:00
Dmitry Vyukov da6d5b919d tsan: add memory access functions that accept pc
This is required for Java support, as real PCs don't work for Java.

llvm-svn: 236484
2015-05-05 08:09:46 +00:00
Kostya Serebryany b044353bb2 [asan] under handle_abort=1 option intercept SIGABRT in addition to SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer
llvm-svn: 236474
2015-05-05 01:37:33 +00:00
Reid Kleckner 4fe30a06b1 Fix Windows coverage test with lit shell
llvm-svn: 236446
2015-05-04 19:41:58 +00:00
Reid Kleckner 3d6011fbef Disable exceptions for clang-compiled unittest code on Windows
llvm-svn: 236357
2015-05-01 22:23:56 +00:00
Derek Schuff de036eb170 Fix float->uint conversion for inputs less than 0
Summary:
The spec for these functions says that they should return 0 in this case but
this regressed in r234148. That revision essentially delegates the conversion
to the hardware, but that has different behavior on different platforms (e.g.
it is wrong on x86).

Also fix a typo in the name of __fixunsdfti

Test Plan: The existing unit tests now pass

Reviewers: joerg, howard.hinnant

Subscribers: llvm-commits

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

llvm-svn: 236319
2015-05-01 16:02:16 +00:00
Evgeniy Stepanov b0707833a1 [asancov] Fix coverage reserving 4x the necessary amount of memory on fork.
llvm-svn: 236294
2015-05-01 00:40:42 +00:00
Alexey Samsonov 085bede949 [UBSan] Make stacktrace-matching CHECK-lines in tests Linux-specific.
Darwin doesn't yet allow to print stack trace, as it lacks the slow
unwinder. This is one more attempt to fix vptr.cpp on Mac OS X.

llvm-svn: 236195
2015-04-30 01:21:57 +00:00
Justin Bogner 2d2faae647 profile: Use unique directory for tests that write default profile file
Fix a couple of new tests that were reverted because they were causing
intermittent test failures since they were writing the same default
"default.profraw" file. Fixed by creating a unique directory and
running tests in that directory.

Patch by Teresa Johnson. Thanks!

llvm-svn: 236168
2015-04-29 21:56:35 +00:00
Alexey Samsonov 3965cdeb39 [UBSan] Disable vptr.cpp on Darwin again.
llvm-svn: 236165
2015-04-29 21:51:23 +00:00
Alexey Samsonov 299c21474c [UBSan] Various improvements to vptr.cpp test case
* Remove __ubsan_default_options, so that test would work on Darwin
* Fix unintentional undefined behavior in the code (missing return)
* Build the test with -fno-sanitize-recover to distinguish expected
  failures and expected passes by return code.

llvm-svn: 236152
2015-04-29 20:39:12 +00:00
Alexey Samsonov ff46ebe5a4 [UBSan] Add a testcase for __ubsan_default_options() function.
llvm-svn: 236151
2015-04-29 20:39:10 +00:00
Ahmed Bougacha 69b5f93cb5 Re-XFAIL UBSan vptr testcase on darwin.
Partial revert of r235961; the test still fails on Green Dragon bots.

llvm-svn: 236135
2015-04-29 17:49:05 +00:00
Dmitry Vyukov 7d6d737693 tsan: add another test for setuid
llvm-svn: 236130
2015-04-29 17:22:43 +00:00
Renato Golin 0ac9031fa1 Revert 2 tests from "Tests for r236055."
This partially reverts commit r236056, as the two tests were using the same
names and, when executed in parallel, were having intermittent failures.

llvm-svn: 236101
2015-04-29 13:40:57 +00:00
Eric Christopher 4b3dd38ce0 Tests for r236055.
Patch by Teresa Johnson.

llvm-svn: 236056
2015-04-28 22:56:57 +00:00
Eric Christopher d641b53f93 This change is the first of 3 patches to add support for specifying
the profile output from the command line via -fprofile-instr-generate=<path>,
where the specified output path/file will be overridden by the
LLVM_PROFILE_FILE environment variable.

Several changes are made to the runtime to support this:

Add a new interface __llvm_profile_override_default_filename that will
set the profile output filename, but allows LLVM_PROFILE_FILE to override.
This is the interface used by the new option.

Refactor the pid-expansion done for LLVM_PROFILE_FILE into a separate
routine that can be shared by the various filename setting routines
(so that the filename from the option can also use the "%p" syntax).

Move the truncation into setFilename, and only truncate if there is a
new filename specified (to maintain support for appending to the same
profile file in the case of multiple shared objects built with profiling).

Move the handling for a NULL filename passed to __llvm_profile_set_filename and
__llvm_profile_override_default_filename into the new setFilenamePossiblyWithPid
routine. This now correctly resets the output file to default.profraw
instead of NULL.
The handling for a null LLVM_PROFILE_FILE (which should not reset) is done
by caller setFilenameFromEnvironment.

Patch by Teresa Johnson.

llvm-svn: 236055
2015-04-28 22:54:51 +00:00
Evgeniy Stepanov f483a8a9d0 [asan] Use dl_iterate_phdr on Android.
It's available on Android/ARM starting with API 21 (L).

llvm-svn: 236014
2015-04-28 18:50:32 +00:00
Dmitry Vyukov 25c94eb152 tsan: fix a bug memory access handling
We incorrectly replaced shadow slots
when the new value is not stronger than the old one.
The bug can lead to false negatives.
The bug was detected by Go race test suite:
https://github.com/golang/go/issues/10589

llvm-svn: 236008
2015-04-28 18:08:42 +00:00
Viktor Kutuzov 86e0249235 [Msan] Fix the getline.cc test to pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9251

llvm-svn: 235975
2015-04-28 10:23:52 +00:00
Alexey Samsonov 09bff88fc4 [UBSan] Fix CMake rules for tests after r235954.
Make sure we don't run tests under TSan and MSan if they are
unavailable.

llvm-svn: 235962
2015-04-28 01:33:56 +00:00
Alexey Samsonov 4df0ebef47 Address old FIXMEs in UBSan test cases.
llvm-svn: 235961
2015-04-28 01:29:36 +00:00
Alexey Samsonov dc99a9c7a1 [TSan] Attempt to fix old Makefile build.
llvm-svn: 235960
2015-04-28 01:27:17 +00:00
Alexey Samsonov 72078b3cff Export __ubsan_* symbols from MSan and TSan runtimes.
llvm-svn: 235958
2015-04-28 01:20:34 +00:00
Alexey Samsonov b3053d9cbe Allow UBSan+MSan and UBSan+TSan combinations (Clang part).
Embed UBSan runtime into TSan and MSan runtimes in the same as we do
in ASan. Extend UBSan test suite to also run tests for these
combinations.

llvm-svn: 235954
2015-04-28 00:56:48 +00:00
Evgeniy Stepanov 948a4bbc92 [asan] Fix ASan build on Android/AArch64.
The build for aarch64 is not enabled in cmake/config-ix.cmake yet.

llvm-svn: 235944
2015-04-27 23:49:39 +00:00
Alexey Samsonov 98d79dace3 [UBSan] Reenable ASan+UBSan tests on Darwin now that PR21112 is fixed.
llvm-svn: 235929
2015-04-27 22:09:27 +00:00
Alexey Samsonov 56d6fc81a5 Introduce tsan_cxx and msan_cxx libraries (compiler-rt part).
For now tsan_cxx and msan_cxx contain only operator new/delete
replacements. In the future, when we add support for running UBSan+TSan
and UBSan+MSan, they will also contain bits ubsan_cxx runtime.

llvm-svn: 235928
2015-04-27 22:08:09 +00:00
Alexey Samsonov f430205b82 [TSan] Prepare TSan tests for splitting tsan_cxx library.
llvm-svn: 235927
2015-04-27 22:08:08 +00:00
Alexey Samsonov 042a069b25 [MSan] Prepare for splitting msan_new_delete.cc into a separate library. NFC.
llvm-svn: 235926
2015-04-27 22:08:04 +00:00
Alexey Samsonov 0eafe5df71 [TSan] Move new/delete interceptors into a separate source file. NFC.
llvm-svn: 235906
2015-04-27 19:33:55 +00:00
Viktor Kutuzov 78206c5b7e [Msan] Fix the iconv.cc test to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9252

llvm-svn: 235799
2015-04-25 11:07:05 +00:00
Daniel Sanders 0568283e69 [asan] Print SHADOW_SCALE and SHADOW_GRANULARITY as decimal values.
Summary:
During the review of http://reviews.llvm.org/D9199 where I had originally
changed the debug_mapping.cc test to accept hexadecimal values, we realized
that SHADOW_SCALE and SHADOW_GRANULARITY ought to be printed as decimal values.
This patch makes that change.

This patch also adds a '0x' prefix to the SHADOW_OFFSET to make it clear that
it is hexadecimal while the other two are decimal.

Reviewers: kcc, timurrrr, samsonov

Reviewed By: timurrrr, samsonov

Subscribers: samsonov, llvm-commits, sagar

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

llvm-svn: 235798
2015-04-25 10:57:35 +00:00
Timur Iskhodzhanov aac51934cf [ASan/Win] Increase the size of the PC array for coverage on Windows
llvm-svn: 235779
2015-04-24 21:24:51 +00:00
Alexey Samsonov 5e0774631a [LSan] Add function attribute forgotten in r235728.
llvm-svn: 235761
2015-04-24 19:45:46 +00:00
Sergey Matveev cbdd0dc88a [lsan] Add an interface function for on-demand leak checking.
Summary:
Add an interface function which can be used to periodically trigger
leak detection in a long-running process.

NB: The meaning of the kIgnored tag has been changed to allow easy clean-up
between subsequent leak checks. Previously, this tag was applied to explicitly
ignored (i.e. with __lsan_disable() or __lsan_ignore_object()) chunks *and* any
chunks only reachable from those. With this change, it's only applied to
explicitly ignored chunks.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 235728
2015-04-24 16:53:15 +00:00
Sergey Matveev 4fedac85ee Revert r235726 "interface"
Accidentally committed from local branch. :(

llvm-svn: 235727
2015-04-24 16:51:21 +00:00
Sergey Matveev a409f28b8e interface
llvm-svn: 235726
2015-04-24 16:49:04 +00:00
Derek Schuff eb0ebc367e Add COMPILER_RT_ABI attribute to declarations of builtin functions in unittests
Summary:
This makes their local declarations match their definitions for ARM targets,
where they have a different calling convention.

This really only affects functions that use floating point types (since the
runtime functions use soft-float, and some targets may default to hard-float)
but it seemed good to make it uniform and do the int-only ones too.

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

llvm-svn: 235722
2015-04-24 15:45:57 +00:00
Viktor Kutuzov 53e047de9e [Msan] XFAIL the ftime.cc test on FreeBSD
Differential Revision: http://reviews.llvm.org/D9222

llvm-svn: 235704
2015-04-24 07:54:38 +00:00
Viktor Kutuzov 0e15144ba1 [Msan] Fix the backtrace.cc tests to build and pass on FreeBSD
Differential Revision: http://reviews.llvm.org/D9221

llvm-svn: 235703
2015-04-24 07:52:47 +00:00
Viktor Kutuzov 8dee8575c6 [Sanitizers] Do not call internal_sigdelset() on non-Linux
Differential Revision: http://reviews.llvm.org/D9220

llvm-svn: 235701
2015-04-24 07:48:26 +00:00
Jay Foad fed74298cb [Sanitizer] Fix getpwnam test on ppc64le Fedora 21.
Summary:
On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT
instead of 0. Tolerate this in the test case.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 235654
2015-04-23 22:20:33 +00:00
Alexey Samsonov 26856434d2 [ASan] Relax test modified in r235540 to pacify ARM buildbots.
llvm-svn: 235619
2015-04-23 18:43:08 +00:00
Daniel Sanders 9316d89d55 [asan] debug_mapping.cc should also pass when the leading digit of SHADOW_SCALE is hexadecimal.
Summary:
Previously the CHECK directive for SHADOW_SCALE only matched decimal digits
causing it to match '7' on x86_64 instead of the whole value.

This fixes a failure on mips-linux-gnu targets where the leading digit is 'a'.

Reviewers: kcc, sagar, timurrrr

Reviewed By: timurrrr

Subscribers: llvm-commits

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

llvm-svn: 235594
2015-04-23 13:23:21 +00:00
Timur Iskhodzhanov ac990bfcd3 [Sanitizer coverage] Print out the error number if OpenFile fails
llvm-svn: 235593
2015-04-23 13:18:50 +00:00
Timur Iskhodzhanov d0be0a9897 [ASan/Win] Initialize sandbox-related stuff when asked to
llvm-svn: 235591
2015-04-23 12:58:11 +00:00
Timur Iskhodzhanov 8a67368cc5 [ASan/Win] Don't forget to set *last_error if OpenFile fails
llvm-svn: 235590
2015-04-23 12:57:29 +00:00
Dmitry Vyukov 3658f6fcc4 tsan: support setuid call
Currently the call hangs because the background thread
does not handle SIGSETXID signal.

llvm-svn: 235581
2015-04-23 09:33:27 +00:00
Alexey Samsonov 8c80e7420a [UBSan] Unify the way we report overflow in increment/decrement operator.
llvm-svn: 235569
2015-04-23 01:50:56 +00:00
Alexey Samsonov 434984ef58 [UBSan] Make sure proper error summary is printed for -fsanitize=float-cast-overflow.
float-cast-overflow handler doesn't have source location provided by the
compiler, but we still have *some* source location if we have a
symbolizer.

llvm-svn: 235567
2015-04-23 01:08:31 +00:00
Alexey Samsonov 9e463ba35d [ASan] Print global registration site in init-order-checker reports.
llvm-svn: 235540
2015-04-22 20:30:19 +00:00
Alexey Samsonov e74ec45b88 [ASan] Refactor functions searching/describing globals. NFC.
llvm-svn: 235539
2015-04-22 20:30:15 +00:00
Daniel Sanders 7ea4cfcf83 [ubsan] Stop cast-overflow.cpp test leaking undefined behaviour into the exit code.
Summary:
ubsan was correctly catching the undefined behaviour but lit's shell was
failing the test anyway because the exit code was non-zero as a result of the
undefined behaviour.

This fixes the test on a mips-linux-gnu target.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits, rsmith, sagar

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

llvm-svn: 235518
2015-04-22 16:14:01 +00:00
Sergey Matveev f8d5251dad [sanitizer] Plug a memory leak in symbolization code.
llvm-svn: 235411
2015-04-21 20:05:10 +00:00
Daniel Sanders ffa272ebbb [mips] Support building compiler-rt with gcc.
Summary:
This will allow us to enable it on the buildbot (and then enable a
sanitizer buildbot).

The problem is that gcc for Mips does not accept -m32/-m64 like clang does.
We therefore need to use the nearest equivalent -mips32r2/-mips64r2. We must
also specify -mabi=64 in the -mips64r2 case since gcc's default ABI has
traditionally been N32 whereas clang's is N64.

Reviewers: sagar

Reviewed By: sagar

Subscribers: llvm-commits, samsonov, kcc, mohit.bhakkad, Anand.Takale, sagar

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

llvm-svn: 235299
2015-04-20 12:44:01 +00:00
Viktor Kutuzov aff5bb0518 [Asan] Link lit tests shared libraries with -Wl,z,origin on FreeBSD
Differential Revision: http://reviews.llvm.org/D8834

llvm-svn: 235297
2015-04-20 12:25:11 +00:00
Dmitry Vyukov 3ff1c381e0 tsan: deflake a test
llvm-svn: 235294
2015-04-20 10:35:21 +00:00
Dmitry Vyukov 8586e2352b tsan: fix handling of pthread_detach
Fixes https://llvm.org/bugs/show_bug.cgi?id=23235

If pthread_create is followed by pthread_detach,
the new thread may not acquire synchronize with
the parent thread.

llvm-svn: 235293
2015-04-20 10:35:10 +00:00
Hal Finkel 0423483bab Make ubsan respect log_path
As with the other sanitizers, it is desirable to allow ubsan's output to be
redirected to somewhere other than stderr (and into per-process log files).

llvm-svn: 235277
2015-04-19 20:16:13 +00:00
Bob Wilson a2f65bd047 Include __mulodi4 in the 32-bit ARM versions of libclang_rt.cc_kext.a.
This is needed when building the Darwin kernel with
-fsanitize=undefined-trap. rdar://problem/12783702

llvm-svn: 235270
2015-04-19 04:09:44 +00:00
Sagar Thakur bcc495abc8 test commit
llvm-svn: 235176
2015-04-17 10:14:16 +00:00