summaryrefslogtreecommitdiff
path: root/lib/asan/asan_stack.cc
AgeCommit message (Collapse)Author
2014-12-16[ASan] Allow to atomically modify malloc_context_size at runtime.Alexey Samsonov
Summary: Introduce __asan::malloc_context_size atomic that is used to determine required malloc/free stack trace size. It is initialized with common_flags()->malloc_context_size flag, but can later be overwritten at runtime (e.g. when ASan is activated / deactivated). Test Plan: regression test suite Reviewers: kcc, eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6645 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@224305 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19[ASan] Get rid of ASan-specific functions for printing stack tracesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197672 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19[ASan] Get rid of __asan_symbolize functionAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-18[Sanitizer] Implement Symbolizer class on WindowsTimur Iskhodzhanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04[ASan] Return interface attribute to __sanitizer_print_stack_traceAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196364 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03[asan] Fix build error.Sergey Matveev
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196303 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03[sanitizer] Expose __sanitizer_print_stack_trace().Sergey Matveev
Expose a new interface function for debugging code built with sanitizer tools. Add an ASan implementation. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196302 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-01Consistently use StackTrace::PrintStack in ASan, LSan and MSanAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-29[Sanitizer] Simplify StackTrace::PrintStack interface: prefer common flags ↵Alexey Samsonov
to turn on/off the symbolization git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-28asan/msan: separate different report blocks with new linesDmitry Vyukov
this makes the reports consistent with tsan, and much more readable. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@193520 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18[asan] fix stack trace printing on MacKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192990 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-18[asan] reduce the size of AsanThreadContext by storing the stack trace in ↵Kostya Serebryany
the stack depot git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04Refactor the usage of strip_path_prefix option and make it more consistent ↵Alexey Samsonov
across sanitizers git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191943 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13Define SANITIZER_INTERFACE_ATTRIBUTE on Windows and fix all the places where ↵Timur Iskhodzhanov
SANITIZER_INTERFACE_ATTRIBUTE or SANITIZER_ATTRIBUTE_WEAK are used git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@188261 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06[asan] Common flags in ASan.Sergey Matveev
Some flags that are common to ASan/MSan/TSan/LSan have been moved to sanitizer_common. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@181193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19[sanitizer] Replace more platform checks with SANITIZER_ constants.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@177400 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31[ASan] Split ASan interface header into private and public parts. Add a test ↵Alexey Samsonov
that makes sure users can include interface header git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-07ASan: change the strategy we use for installing malloc/free/symbolization ↵Alexey Samsonov
hooks on Linux: don't provide a default no-op implementations for hooks in runtime, and optionally call hooks if they are provided by the user. Don't force weak interface functions into runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169641 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-02[Sanitizer/ASan] Simplify the code that prints and symbolizes stack traces. ↵Alexey Samsonov
Fall back to module+offset if user-provided symbolizer failed. Use weak function __asan_symbolize instead of __asan_set_symbolize_callback in ASan interface, so that we're able to symbolize reports for errors that happen before the main() is called, for example, during module initialization. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@165000 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-29Relocate the external headers provided by ASan and the common sanitizerChandler Carruth
library. These headers are intended to be available to user code when built with AddressSanitizer (or one of the other sanitizer's in the future) to interface with the runtime library. As such, they form stable external C interfaces, and the headers shouldn't be located within the implementation. I've pulled them out into what seem like fairly obvious locations and names, but I'm wide open to further bikeshedding of these names and locations. I've updated the code and the build system to cope with the new locations, both CMake and Makefile. Please let me know if this breaks anyone's build. The eventual goal is to install these headers along side the Clang builtin headers when we build the ASan runtime and install it. My current thinking is to locate them at: <prefix>/lib/clang/X.Y/include/sanitizer/common_interface_defs.h <prefix>/lib/clang/X.Y/include/sanitizer/asan_interface.h <prefix>/lib/clang/X.Y/include/sanitizer/... But maybe others have different suggestions? Fixing the style of the #include between these headers at least unblocks experimentation with installing them as they now should work when installed in these locations. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162822 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] actually move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162757 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] even more refactoring to move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162754 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] more refactoring to move StackTrace to sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] some renaming before we move StackTrace into sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[asan] get rid of AsanPrintf in favor of Printf from sanitizer_commonKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27[Sanitizer] Rename ProcessMaps to MemoryMappingLayout and fix Windows build ↵Alexey Samsonov
by providing stub implementation git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162671 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22[ASan] get rid of ASAN_USE_EXTERNAL_SYMBOLIZER compiler def in favor of ↵Alexey Samsonov
__asan_set_symbolize_callback interface function. Now the user doesn't have to recompile ASan runtime to provide its own symbolizer git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162358 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Patch the frame address regardless of the frame number.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Use SANITIZER_INTERFACE_ATTRIBUTE instead of ↵Alexander Potapenko
__attribute__((visibility("default"))) Export CheckFailed, asan_malloc, asan_free, asan_memalign, AsanStackTrace::CompressStack, AsanStackTrace::UncompressStack from the dynamic runtime library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-06[ASan] add new ASan option 'strip_path_prefix' to remove useless prefices ↵Alexey Samsonov
from filenames in stack traces git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161321 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-19[ASan] subtract one from PCs in ASan error reports (as they originally ↵Alexey Samsonov
contain return addresses). Make output tests stricter. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@160508 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-09[ASan] Use common flags parsing machinery.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159933 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-04[ASan] Minor fix in symbolizer output.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159709 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-03[Sanitizer] Extend a symbolizer code. Implemented for Linux only. Use ↵Alexey Samsonov
dl_iterate_phdr to get virtual addresses of mapped module sections. To symbolize an address from a module, map this module to memory and obtain pointers to debug info sections. Later these pointers can be passed to constructor of DWARF context-in-memory from LLVM DebugInfo lib. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159652 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-15[Sanitizer] Use ProcessMaps in symbolizer to get module name and offset for ↵Alexey Samsonov
instruction address git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158522 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-14[ASan] don't include deleted headerAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158448 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-07[Sanitizer] __asan::AsanProcMaps -> __sanitizer::ProcessMaps.Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158139 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-06[Sanitizer]: Introduce a common internal printf function. For now, also use ↵Alexey Samsonov
tool-specific wrappers TsanPrintf (its output is controlled by TSan flags) and AsanPrintf (which copies its results to the ASan-private buffer). Supported formats: %[z]{d,u,x}, %s, %p. Re-write all format strings in TSan according to this format (this should have no effect on 64-bit platforms). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-05[Sanitizer] remove using namespace __sanitizer linesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157999 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04Remove file-type tags for .cc files in ASan run-time libraryAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157927 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-04[ASan] Use ASan option symbolize to turn on internal symbolizer (in development)Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157924 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157747 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-31[asan] more renamingKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@157746 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-21[asan] Support for %z to Printf()Evgeniy Stepanov
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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@153177 91177308-0d34-0410-b5e6-96231b3b80d8
2012-03-08[asan]: fix off-by-one error in stack unwinder (asan issue #44; reproduced ↵Kostya Serebryany
thanks to 'csmith' fuzzer) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@152347 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-08AddressSanitizer: replace all "real_X" calls with "REAL(X)"Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@150073 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-19EHABI-based stack trace on ARM.Evgeniy Stepanov
The change removes the unused FLAG_fast_unwind, and forces EHABI-based unwind on ARM, and fast (FP-based) unwind everywhere else. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@148468 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-18Delete sysinfo/* and all references to it.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@148386 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-09[asan] fix mac build once moreKostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@147796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-01-05[asan] use dl_iterate_phdr for pre-symbolization on linux instead of parsing ↵Kostya Serebryany
/proc/self/maps git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@147628 91177308-0d34-0410-b5e6-96231b3b80d8