summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_malloc_mac.inc
AgeCommit message (Collapse)Author
2017-04-13Free zone name when destroying malloc zoneFrancis Ricci
Summary: The darwin interceptor for malloc_destroy_zone manually frees the zone struct, but does not free the name component. Make sure to free the name if it has been set. Reviewers: kubamracek, alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31983 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11[sanitizer] Make sure libmalloc doesn't remove the sanitizer zone from ↵Kuba Mracek
malloc_zones[0] In certain OS versions, it was possible that libmalloc replaced the sanitizer zone from being the default zone (i.e. being in malloc_zones[0]). This patch introduces a failsafe that makes sure we always stay the default zone. No testcase for this, because this doesn't reproduce under normal circumstances. Differential Revision: https://reviews.llvm.org/D27083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@289376 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-11[sanitizer] Handle malloc_destroy_zone() on DarwinKuba Mracek
We currently have a interceptor for malloc_create_zone, which returns a new zone that redirects all the zone requests to our sanitizer zone. However, calling malloc_destroy_zone on that zone will cause libmalloc to print out some warning messages, because the zone is not registered in the list of zones. This patch handles this and adds a testcase for that. Differential Revision: https://reviews.llvm.org/D27083 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@289375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04[libsanitizer] Fix bugs and wiki links to point to GitHub.Alexander Potapenko
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254738 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-04[ASan] Retire mac_ignore_invalid_free, remove some dead code.Alexander Potapenko
mac_ignore_invalid_free was helpful when ASan runtime used to intercept CFAllocator and sometimes corrupted its memory. This behavior had been long gone, and the flag was unused. This patch also deletes ReportMacCfReallocUnknown(), which was used by the CFAllocator realloc() wrapper. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@254722 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-12[asan] Remove system_malloc_zoneKuba Brecka
This seems to be dead code – `system_malloc_zone` is initialized as null and we never assign to it. This code is apparently currently never executed (in ASan), but is causes trouble for the TSan OS X port. Let's replace the checks with `COMMON_MALLOC_ENTER` (`ENSURE_ASAN_INITED()`). Differential Revision: http://reviews.llvm.org/D14334 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252876 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04Whitespace fixup for r252052. NFC.Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252053 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-04[tsan] Use malloc zone interceptors on OS X, part 1 (refactoring)Kuba Brecka
TSan needs to use a custom malloc zone on OS X, which is already implemented in ASan. This patch is a refactoring patch (NFC) that extracts this from ASan into sanitizer_common, where we can reuse it in TSan. Reviewed at http://reviews.llvm.org/D14330 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252052 91177308-0d34-0410-b5e6-96231b3b80d8