summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test
Commit message (Collapse)AuthorAgeFilesLines
* [esan|wset] Reduce flakiness in samples testDerek Bruening2016-06-081-5/+5
| | | | | | | Generalizes the workingset-samples test to pass when a sample has a size of 0, which can happen on a loaded machine. llvm-svn: 272175
* [scudo] trying to fix the bot: aligned_alloc is not known there; attempt 3Kostya Serebryany2016-06-071-1/+1
| | | | llvm-svn: 272074
* [scudo] trying to fix the bot: aligned_alloc is not known there; attempt 2Kostya Serebryany2016-06-071-2/+3
| | | | llvm-svn: 272051
* [scudo] trying to fix the bot: aligned_alloc is not known thereKostya Serebryany2016-06-071-0/+2
| | | | llvm-svn: 272037
* [asan] make print_memory_profile_test more reliable by using large ↵Kostya Serebryany2016-06-071-6/+6
| | | | | | allocation sizes. Hoping to fix the llvm-clang-lld-x86_64-debian-fast bot llvm-svn: 272020
* [sanitizer] Initial implementation of a Hardened AllocatorKostya Serebryany2016-06-0715-0/+550
| | | | | | | | | | | | | | | | | | | | Summary: This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator. It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast. The following were implemented: - additional consistency checks on the allocation function parameters and on the heap chunks; - use of checksum protected chunk header, to detect corruption; - randomness to the allocator base; - delayed freelist (quarantine), to mitigate use after free and overall determinism. Additional mitigations are in the works. Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc Subscribers: kubabrecka, filcab, llvm-commits Differential Revision: http://reviews.llvm.org/D20084 llvm-svn: 271968
* add -f to rm so the test passes the first time it's run the file file is not ↵David Blaikie2016-06-061-1/+1
| | | | | | | | present (otherwise it just keeps failing at the rm step and never passes... ) llvm-svn: 271959
* [libprofile] Also use `env` for this test.Sean Silva2016-06-061-2/+2
| | | | | | (necessary on Windows) llvm-svn: 271955
* [libprofile] Add %run to a couple tests.Sean Silva2016-06-061-2/+2
| | | | llvm-svn: 271947
* [profile] code cleanup /NFCXinliang David Li2016-06-062-13/+14
| | | | | | | Address review feedback for better readability. llvm-svn: 271922
* [asan] Reenable ASan tests in "check-all"Kuba Brecka2016-06-061-2/+2
| | | | | | | | Somehow, in r271049, ASan lit tests and unit tests were removed from “check-all”. Doesn’t seem intentional, let’s fix it. Differential Revision: http://reviews.llvm.org/D21017 llvm-svn: 271905
* [profile] in-process mergeing support (part-2)Xinliang David Li2016-06-062-0/+75
| | | | | | | | | | | (Part-1 merging API is in profile runtime) This patch implements a portable file opening API with exclusive access for the process. In-process profile merge requires profile file update to be atomic/fully sychronized. llvm-svn: 271864
* It really helps to not randomly delete one of the closing brackets. =/Chandler Carruth2016-06-041-1/+1
| | | | llvm-svn: 271787
* Ok, now I know why I kept getting confused and not making progressChandler Carruth2016-06-041-2/+8
| | | | | | | | | | | fixing tis test. There are different configurations running, and they have subtly different backtraces. I didn't notice that the configs changed and so I kept occilating between the two. Now I've looked at two different configs at the same time, and so this should be much more likely to work. llvm-svn: 271786
* Fix the test for printing the memory profile. This fuctionality is onlyChandler Carruth2016-06-041-1/+5
| | | | | | | | | | | available along side the leak checking, so use the REQUIRES for that. Also, use %run as other tests do when launching the built binary. This fixes check-asan for me on Linux and looks like it should fix the linux sanitizer bots as well. llvm-svn: 271785
* Update this test yet again, this time based on a nice consecutive pairChandler Carruth2016-06-041-3/+2
| | | | | | | | of lines provided with the filecheck output from the previous run. I'll probably give up after this and get someone with a Windows build to help me out. llvm-svn: 271784
* I didn't actually get this right, but now I have frame #0 and frame #2.Chandler Carruth2016-06-041-2/+3
| | | | | | This should fail on frame #1 and show what that should actually be. llvm-svn: 271783
* Amazingly, my guess was correct for the top two frames here. HopefullyChandler Carruth2016-06-041-8/+0
| | | | | | with this, the Windows sanitizer bot will go green! llvm-svn: 271782
* Temporary hack to this test to try and get the sanitizer-windows bot toChandler Carruth2016-06-041-2/+10
| | | | | | show enough information for me to fix the patterns used here. llvm-svn: 271779
* reapply r271577 after OSX bug is fixed (hopefully)Xinliang David Li2016-06-041-1/+1
| | | | llvm-svn: 271759
* [esan|cfrag] Compute the struct field access difference ratioQin Zhao2016-06-032-2/+32
| | | | | | | | | | | | | | | | | | Summary: Computes the struct field access variation based on each field access count. Adds a flag to control the report thresholds. Updates struct-simple.cpp with variance report output. Reviewers: aizatsky Subscribers: kubabrecka, zhaoqin, llvm-commits, eugenis, vitalybuka, kcc, bruening Differential Revision: http://reviews.llvm.org/D20914 llvm-svn: 271734
* [esan] Eliminate flakiness in large-stack testDerek Bruening2016-06-031-1/+1
| | | | | | | Turns off sampling for the large-stack test to remove nondeterminism in the output and fix bot failures. llvm-svn: 271691
* [esan|wset] Add 8-level working set snapshot accumulationDerek Bruening2016-06-031-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds a new option -snapshot_step controlling the frequency distribution for an 8-level series of samples using each bit of each shadow byte. Implements accumulation from each level to the next higher level at the specified frequency. Adds storage of the 8 series of samples using CircularBuffer instances. Fixes an error in the circular buffer data structure where a static object's destructor will be called too early. Prints the results out at the end in a simple manner to give us something to start with. Updates the workingset-samples test to test the new feature. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20833 llvm-svn: 271683
* [esan] Add sideline itimer supportDerek Bruening2016-06-033-1/+28
| | | | | | | | | | | | | | | | | | | | | Summary: Adds support for creating a separate thread for performing "sideline" actions on a periodic basis via an itimer. A new class SidelineThread implements this feature, exposing a sampling callback to the caller. Adds initial usage of sideline sampling to the working set tool. For now it simply prints the usage at each snapshot at verbosity level 1. Adds a test of this behavior. Adds a new option -record_snapshots to control whether we sample and a new option -sample_freq to control the periodicity of the sampling. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20751 llvm-svn: 271682
* tsan: rely on AnnotateRWLockCreateStatic to detect linker-initialized mutexesDmitry Vyukov2016-06-032-0/+74
| | | | | | | | | The new annotation was added a while ago, but was not actually used. Use the annotation to detect linker-initialized mutexes instead of the broken IsGlobalVar which has both false positives and false negatives. Remove IsGlobalVar mess. llvm-svn: 271663
* Revert "[profile] enable a subtest for vcall inline virtual func"Mehdi Amini2016-06-031-1/+1
| | | | | | | | This reverts commit r271577. The test does not pass on OSX. llvm-svn: 271617
* [esan] Add support for log_exe_nameDerek Bruening2016-06-021-2/+2
| | | | | | | | | | | | | | | Summary: Adds the call needed to cache the binary name to support the sanitizer option log_exe_name for usable log file results when running multiple applications. Adds a test. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20747 llvm-svn: 271586
* [profile] enable a subtest for vcall inline virtual funcXinliang David Li2016-06-021-1/+1
| | | | llvm-svn: 271577
* tsan: clean up dynamic TLS memory between reuseDmitry Vyukov2016-06-021-0/+62
| | | | | | | | | | | | | Currently the added test produces false race reports with glibc 2.19, because DLTS memory is reused by pthread under the hood. Use the DTLS machinery to intercept new DTLS ranges. __tls_get_addr known to cause issues for tsan in the past, so write the interceptor more carefully. Reviewed in http://reviews.llvm.org/D20927 llvm-svn: 271568
* [esan|cfrag] Add struct info registrationQin Zhao2016-06-021-10/+125
| | | | | | | | | | | | | | | | | | | | | Summary: Adds StructInfo to CacheFragInfo to match the LLVM's EfficiencySanitizer structs. Uses StructHashMap to keep track of the struct info used by the app. Adds registerStructInfo/unregisterStructInfo to add/remove struct infos to/from StructHashMap. updates test struct-simple.cpp with more C structs. Reviewers: aizatsky, filcab Subscribers: filcab, zhaoqin, llvm-commits, eugenis, vitalybuka, kcc, bruening, kubabrecka Differential Revision: http://reviews.llvm.org/D20590 llvm-svn: 271564
* UBSan: crash less often on corrupted Vtables.Ivan Krasin2016-06-021-0/+41
| | | | | | | | | | | | | | | | | Summary: This CL adds a weak check for a Vtable prefix: for a well-formed Vtable, we require the prefix to be within [-1<<20; 1<<20]. Practically, this solves most of the known cases when UBSan segfaults without providing any useful diagnostics. Reviewers: pcc Subscribers: kubabrecka Differential Revision: http://reviews.llvm.org/D19750 llvm-svn: 271560
* [profile] Add end-end test of vp for inline virtual functionsXinliang David Li2016-06-024-0/+43
| | | | | | | | | Make sure inline virtual function's address is properly recorded and dumped in raw profile so that value profiling does not loss tracking. (Second part of the test will be enabled after the lowering bug is fixed in LLVM) llvm-svn: 271528
* [asan] add an interface function __sanitizer_print_memory_profile (a basic ↵Kostya Serebryany2016-06-021-0/+25
| | | | | | memory profiler; asan/Linux-only for now) llvm-svn: 271463
* [esan|cfrag] Add the skeleton to handle the cfrag argumentQin Zhao2016-05-311-4/+4
| | | | | | | | | | | | | | | | Summary: Adds the struct declaration for the cache-fragmentation tool variable passed to the runtime library. Updates test struct-simple.cpp. Reviewers: aizatsky, bruening Subscribers: filcab, kubabrecka, bruening, kcc, vitalybuka, eugenis, llvm-commits, zhaoqin Differential Revision: http://reviews.llvm.org/D20542 llvm-svn: 271337
* Fix test for Darwin: ASAN is calling abort by default on Darwin, which not ↵Mehdi Amini2016-05-311-5/+5
| | | | | | detects as a crash llvm-svn: 271323
* [esan] Add circular buffer data structureDerek Bruening2016-05-312-0/+67
| | | | | | | | | | | | | | | | | | | Summary: Adds a new class, CircularBuffer, for holding a wrap-around fixed-size sequence of a primitive data type. This will be used initially by the working set tool. Adds a unit test for CircularBuffer, including infrastructure support to include esan headers and to link with the esan library by pretending to want the working set tool. Reviewers: aizatsky, filcab Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20579 llvm-svn: 271286
* [esan|wset] Iterate all memory to compute the total working setDerek Bruening2016-05-313-2/+32
| | | | | | | | | | | | | | | | | | | | | Summary: Adds iteration of all application memory in an efficient manner using shadow faults. Shadow memory starts out inaccessible and we mark it writable one page at a time on each fault when the instrumentation touches it. This allows iteration over just the mapped shadow memory, saving significant time. Adds a process-end iteration and pretty-printing of the final result. Adds a new test and updates the existing tests. Reviewers: aizatsky, filcab Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20578 llvm-svn: 271277
* [esan] Intercept and chain signal handlersDerek Bruening2016-05-311-0/+59
| | | | | | | | | | | | | | | | | | Summary: In preparation for fault-based shadow memory iteration, we add support for our own signal handler by adding app signal handler interception as well as chaining for SIGSEGV. This is done in a simple manner: we do not honor the app's alternate stack nor any sigaction flags for SIGSEGV. Adds a new test of transparency in app signal handling. Reviewers: aizatsky Subscribers: filcab, kubabrecka, vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20577 llvm-svn: 271272
* Move test only for the relevant platformXinliang David Li2016-05-282-4/+8
| | | | llvm-svn: 271098
* [sanitizers] introduce a common run-time option dedup_token_length to help ↵Kostya Serebryany2016-05-281-0/+40
| | | | | | with report deduplication, off by default for now. See https://github.com/google/sanitizers/issues/684 llvm-svn: 271085
* [esan] Add handling of large stack size rlimitsDerek Bruening2016-05-284-5/+82
| | | | | | | | | | | | | | | | | | | | | Summary: Adds detection of large stack size rlimits (over 1 TB or unlimited), which results in an mmap location that our shadow mapping does not support. We re-exec the application in this situation. Adds a test of this behavior. Adds general detection of mmap regions outside of our app regions. In the future we want to try to adaptively handle these but for now we abort. Moves the existing Linux-specific mmap code into a platform-specific file where the new rlimit code lives. Reviewers: eugenis Subscribers: vitalybuka, zhaoqin, kcc, aizatsky, llvm-commits, kubabrecka Differential Revision: http://reviews.llvm.org/D20745 llvm-svn: 271079
* This patch is activating the build of Asan on Windows 64-bits.Etienne Bergeron2016-05-272-1/+17
| | | | | | | | | | | | | | | | | | It's fixing compilation errors. The runtime is not yet working. Missing features: OverrideFunction for x64 an equiv function for inline asm (atomic_compare_exchange_strong) shadow memory offset needs to be adjusted RoundUpToInstrBoundary for x64 They will be implemented by subsequent patches. Patch by Wei Wang. Differential revision: http://reviews.llvm.org/D20455 llvm-svn: 271049
* [sanitizers] introduce __sanitizer_set_report_fd so that we can re-route the ↵Kostya Serebryany2016-05-271-0/+37
| | | | | | sanitizer logging to another fd from inside the process llvm-svn: 271046
* [profile] Add a test to ensure runtime allocator is not invokedXinliang David Li2016-05-272-0/+47
| | | | llvm-svn: 271017
* [esan] Fix workingset-memset test failureDerek Bruening2016-05-271-4/+3
| | | | | | | | Fixes an esan workingset-memset test failure by switching to malloc to avoid a shadow mapping issue with mmap in certain situations that will be fully fixed separately. llvm-svn: 270949
* Add missing test case changesXinliang David Li2016-05-262-2/+19
| | | | llvm-svn: 270930
* Init tsan with .preinit_array sectionVitaly Buka2016-05-261-0/+60
| | | | | | | | | | | | Summary: Some libraries, like OpenSSL, runs code from .init section. Reviewers: kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D20646 llvm-svn: 270873
* Fix columns for member function callsHal Finkel2016-05-253-5/+5
| | | | | | | After r270775, Clang is smarter about the generating the locations for member-function calls. Update some ubsan tests accordingly. llvm-svn: 270801
* [profile] Add early checking to bypass node pointer updateXinliang David Li2016-05-251-0/+5
| | | | llvm-svn: 270766
* [esan][cfrag] Add skeleton for cache fragmentation tool supportQin Zhao2016-05-251-5/+11
| | | | | | | | | | | | | | | Summary: Adds cache_frag.h and cache_frag.cpp for the cache fragmentation tool. Updates test struct-simple.cpp. Reviewers: aizatsky Subscribers: filcab, zhaoqin, llvm-commits, eugenis, vitalybuka, kcc, bruening, kubabrecka Differential Revision: http://reviews.llvm.org/D20538 llvm-svn: 270737
OpenPOWER on IntegriCloud