summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/asan_thread.cc
Commit message (Collapse)AuthorAgeFilesLines
...
* [asan] fix one more async-signal-safety issue with use-after-returnKostya Serebryany2013-09-191-3/+3
| | | | llvm-svn: 191004
* [asan] add a run-time option detect_stack_use_after_return, add verbosity ↵Kostya Serebryany2013-09-181-1/+7
| | | | | | output for fake stack llvm-svn: 190932
* [asan] second attempt to use TLS with fake stack. This time it looks (more) ↵Kostya Serebryany2013-09-131-3/+5
| | | | | | async-signal safe. llvm-svn: 190663
* [asan] (part 2) don't lazy-init fake_stack if we only need to check that ↵Kostya Serebryany2013-09-121-1/+1
| | | | | | fake_stack exists (should fix 32-bit builds) llvm-svn: 190594
* [asan] don't lazy-init fake_stack if we only need to check that fake_stack ↵Kostya Serebryany2013-09-121-1/+1
| | | | | | exists (should fix 32-bit builds) llvm-svn: 190593
* [asan] hopefully make the FakeStack async-signal safe, enable the related testKostya Serebryany2013-09-121-0/+21
| | | | llvm-svn: 190592
* Improve collecting malloc stats in ASanAlexey Samsonov2013-09-021-1/+1
| | | | | | | | | | | | | | | | Summary: This change makes races between updates of thread-local stats and merging all the thread-local stats together less harmful. Reviewers: kcc Reviewed By: kcc CC: dvyukov, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1572 llvm-svn: 189744
* [lsan] Handle fork() correctly.Sergey Matveev2013-07-081-1/+13
| | | | | | | | Update the main thread's os_id on every pthread_create, and before initiating leak checking. This ensures that we have the correct os_id even if we have forked after Init(). llvm-svn: 185815
* [asan] initialize fake_stack lazily and increase its maximal size. This ↵Kostya Serebryany2013-06-261-7/+9
| | | | | | makes -fsanitize=address,use-after-return more robust: all SPEC tests pass now. In the default mode thread stacks become a bit smaller. llvm-svn: 184934
* [asan] Move lsan_disabled out of thread context.Sergey Matveev2013-06-211-1/+0
| | | | | | Fix for the case where disabler is used in pthread key destructor. llvm-svn: 184553
* Fix ALIGNED misuse in asan_thread.cc (built on all platforms); also, add a ↵Timur Iskhodzhanov2013-06-041-1/+1
| | | | | | comment to the ALIGNED macro describing the correct usage llvm-svn: 183214
* [asan] ASan Linux MIPS32 support (compiler-rt part), patch by Jyun-Yan YKostya Serebryany2013-06-031-1/+2
| | | | llvm-svn: 183105
* [lsan] Add __lsan_disable() and __lsan_enable().Sergey Matveev2013-06-031-0/+1
| | | | | | | Objects allocated after a call to __lsan_disable() will be treated as live memory. Also add a ScopedDisabler. llvm-svn: 183099
* [asan] Make ASan report the correct thread address ranges to LSan.Sergey Matveev2013-05-291-8/+26
| | | | | | This CL enables thread support in LSan when used on top of ASan. llvm-svn: 182854
* [asan] LSan hooks in asan_thread.ccSergey Matveev2013-05-211-1/+19
| | | | llvm-svn: 182378
* [sanitizer] found a bug by code inspection: CHECK(a=b) instead of ↵Kostya Serebryany2013-04-051-1/+1
| | | | | | CHECK(a==b). Was puzzled why lint did not catch it. Turns out this check was disabled for asan source. fix all cases and enable the check llvm-svn: 178872
* [ASan] Speed-up initialization-order checking: create and use fast versions ↵Alexey Samsonov2013-03-281-0/+1
| | | | | | of PoisonShadow functions, store copies of __asan_global descriptors in a vector instead of list of pointers. This gives 3x speedup on both benchmarks and real binaries with lots of globals. llvm-svn: 178239
* [asan] Change the way we report the alloca frame on stack-buff-overflow.Kostya Serebryany2013-03-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: the function name was stored by the compiler as a constant string and the run-time was printing it. Now: the PC is stored instead and the run-time prints the full symbolized frame. This adds a couple of instructions into every function with non-empty stack frame, but also reduces the binary size because we store less strings (I saw 2% size reduction). This change bumps the asan ABI version to v3. compiler-rt part, llvm part will follow. Example of report (now): ==31711==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffa77cf1c5 at pc 0x41feb0 bp 0x7fffa77cefb0 sp 0x7fffa77cefa8 READ of size 1 at 0x7fffa77cf1c5 thread T0 #0 0x41feaf in Frame0(int, char*, char*, char*) stack-oob-frames.cc:20 #1 0x41f7ff in Frame1(int, char*, char*) stack-oob-frames.cc:24 #2 0x41f477 in Frame2(int, char*) stack-oob-frames.cc:28 #3 0x41f194 in Frame3(int) stack-oob-frames.cc:32 #4 0x41eee0 in main stack-oob-frames.cc:38 #5 0x7f0c5566f76c (/lib/x86_64-linux-gnu/libc.so.6+0x2176c) #6 0x41eb1c (/usr/local/google/kcc/llvm_cmake/a.out+0x41eb1c) Address 0x7fffa77cf1c5 is located in stack of thread T0 at offset 293 in frame #0 0x41f87f in Frame0(int, char*, char*, char*) stack-oob-frames.cc:12 <<<<<<<<<<<<<< this is new This frame has 6 object(s): [32, 36) 'frame.addr' [96, 104) 'a.addr' [160, 168) 'b.addr' [224, 232) 'c.addr' [288, 292) 's' [352, 360) 'd' llvm-svn: 177723
* asan: fix lint warning about line lengthDmitry Vyukov2013-03-221-2/+2
| | | | llvm-svn: 177709
* [ASan] Switch ASan to generic ThreadRegistry from sanitizer_common. Delete ↵Alexey Samsonov2013-03-211-46/+96
| | | | | | ASan-specific AsanThreadRegistry. llvm-svn: 177634
* [ASan] Move GetCurrentThread/SetCurrentThread from AsanThreadRegistry class ↵Alexey Samsonov2013-03-201-0/+38
| | | | | | into plain functions: they don't actually use registry llvm-svn: 177501
* [asan] fix two off-by-one errors that seem to affect only PowerPC because ↵Kostya Serebryany2013-01-181-1/+1
| | | | | | only there the stack top may be equal to the address space top. Noted by Andreas Schwab in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55975#c11 . Also make swapcontext interceptor a bit more robust llvm-svn: 172807
* [asan] get rid of some of the uses of kPageSize. The intent is to get rid of ↵Kostya Serebryany2012-11-231-4/+5
| | | | | | it completely to support platforms with multiple possible page sizes. llvm-svn: 168517
* [asan/tsan] do not use __WORDSIZE macro, as it is glibc-private thing. ↵Kostya Serebryany2012-11-211-1/+1
| | | | | | Instead, define our own SANITIZER_WORDSIZE llvm-svn: 168424
* [ASan] Revert r168040 and r168043 and take a cleaner solution suggested by ↵Alexander Potapenko2012-11-151-13/+7
| | | | | | Kostya: return the known frame name for fake stack instead of looking it up. llvm-svn: 168046
* [ASan] Minor fix: return to the last byte of the fake stack if we've raced by.Alexander Potapenko2012-11-151-2/+5
| | | | llvm-svn: 168043
* [ASan] Poison the leftmost shadow byte with a special value so that we can findAlexander Potapenko2012-11-151-2/+4
| | | | | | | the beginning of the fake frame when reporting an use-after-return error. Fixes http://code.google.com/p/address-sanitizer/issues/detail?id=126 llvm-svn: 168040
* [asan] increase max stack size to 256 (+test)Kostya Serebryany2012-09-061-10/+3
| | | | llvm-svn: 163308
* [asan] some renaming before we move StackTrace into sanitizer_commonKostya Serebryany2012-08-281-1/+1
| | | | llvm-svn: 162747
* [Sanitizer] Use low-level allocator in flag parsing to avoid calling ↵Alexey Samsonov2012-08-271-1/+1
| | | | | | malloc() before ASan/TSan initialization is done llvm-svn: 162673
* Intercept CFAllocator for each thread in the program.Alexander Potapenko2012-07-231-0/+1
| | | | | | | Test that child threads use the ASan allocator, that allocated memory can be passed to another thread and deallocated on it. This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=81 llvm-svn: 160630
* [asan] get rid of the last operator new call in asan rtlKostya Serebryany2012-07-171-1/+12
| | | | llvm-svn: 160347
* [ASan] Use common flags parsing machinery.Alexey Samsonov2012-07-091-5/+5
| | | | llvm-svn: 159933
* [ASan] don't include deleted headerAlexey Samsonov2012-06-141-1/+0
| | | | llvm-svn: 158448
* [Sanitizer] factor out GetThreadStackTopAndBottom from ASan runtime to common.Alexey Samsonov2012-06-071-0/+7
| | | | llvm-svn: 158140
* [Sanitizer] Switch to common mmap/munmap routines in ASan run-time.Alexey Samsonov2012-06-061-2/+2
| | | | llvm-svn: 158078
* [asan] make tid u32 instead of intKostya Serebryany2012-06-061-1/+1
| | | | llvm-svn: 158074
* [ASan] Make printf arguments match format strings better.Alexey Samsonov2012-06-061-1/+1
| | | | llvm-svn: 158059
* Remove file-type tags for .cc files in ASan run-time libraryAlexey Samsonov2012-06-041-1/+1
| | | | llvm-svn: 157927
* [asan] more renamingKostya Serebryany2012-05-311-2/+2
| | | | llvm-svn: 157747
* [asan] more renamingKostya Serebryany2012-05-311-9/+9
| | | | llvm-svn: 157746
* Fix GetFrameNameByAddr hitting stale stack guards.Evgeniy Stepanov2012-05-121-10/+22
| | | | | | | | | | | | | | | | | In the current implementation AsanThread::GetFrameNameByAddr scans the stack for a magic guard value to locate base address of the stack frame. This is not reliable, especially on ARM, where the code that stores this magic value has to construct it in a register from two small intermediates; this register can then end up stored in a random stack location in the prologue of another function. With this change, GetFrameNameByAddr scans the shadow memory for the signature of a left stack redzone instead. It is now possible to remove the magic from the instrumentation pass for additional performance gain. We keep it there for now just to make sure the new algorithm does not fail in some corner case. llvm-svn: 156710
* Introduce the use_sigaltstack flag (off by default), which enables using ↵Alexander Potapenko2012-04-051-0/+2
| | | | | | | | | alternate per-thread stacks for signal handling. This allows to print more verbose error reports for stack overflows. llvm-svn: 154092
* [asan] Support for %z to Printf()Evgeniy Stepanov2012-03-211-1/+1
| | | | | | | | | | | | At the moment, asan internal Printf() uses %l modifier for printing values of size_t and related types. This works, because we control both the implementation of Printf and all its uses, but can be a little misleading. This change adds support for %z to Printf(). All callers that print sizes and pointers as integers are switched to %zu / %zx. llvm-svn: 153177
* [ASan] Intercept CreateThread on WindowsTimur Iskhodzhanov2012-02-241-3/+3
| | | | llvm-svn: 151366
* [asan] make sure the AsanThread object is destroyed if pthread_exit is calledKostya Serebryany2012-02-071-5/+16
| | | | llvm-svn: 149940
* AddressSanitizer: create AsanThreadSummary together with AsanThread (in ↵Alexey Samsonov2012-01-171-16/+20
| | | | | | parent thread) llvm-svn: 148286
* Test commit. Minor cleanup in AsanThreadAlexey Samsonov2012-01-111-3/+1
| | | | llvm-svn: 147930
* [asan] get rid of the scary TSD destructor code. Now, we store the leaky ↵Kostya Serebryany2012-01-111-0/+4
| | | | | | AsanThreadSummary in TSD and never remove it from there. llvm-svn: 147910
* [asan] refactoring: move some common linux/mac code to asan_posix.ccKostya Serebryany2012-01-091-6/+2
| | | | llvm-svn: 147788
OpenPOWER on IntegriCloud