From 1f7273e5dbd7e59cb97111d2d2bc73c896e12c1f Mon Sep 17 00:00:00 2001 From: Rainer Orth Date: Sat, 13 Jan 2018 21:01:27 +0000 Subject: Allow for lack of VM_MEMORY_OS_ALLOC_ONCE on Mac OS X (PR sanitizer/82824) PR sanitizer/82824 * lsan/lsan_common_mac.cc: Cherry-pick upstream r322437. From-SVN: r256650 --- libsanitizer/ChangeLog | 5 +++++ libsanitizer/lsan/lsan_common_mac.cc | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'libsanitizer') diff --git a/libsanitizer/ChangeLog b/libsanitizer/ChangeLog index e5cad19..2f57f6a 100644 --- a/libsanitizer/ChangeLog +++ b/libsanitizer/ChangeLog @@ -1,3 +1,8 @@ +2018-01-13 Rainer Orth + + PR sanitizer/82824 + * lsan/lsan_common_mac.cc: Cherry-pick upstream r322437. + 2017-12-05 Martin Liska Jakub Jelinek diff --git a/libsanitizer/lsan/lsan_common_mac.cc b/libsanitizer/lsan/lsan_common_mac.cc index e60b3d0..6e763da 100644 --- a/libsanitizer/lsan/lsan_common_mac.cc +++ b/libsanitizer/lsan/lsan_common_mac.cc @@ -22,6 +22,13 @@ #include +// Only introduced in Mac OS X 10.9. +#ifdef VM_MEMORY_OS_ALLOC_ONCE +static const int kSanitizerVmMemoryOsAllocOnce = VM_MEMORY_OS_ALLOC_ONCE; +#else +static const int kSanitizerVmMemoryOsAllocOnce = 73; +#endif + namespace __lsan { typedef struct { @@ -155,7 +162,7 @@ void ProcessPlatformSpecificAllocations(Frontier *frontier) { // libxpc stashes some pointers in the Kernel Alloc Once page, // make sure not to report those as leaks. - if (info.user_tag == VM_MEMORY_OS_ALLOC_ONCE) { + if (info.user_tag == kSanitizerVmMemoryOsAllocOnce) { ScanRangeForPointers(address, end_address, frontier, "GLOBAL", kReachable); -- cgit v1.1