Commit 1f7273e5 by Rainer Orth Committed by Rainer Orth

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
parent f208c5cc
2018-01-13 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
PR sanitizer/82824
* lsan/lsan_common_mac.cc: Cherry-pick upstream r322437.
2017-12-05 Martin Liska <mliska@suse.cz> 2017-12-05 Martin Liska <mliska@suse.cz>
Jakub Jelinek <jakub@redhat.com> Jakub Jelinek <jakub@redhat.com>
......
...@@ -22,6 +22,13 @@ ...@@ -22,6 +22,13 @@
#include <mach/mach.h> #include <mach/mach.h>
// 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 { namespace __lsan {
typedef struct { typedef struct {
...@@ -155,7 +162,7 @@ void ProcessPlatformSpecificAllocations(Frontier *frontier) { ...@@ -155,7 +162,7 @@ void ProcessPlatformSpecificAllocations(Frontier *frontier) {
// libxpc stashes some pointers in the Kernel Alloc Once page, // libxpc stashes some pointers in the Kernel Alloc Once page,
// make sure not to report those as leaks. // 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", ScanRangeForPointers(address, end_address, frontier, "GLOBAL",
kReachable); kReachable);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment