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
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
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
Summary:
When running the compiler-rt testsuite on FreeBSD (it didn't matter which version), I always got the same error result:
FAILED: cd /home/dim/obj/llvm-234092-trunk-freebsd10-amd64-ninja-rel-1/projects/compiler-rt/lib && LLVM_CHECKOUT=/home/dim/src/llvm/trunk SILENT=1 TMPDIR= PYTHON_EXECUTABLE=/usr/local/bin/python2.7 COMPILER_RT=/home/dim/src/llvm/trunk/projects/compiler-rt /home/dim/src/llvm/trunk/projects/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
The following differences between the implemented custom wrappers and the tests have been found:
--- /tmp/tmp.vPFEefvclf 2015-04-04 17:11:44.996734563 +0200
+++ /tmp/tmp.NbIuvjxKEe 2015-04-04 17:11:45.044734647 +0200
@@ -1,52 +0,0 @@
-calloc
-clock_gettime
-ctime_r
-dfsan_set_write_callback
-dl_iterate_phdr
-dlopen
-fgets
-fstat
-get_current_dir_name
-getcwd
-gethostname
-getpwuid_r
-getrlimit
-getrusage
-gettimeofday
-inet_pton
-localtime_r
-memchr
-memcmp
-memcpy
-memset
-nanosleep
-poll
-pread
-pthread_create
-read
-sched_getaffinity
-select
-sigaction
-sigemptyset
-snprintf
-socketpair
-sprintf
-stat
-strcasecmp
-strchr
-strcmp
-strcpy
-strdup
-strlen
-strncasecmp
-strncmp
-strncpy
-strrchr
-strstr
-strtod
-strtol
-strtoll
-strtoul
-strtoull
-time
-write
After some investigation, it turns out to be due to the regex used for search test_ symbols in lib/dfsan/scripts/check_customer_wrappers.sh:
grep -E "^\\s*test_.*\(\);" ${DFSAN_CUSTOM_TESTS}
This uses \s to search for whitespace at start of line, but support for \s was only introduced in GNU grep v2.5.4-112-gf979ca0, while both FreeBSD and OSX only have grep 2.5.1 (the last version released under GPLv2).
I propose to change \s into [[:space:]], which is the more portable notation.
Test Plan: Run regression tests, and see that they work now. :)
Reviewers: pcc, samsonov, emaste
Reviewed By: emaste
Subscribers: llvm-commits, emaste
Differential Revision: http://reviews.llvm.org/D8832
llvm-svn: 234704
The two subclasses of Symbolizer now only define two virtual functions, PlatformDemangle and PlatformPrepareForSandboxing. Let's make these non-virtual and directly defined by individual platforms.
Reviewed at http://reviews.llvm.org/D8912
llvm-svn: 234690
The patch is generated using clang-tidy misc-use-override check.
This command was used:
tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \
-checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix \
-format
llvm-svn: 234680
On Windows, we have to know if a memory to be protected is mapped or not.
On POSIX, Mprotect was semantically different from mprotect most people know.
llvm-svn: 234602
Moving the implementation of several functions from sanitizer_symbolizer.cc into sanitizer_symbolizer_libcdep.cc.
Reviewed at http://reviews.llvm.org/D8858
llvm-svn: 234472
This patch is related to Issue 346: moar string interceptors: strstr, strcasestr, strcspn, strpbrk
As was suggested in original review http://reviews.llvm.org/D6056 a new "strict_string_checks" run-time flag introduced.
The flag support applied for existing common, asan, msan and tsan interceptors. New asan tests added.
Change by Maria Guseva reviewed in http://reviews.llvm.org/D7123
llvm-svn: 234187
This adds hard-float implementation for the following builtins:
* __fixdfdi()
* __fixsfdi()
* __fixunsdfdi()
* __fixunssfdi()
The soft-float implementation does never raise floating point
exceptions, which doesn't allow clients to detect floating point
conversion errors.
I must mention that I had to refer to libgcc's implementation to
write these functions.
Related unit-tests of compiler-rt passed with these changes.
Patch was somewhat out-dated, so was updated locally without any
functional changes.
Differential Revision: http://reviews.llvm.org/D5376
llvm-svn: 234148
MetaMap::ResetRange/FreeRange rounds the range up to at least kMetaShadowSize.
This is requried for e.g. free(malloc(0)). However, munmap returns EINVAL
and do not unmap any memory when length arguments is equal to 0.
So don't free meta shadow in this case as well.
llvm-svn: 234145
This avoids crashing or corrupting data if multiple concurrent
processes write to the same .gcda file. This is hard to test, since
the previous behaviour was a data race that often worked out, and it
ignores errors in flock to fall back to the old racy behaviour so that
it won't degrade the behaviour on filesystems that don't support
flock.
llvm-svn: 234036
Summary:
Change the way we use ASan and UBSan together. Instead of keeping two
separate runtimes (libclang_rt.asan and libclang_rt.ubsan), embed UBSan
into ASan and get rid of libclang_rt.ubsan. If UBSan is not supported on
a platform, all UBSan sources are just compiled into dummy empty object
files. UBSan initialization code (e.g. flag parsing) is directly called
from ASan initialization, so we are able to enforce correct
initialization order.
This mirrors the approach we already use for ASan+LSan. This change
doesn't modify the way we use standalone UBSan.
Test Plan: regression test suite
Reviewers: kubabrecka, zaks.anna, rsmith, kcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8646
llvm-svn: 233861
This CL:
- moves PrepareForSandboxing() to sanitizer_posix_libcdep.cc
- fixes the coverage tests to use flag substitutions defined in r233802 and not rely on hardcoded shared library names
- moves those tests to TestCases/Posix so that they can be executed on Darwin
llvm-svn: 233828