summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
* [asan] Re-poison all redzones on activation.Evgeniy Stepanov2016-09-132-12/+63
| | | | | | | | | | | | | When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones are not poisoned until the first instrumented module is loaded. This can cause false negatives even on memory allocated after activation, because redzones are normally poisoned only once when a new allocator region is mapped. This change attempts to fix it by iterating over all existing allocator chunks and poisoning their redzones. llvm-svn: 281364
* [asan] Add missing include for rand()Jonas Hahnfeld2016-09-131-0/+1
| | | | llvm-svn: 281342
* [sanitizer] replace CHECK with CHECK_XY in two places for better diagnosticsKostya Serebryany2016-09-121-2/+2
| | | | llvm-svn: 281255
* [asan] Ease dealing with tagged enum ErrorDescription with some macros.Filipe Cabecinhas2016-09-121-32/+27
| | | | | | | | | | | | | | | Summary: Added a macro to enumerate the (error name, error member name) pairs. This way, when adding an error, we only need to add the pair to one place (plus add its implementation, or course). Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23875 llvm-svn: 281237
* [asan] Cleanup: Move tid into ErrorBase, add const to BufferedStackTrace, be ↵Filipe Cabecinhas2016-09-124-28/+27
| | | | | | | | | | | | | | | | consistent in constructor arguments and member order. Summary: As mentioned in D24394, I'm moving tid to ErrorBase, since basically all errors need it. Also mentioned in the same review are other cleanups like adding const to BufferedStackTrace and make sure constructor orders are consistent. Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24455 llvm-svn: 281236
* [sanitizer] Add interceptor for ttyname_rKeno Fischer2016-09-093-0/+22
| | | | | | | | | | Reviewers: eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24375 llvm-svn: 281116
* [sanitizer] fix an allocator bug where the allocated memory may overlap with ↵Kostya Serebryany2016-09-092-4/+22
| | | | | | the free array (kudos to Kostya Korcthinsky). Also make sure that the allocator does not mmap more than requested. Test both. llvm-svn: 281103
* [asan] Store access_size in the {Stack,Global}AddressDescription objectsFilipe Cabecinhas2016-09-092-20/+27
| | | | | | | | | | | | | | | Summary: This is important information when we want to describe errors, and should be part of these descriptions. Otherwise, we need to know the access size when printing/emitting the description. Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24387 llvm-svn: 281093
* [asan] Add a new AddressDescription structure, which can describe any type ↵Filipe Cabecinhas2016-09-094-76/+174
| | | | | | | | | | | | | | | | | | | | | | of address. Summary: This is useful for inclusion in the Error* structures, to describe an arbitrary address. Remove the old struct since it's used only once. This removes one level of indirection, and moves all *AddressDescription to be one of the recently introduced structures. This merges differential revisions: D24131 and D24132 Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24131 llvm-svn: 281090
* [asan] Disable handle_abort in Android tests.Evgeniy Stepanov2016-09-094-4/+17
| | | | | | | | | | | | | 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
* [asan] Since r280945 fixed the OS X abort() problem, merge ↵Filipe Cabecinhas2016-09-092-14/+3
| | | | | | | | | | | | | | 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
* [sanitizer] fix a potential buffer overflow due to __sanitizer_symbolize_pc ↵Kostya Serebryany2016-09-092-1/+12
| | | | | | (need to put a zero after strncmp). LOL llvm-svn: 281015
* Fix tsan-go build.Evgeniy Stepanov2016-09-081-0/+2
| | | | | | Disable the new abort-in-SIGABRT code under SANITIZER_GO. llvm-svn: 280980
* [powerpc] Move #if to appease warnings-as-errors testsBill Seurer2016-09-081-3/+2
| | | | | | Previous patch added a #if which causes some unused identifier warnings. llvm-svn: 280976
* Revert "[XRay] ARM 32-bit no-Thumb support in compiler-rt"Renato Golin2016-09-089-423/+117
| | | | | | This reverts commit r280890, as the related LLVM commit broke the thumb bots. llvm-svn: 280969
* Fix linker warning about sanitizer_common_nolibc functions on WindowsReid Kleckner2016-09-081-0/+4
| | | | llvm-svn: 280962
* Really fix warnings about passing -std=gnu99 to MSVCReid Kleckner2016-09-081-2/+3
| | | | llvm-svn: 280958
* Revert "[ESan][MIPS] Adds support for MIPS64"Qin Zhao2016-09-0813-175/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [compiler-rt] Don't use -fPIC when building for WindowsFrancis Ricci2016-09-081-1/+3
| | | | | | | | | | | | Summary: This flag doesn't make sense on Windows systems. Reviewers: beanz, kubabrecka, compnerd Subscribers: dberris, llvm-commits, beanz Differential Revision: https://reviews.llvm.org/D24320 llvm-svn: 280953
* [asan] Fix handle_abort_on_error.cc test on DarwinKuba Brecka2016-09-081-0/+2
| | | | | | | | r280885 added a testcase for handle_abort, which is broken on macOS, let’s add this support into sanitizer_mac.cc. Differential Revision: https://reviews.llvm.org/D24344 llvm-svn: 280945
* [asan] Handle SIGBART signal description. (found by buildbot)Filipe Cabecinhas2016-09-081-0/+2
| | | | llvm-svn: 280934
* [asan] Reify ErrorDeadlySignalFilipe Cabecinhas2016-09-087-71/+125
| | | | | | | | | | | | Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23873 llvm-svn: 280930
* [tsan] Support C++11 call_once in TSan on DarwinKuba Brecka2016-09-082-0/+61
| | | | | | | | 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
* [asan] Test that asan does not report use-after-scope if program jumped over ↵Vitaly Buka2016-09-081-0/+21
| | | | | | | | | | | | | | | | | | 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
* Correctly escape %.Nico Weber2016-09-081-1/+1
| | | | | | Found be an MSVC warning; I filed PR30320 for adding a similar warning to clang. llvm-svn: 280900
* [XRay] ARM 32-bit no-Thumb support in compiler-rtDean Michael Berris2016-09-089-117/+423
| | | | | | | | | | | | | This is a port of XRay to ARM 32-bit, without Thumb support yet. This is one of 3 commits to different repositories of XRay ARM port. The other 2 are: 1. https://reviews.llvm.org/D23931 (LLVM) 2. https://reviews.llvm.org/D23932 (Clang test) Differential Revision: https://reviews.llvm.org/D23933 llvm-svn: 280890
* [sanitizer] Fix a conflict between abort_on_error and handle_abort.Evgeniy Stepanov2016-09-073-1/+21
| | | | | | | | | 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
* [asan] Fix build on Linux.Evgeniy Stepanov2016-09-071-1/+1
| | | | llvm-svn: 280881
* builtins: make sure that flags is setup properly for __clear_cacheSaleem Abdulrasool2016-09-071-1/+3
| | | | | | | | On Linux ARM, the syscall will take 3 arguments (start, end, flags). Ensure that we do not pass garbage to the flags, which can cause the cacheflush call to fail, and therefore cause an abort at runtime. llvm-svn: 280877
* [asan] Fix a crash in GetCurrentThread() before init.Evgeniy Stepanov2016-09-071-1/+1
| | | | | | | | | Android-specific code in GetCurrentThread() does not handle the situation when there is no ThreadContext for the current thread. This happens if the current thread is requested before the main thread is added to the registry. 64-bit allocator does that to record map/unmap stats during initialization. llvm-svn: 280876
* [asan] Add openlog() on Android.Evgeniy Stepanov2016-09-071-2/+2
| | | | | | | | Normally, syslog() uses argv[0] for the log tag; bionic, however, would crash in syslog() before libc constructor unless the log tag is explicitly set with openlog(). llvm-svn: 280875
* [compiler-rt] Allow sanitizers to be compiled for windows with clangFrancis Ricci2016-09-072-2/+10
| | | | | | | | | | | | | | Summary: A few small changes required to permit building the sanitizers with Clang instead of only with MSVC. Reviewers: compnerd, beanz, rnk Subscribers: beanz, timurrrr, kubabrecka, dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D24092 llvm-svn: 280863
* [compiler-rt] Fix library suffixes on windowsFrancis Ricci2016-09-072-2/+17
| | | | | | | | | | | | | | | Summary: Make sure that windows libraries contain the suffixes expected by clang. This is expecially important when compiling the windows builtins with clang, as cmake will use .a as the suffix by default. Reviewers: beanz, compnerd Subscribers: llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D24046 llvm-svn: 280854
* [powerpc] Move #if to appease warnings-as-errors testsBill Seurer2016-09-071-3/+4
| | | | | | | Previous patch added a #if which caused a variable and function to be unused. llvm-svn: 280846
* [powerpc] Disable ManyThreadsWithStatsStressTest test for ppc64Bill Seurer2016-09-071-0/+4
| | | | | | | | Since r279664 this test causes frequent failures of test runs for ppc64le and occasional failures for ppc64be which makes buildbot results unreliable. If the underlying problem is fixed it can be re-enabled. llvm-svn: 280823
* [asan] Reify ErrorNewDeleteSizeMismatchFilipe Cabecinhas2016-09-075-23/+58
| | | | | | | | | | | | Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23874 llvm-svn: 280812
* [ESan][MIPS] Adds support for MIPS64Sagar Thakur2016-09-0713-36/+175
| | | | | | | | | | | | | | | 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
* Add #include <cstdio> to unbreak build (missing definition of stderr)Krzysztof Parzyszek2016-09-061-0/+1
| | | | llvm-svn: 280714
* asan: allow __asan_{before,after}_dynamic_init without registered globalsDmitry Vyukov2016-09-051-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When optimizing, GCC optimizes away aggressively unused static globals. The __asan_before_dynamic_init/__asan_after_dynamic_init calls are placed in static constructor earlier while the registration of the globals is done later in the compilation process. If all the globals with dynamic initialization are optimized away from some particular TU in between those two, libasan can fail on an assertion that dynamic_init_globals is empty. While I'm going to commit a GCC change which will remove the __asan_before_dynamic_init/__asan_after_dynamic_init in many cases when this happens (basically if the optimizers can prove there are no memory references in between the two calls), there are still testcases where such pair of calls is left, e.g. for struct S { S () { asm volatile ("" : : : "memory"); } }; static S c; int main () { return 0; } with -O2 -fsanitize=address and ASAN_OPTIONS=check_initialization_order=true this still fails the assertion. Trying to avoid this problem on the compiler side would decrease code quality I'm afraid, whether it is making sure for -fsanitize=address we keep around at least one dynamically initialized global if the __asan_before_dynamic_init/__asan_after_dynamic_init pair has been emitted, or adding some artificial global which would be used as the condition for those calls etc. So, can the assertion be instead just removed, this really shouldn't slow down the calls measurably (for __asan_before_dynamic_init it is even cheaper) and the assertion doesn't check something worthwhile anyway (it is sufficient if there is a single dynamically initialized global in any other TU to make it happy). Details in http://gcc.gnu.org/PR77396 Author: Jakub Jelinek llvm-svn: 280657
* [asan] Move scariness_score_test.cc to a common subdirectoryFilipe Cabecinhas2016-09-022-183/+196
| | | | | | | | | | | | | | | 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
* Un-XFAIL cfi/stats.cpp, it passes since fixing llvm-symbolizer to look for ↵Reid Kleckner2016-09-011-4/+0
| | | | | | dwarf again llvm-svn: 280422
* [CMake] Add option (defaulted off) to exclude atomic.cChris Bieneman2016-09-011-1/+5
| | | | | | The atomic builtin source is problematic when cross-compiling builtins because it requires a variable and sometimes large set of system headers. This option allows users to optionally prevent it from being built. llvm-svn: 280416
* [tsan] Bump stack frame size limit.Evgeniy Stepanov2016-09-011-1/+1
| | | | llvm-svn: 280411
* Revert "Copy over most of the scariness_score test to the general tests"Filipe Cabecinhas2016-09-011-191/+0
| | | | | | This reverts commit r280361 until we have the proper change in place. llvm-svn: 280398
* [CMake] Adding compiler-rt-test-depends targetChris Bieneman2016-09-011-0/+1
| | | | | | This exposes a target for building the compiler-rt test dependencies and matches llvm-test-depends. llvm-svn: 280393
* Fix dll_host.cc test after adding div and gep trace coverage pointsReid Kleckner2016-09-011-0/+3
| | | | llvm-svn: 280387
* build: profile is not a sanitizerSaleem Abdulrasool2016-09-011-1/+1
| | | | | | | There was an invalid entry in the sanitizer list, remove it. This has no effect on the building, just removes the definition of a cached variable. llvm-svn: 280378
* Try to fix another profile testRenato Golin2016-09-011-1/+1
| | | | | | | 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
* Remove extra scariness.Clear() call.Filipe Cabecinhas2016-09-011-1/+0
| | | | llvm-svn: 280372
* Fix profile test assuming dumb compilerRenato Golin2016-09-011-1/+1
| | | | | | | | | 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
OpenPOWER on IntegriCloud