Index: compiler-rt/trunk/lib/lsan/lsan_common_mac.cc =================================================================== --- compiler-rt/trunk/lib/lsan/lsan_common_mac.cc +++ compiler-rt/trunk/lib/lsan/lsan_common_mac.cc @@ -142,12 +142,6 @@ } void ProcessPlatformSpecificAllocations(Frontier *frontier) { - mach_port_name_t port; - if (task_for_pid(mach_task_self(), internal_getpid(), &port) - != KERN_SUCCESS) { - return; - } - unsigned depth = 1; vm_size_t size = 0; vm_address_t address = 0; @@ -158,7 +152,7 @@ while (err == KERN_SUCCESS) { struct vm_region_submap_info_64 info; - err = vm_region_recurse_64(port, &address, &size, &depth, + err = vm_region_recurse_64(mach_task_self(), &address, &size, &depth, (vm_region_info_t)&info, &count); uptr end_address = address + size; Index: compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc =================================================================== --- compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc +++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_procmaps_mac.cc @@ -140,12 +140,6 @@ // early in the process, when dyld is one of the only images loaded, // so it will be hit after only a few iterations. static mach_header *get_dyld_image_header() { - mach_port_name_t port; - if (task_for_pid(mach_task_self(), internal_getpid(), &port) != - KERN_SUCCESS) { - return nullptr; - } - unsigned depth = 1; vm_size_t size = 0; vm_address_t address = 0; @@ -154,7 +148,7 @@ while (true) { struct vm_region_submap_info_64 info; - err = vm_region_recurse_64(port, &address, &size, &depth, + err = vm_region_recurse_64(mach_task_self(), &address, &size, &depth, (vm_region_info_t)&info, &count); if (err != KERN_SUCCESS) return nullptr;