summaryrefslogtreecommitdiff
path: root/lib/asan/asan_report.cc
AgeCommit message (Collapse)Author
2017-12-04[ASan] Enhance libsanitizer support for invalid-pointer-pair.Alex Shlyapnikov
Following patch adds support of all memory origins in CheckForInvalidPointerPair function. For small difference of pointers, it's directly done in shadow memory (the limit was set to 2048B). Then we search for origin of first pointer and verify that the second one has the same origin. If so, we verify that it points either to a same variable (in case of stack memory or a global variable), or to a same heap segment. Committing on behanf of marxin and jakubjelinek. Reviewers: alekseyshl, kcc Subscribers: llvm-commits Differential revision: https://reviews.llvm.org/D40600 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@319668 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-25[Sanitizers] ASan: detect new/delete calls with mismatched alignment.Alex Shlyapnikov
ASan allocator stores the requested alignment for new and new[] calls and on delete and delete[] verifies that alignments do match. The representable alignments are: default alignment, 8, 16, 32, 64, 128, 256 and 512 bytes. Alignments > 512 are stored as 512, hence two different alignments > 512 will pass the check (possibly masking the bug), but limited memory requirements deemed to be a resonable tradeoff for relaxed conditions. The feature is controlled by new_delete_type_mismatch flag, the same one protecting new/delete matching size check. Differential revision: https://reviews.llvm.org/D38574 Issue: https://github.com/google/sanitizers/issues/799 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@316595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[sanitizer] Replace thread id with GetThreadSelfVitaly Buka
This allows to avoid constructor parameter git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314040 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[sanitizer] Move report locking code from asan into commonVitaly Buka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314008 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-22[asan] Fix unlocking order for CommonSanitizerReportMutex and ↵Vitaly Buka
reporting_thread_tid_ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@314007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-20[asan] Fix nested error detectionVitaly Buka
Summary: Fixes https://github.com/google/sanitizers/issues/858 Reviewers: eugenis, dvyukov Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D38019 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313835 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-14[asan] Remove ErrorStackOverflowVitaly Buka
Summary: The only difference from ErrorDeadlySignal is reporting code and it lives in sanitizer common. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl, filcab Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D37868 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313309 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13[compiler-rt] Add siginfo into SignalContextVitaly Buka
Summary: Information stored there is often been passed along with SignalContext. Part of https://github.com/google/sanitizers/issues/637 Reviewers: eugenis, alekseyshl Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37792 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@313167 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-11[compiler-rt] Cleanup decoratorsVitaly Buka
Summary: Removed redundant End*() methods which defined same way. Removed redundant Warning() methods. Reviewers: eugenis Subscribers: kubamracek, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D37549 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@312950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-22[sanitizer_common] Move filesystem-related code out of sanitizer_common.ccVitaly Buka
Summary: This is a pure refactoring change. It just moves code that is related to filesystem operations from sanitizer_common.{cc,h} to sanitizer_file.{cc,h}. This makes it cleaner to disable the filesystem-related code for a new port that doesn't want it. Submitted on behalf of Roland McGrath. Reviewers: kcc, eugenis, alekseyshl Reviewed By: alekseyshl Subscribers: vitalybuka, llvm-commits, kubamracek, mgorny, phosek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35591 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308819 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20Revert "[sanitizer_common] Move filesystem-related code out of ↵Vitaly Buka
sanitizer_common.cc" Breaks Windows build. This reverts commit r308640. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308648 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-20[sanitizer_common] Move filesystem-related code out of sanitizer_common.ccAlex Shlyapnikov
This is a pure refactoring change. It just moves code that is related to filesystem operations from sanitizer_common.{cc,h} to sanitizer_file.{cc,h}. This makes it cleaner to disable the filesystem-related code for a new port that doesn't want it. Commiting for mcgrathr. Reviewers: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35591 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@308640 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-23[asan] Add support for Android debug message.Evgeniy Stepanov
Add ASan report to the "debug message" field in Android tombstones. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@306184 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30[asan] Support line numbers in StackVarDescrKuba Mracek
When -fsanitize-address-use-after-scope is used, the instrumentation produces line numbers in stack frame descriptions. This patch make sure the ASan runtime supports this format (ParseFrameDescription needs to be able to parse "varname:line") and prepares lit tests to allow line numbers in ASan report output. Differential Revision: https://reviews.llvm.org/D31484 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@299043 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-29General definition for weak functionsMarcos Pividori
In this diff, I define a general macro for defining weak functions with a default implementation: "SANITIZER_INTERFACE_WEAK_DEF()". This way, we simplify the implementation for different platforms. For example, we cannot define weak functions on Windows, but we can use linker pragmas to create an alias to a default implementation. All of these implementation details are hidden in the new macro. Also, as I modify the name for exported weak symbols on Windows, I needed to temporarily disable "dll_host" test for asan, which checks the list of functions included in asan_win_dll_thunk. Differential Revision: https://reviews.llvm.org/D28596 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@293419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-06[sanitizer] Add a 'print_module_map' flag which prints modules with UUIDs on ↵Kuba Mracek
Darwin This patch add a new sanitizer flag, print_module_map, which enables printing a module map when the process exits, or after each report (for TSan). The output format is very similar to what Crash Reporter produces on Darwin (e.g. the format of module UUIDs). This enables users to use the existing symbol servers to offline symbolicate and aggregate reports. Differential Revision: https://reviews.llvm.org/D27400 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@291277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-28[asan] Provide bug descriptions for all reports (not just ErrorGeneric)Kuba Mracek
Differential Revision: https://reviews.llvm.org/D27012 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@288065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-21[asan] Reify ErrorGenericFilipe Cabecinhas
Summary: Finish work on PR30351 (last one, after D24551, D24552, and D24554 land) Also replace the old ReportData structure/variable with the current_error_ static member of the ScopedInErrorReport class. This has the following side-effects: - Move ASAN_ON_ERROR(); call to the start of the destructor, instead of in StartReporting(). - We only generate the error structure after the ScopedInErrorReport constructor finishes, so we can't call ASAN_ON_ERROR() during the constructor. I think this makes more sense, since we end up never running two of the ASAN_ON_ERROR() callback. This also works the same way as error reporting, since we end up having a lock around it. Otherwise we could end up with the ASAN_ON_ERROR() call for error 1, then the ASAN_ON_ERROR() call for error 2, and then lock the mutex for reporting error 1. - The __asan_get_report_* functions will be able to, in the future, provide information about other errors that aren't a "generic error". But we might want to rethink that API, since it's too restricted. Ideally we teach lldb about the current_error_ member of ScopedInErrorReport. Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24555 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@282107 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorInvalidPointerPairFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24554 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281593 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorODRViolationFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24552 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281592 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-15[asan] Reify ErrorBadParamsToAnnotateContiguousContainerFilipe Cabecinhas
Summary: Continue work on PR30351 Reviewers: vitalybuka, kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24551 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281591 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] Reify ErrorStringFunctionSizeOverflowFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24394 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-14[asan] Reify ErrorStringFunctionMemoryRangesOverlapFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D24393 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorSanitizerGetAllocatedSizeNotOwnedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24392 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281392 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorMallocUsableSizeNotOwnedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24391 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281391 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorAllocTypeMismatchFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24390 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281390 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13[asan] Reify ErrorFreeNotMallocedFilipe Cabecinhas
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html Reviewers: kcc, eugenis, vitalybuka Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24389 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281389 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-12[asan] Cleanup: Move tid into ErrorBase, add const to BufferedStackTrace, be ↵Filipe Cabecinhas
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@281236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08[asan] Reify ErrorDeadlySignalFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23873 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280930 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07[asan] Reify ErrorNewDeleteSizeMismatchFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23874 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280812 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31Reify ErrorDoubleFreeFilipe Cabecinhas
Summary: Keep reifying other errors. Reviewers: kcc, samsonov Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23717 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30Start reifying error descriptions (Re-do of D23672 supporting VS2013)Filipe Cabecinhas
Summary: @kcc: I know you've accepted the other revision, but since this is a non-trivial change, I'm updating it to show why D24029 would help. This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kcc, llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D24030 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@280111 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28Revert "Start reifying error descriptions. Second try: Try to appease Visual ↵Filipe Cabecinhas
Studio." This reverts r279931. Will try it with the same Visual Studio version before committing again. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28Start reifying error descriptions. Second try: Try to appease Visual Studio.Filipe Cabecinhas
Summary: This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23672 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279931 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26Revert "Start reifying error descriptions"Filipe Cabecinhas
This reverts r279862 to investigate VS failures. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26Start reifying error descriptionsFilipe Cabecinhas
Summary: This commit sets up the infrastructure to use reified error descriptions, and moves ReportStackOverflow to the new system. After we convert all the errors, we'll be able to simplify ScopedInErrorReport and remove the older debugging mechanism which had some errors partly reified in some way. We'll be able to maintain the external API. ScopedInErrorReport will be able to track one of the reified errors at a time. The purpose of this is so we have its destructor actually print the error and possibly interface with the debugger (will depend on the platform, of course). Reviewers: kcc, samsonov, timurrrr Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23672 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25[asan] remove unused kAsanHeapRightRedzoneMagic (NFC)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-19Cleanup: Move the *AddressDescription printing code to Print() members ↵Filipe Cabecinhas
inside those structs. Summary: The Print() members might take optional access_size and bug_type parameters to still be able to provide the same information Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23658 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17[asan] Remove "Stack partial redzone" from reportVitaly Buka
Summary: This value is never used. Reviewers: kcc, eugenis Subscribers: llvm-commits, kubabrecka Differential Revision: https://reviews.llvm.org/D23631 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@279010 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-17Split DescribeAddressIfStack between a function that gets all the ↵Filipe Cabecinhas
information, and one that prints it. Summary: Replacement for part of D23518 This deals with stack addresses. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23605 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17Rename DescribeHeapAddress to DescribeAddressIfHeap and split it into a ↵Filipe Cabecinhas
function to get all the information about the address, and one to print it. Summary: Replacement for part of D23518 This deals with heap addresses, and renames DescribeHeapAddress. Requires D23520, which moves code around to make it accessible in asan_describers.cc (and still accessible in asan_report.cc if needed). Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23569 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-16Move the Decorator, ThreadNameWithParenthesis, and DescribeThread to ↵Filipe Cabecinhas
asan_descriptions.{h,cc} Summary: Replacement for part of D23518 Code refactoring to allow us to move some more DescribeAddressIf* functions to work by getting the structured information, and then printing it. Reviewers: kcc, samsonov Subscribers: kubabrecka, llvm-commits Differential Revision: https://reviews.llvm.org/D23520 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@278820 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
2016-08-03[compiler-rt] Fix CHECK coding style [NFC]Etienne Bergeron
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@277604 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31[asan] Fix a deadlock halt_on_error-signals.c when `reporting_thread_tid_` is 0Kuba Brecka
A signal can be delivered after TryLock but before StartReporting in ScopedInErrorReport, causing a deadlock. Fixing this by statically initializing reporting_thread_tid_ to kInvalidTid. Differential Revision: http://reviews.llvm.org/D20524 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@271256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06[asan] Bail out on stack overflow in recovery mode.Maxim Ostapenko
In recovery mode, when ASan detects stack overflow (say, when infinite recursion detected), it tries to continue program execution and hangs on repetitive error reports. There isn't any sense to do it, we can just bail out on stack overflow error, because the program would crash soon anyway. Differential Revision: http://reviews.llvm.org/D19958 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268713 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-29[asan] Assert in __sanitizer_ptr_{sub,cmp} if one of the pointers was freed.Filipe Cabecinhas
Summary: This (partially) implements the check mentioned at http://kristerw.blogspot.co.uk/2016/04/dangling-pointers-and-undefined-behavior.html (via John Regehr) Quoting: "That the behavior is undefined follows from C11 6.2.4 "Storage durations of objects" The lifetime of an object is the portion of program execution during which storage is guaranteed to be reserved for it. An object exists, has a constant address, and retains its last-stored value throughout its lifetime. If an object is referred to outside of its lifetime, the behavior is undefined. The value of a pointer becomes indeterminate when the object it points to (or just past) reaches the end of its lifetime. and 7.22.3 "Memory management functions" that says that free ends the lifetime of objects The lifetime of an allocated object extends from the allocation until the deallocation. " We can probably implement this for stack variables too, but I think this is a good start to see if there's interest in this check. We can also hide this behind a flag, too. Reviewers: samsonov, kcc, rsmith, regehr Subscribers: kubabrecka, llvm-commits Differential Revision: http://reviews.llvm.org/D19691 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@268097 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-26[sanitizers] [NFC] Add defines for the various PowerPC ABIs.Marcin Koscielnicki
Differential Revision: http://reviews.llvm.org/D19542 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@267586 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13[asan] Prefer alloc-dealloc-mismatch to new-delete-type-mismatch.Evgeniy Stepanov
With -fsized-deallocation, new[] vs delete mismatch is reported as new-delete-type-mismatch. This is technically true, but alloc-dealloc-mismatch describes it better. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266246 91177308-0d34-0410-b5e6-96231b3b80d8