summaryrefslogtreecommitdiff
path: root/lib/asan/asan_debugging.cc
AgeCommit message (Collapse)Author
2016-09-09[asan] Add a new AddressDescription structure, which can describe any type ↵Filipe Cabecinhas
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281090 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18Convert AsanLocateAddress to Get*AddressInformation functions.Filipe Cabecinhas
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Split DescribeAddressIfGlobal between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This deals with global variable addresses. (This commit is written on top of D23605, but can be applied by itself) Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23607 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278959 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-15Split DescribeAddressIfShadow between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This is the first patch to start reifying information about errors. It deals only with reifying shadow address-related information. It will allow us to generate structures with all the relevant information for a given error so a debugger can get to them or they can be included in a core dump. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23519 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278718 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-01[compiler-rt] Apply modernize-use-nullptr fixes in sanitizersVedant Kumar
- Trim spaces. - Use nullptr in place of 0 for pointer variables. - Use '!p' in place of 'p == 0' for null pointer checks. - Add blank lines to separate function definitions. - Add 'extern "C"' or 'namespace foo' comments after the appropriate closing brackets This is a continuation of work from 409b7b82. The focus here is on the various sanitizers (not sanitizer_common, as before). Patch by Eugene Zelenko! Differential Revision: http://reviews.llvm.org/D13225 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248966 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-22[msan] Better use-after-free reports.Evgeniy Stepanov
By attaching an extra integer tag to heap origins, we are able to distinguish between uninits - created by heap allocation, - created by heap deallocation (i.e. use-after-free), - created by __msan_allocated_memory call, - etc. See https://code.google.com/p/memory-sanitizer/issues/detail?id=35. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-26[Sanitizer] Make StackTrace a lightweight reference to array of PCs, andAlexey Samsonov
introduce a BufferedStackTrace class, which owns this array. Summary: This change splits __sanitizer::StackTrace class into a lightweight __sanitizer::StackTrace, which doesn't own array of PCs, and BufferedStackTrace, which owns it. This would allow us to simplify the interface of StackDepot, and eventually merge __sanitizer::StackTrace with __tsan::StackTrace. Test Plan: regression test suite. Reviewers: kcc, dvyukov Reviewed By: dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5985 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220635 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-01[ASan] Make stack-buffer-overflow reports more robustAlexey Samsonov
Summary: Fix the function that gets stack frame description by address in thread stack, so that it clearly indicates failures. Make this error non-fatal, and print as much information as we can in this case. Make all errors in ParseFrameDescription non-fatal. Test Plan: check-asan testsuite Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5554 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218819 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26[compiler-rt] recommit of r218481: ASan debugging API for report info ↵Kuba Brecka
extraction and locating addresses Reviewed at http://reviews.llvm.org/D4527 Fixed a test case failure on 32-bit Linux, I did right shift on intptr_t, instead it should have been uintptr_t. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-26[compiler-rt] revert r218481 due to test failure on sanitizer-x86_64-linux Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218501 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-25[compiler-rt] ASan debugging API for report info extraction and locating ↵Kuba Brecka
addresses Reviewed at http://reviews.llvm.org/D4527 This patch is part of an effort to implement a more generic debugging API, as proposed in http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-July/074656.html, with first part reviewed at http://reviews.llvm.org/D4466. Now adding several new APIs: __asan_report_present, __asan_get_report_{pc,bp,sp,address,type,size,description}, __asan_locate_address. These return whether an asan report happened yet, the PC, BP, SP, address, access type (read/write), access size and bug description (e.g. "heap-use-after-free"), __asan_locate_address takes a pointer and tries to locate it, i.e. say whether it is a heap pointer, a global or a stack, or whether it's a pointer into the shadow memory. If global or stack, tries to also return the variable name, address and size. If heap, tries to return the chunk address and size. Generally these should serve as an alternative to "asan_describe_address", which only returns all the data in text form. Having an API to get these data could allow having debugging scripts/extensions that could show additional information about a variable/expression/pointer. Test cases in test/asan/TestCases/debug_locate.cc and test/asan/TestCasea/debug_report.cc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218481 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-15[ASan] Add ASan debugging API to get malloc/free stack traces and shadow ↵Kuba Brecka
memory mapping info Reviewed at http://reviews.llvm.org/D4466 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213080 91177308-0d34-0410-b5e6-96231b3b80d8