Index: lib/sanitizer_common/sanitizer_posix.cc =================================================================== --- lib/sanitizer_common/sanitizer_posix.cc +++ lib/sanitizer_common/sanitizer_posix.cc @@ -270,6 +270,7 @@ while (proc_maps.Next(&start, &end, /*offset*/0, /*filename*/0, /*filename_size*/0, /*protection*/0)) { + if (start == end) continue; // Empty range. CHECK_NE(0, end); if (!IntervalsAreSeparate(start, end - 1, range_start, range_end)) return false; Index: test/asan/TestCases/Darwin/empty-section.cc =================================================================== --- test/asan/TestCases/Darwin/empty-section.cc +++ test/asan/TestCases/Darwin/empty-section.cc @@ -0,0 +1,12 @@ +// Regression test with an empty (length = 0) custom section. + +// RUN: %clangxx_asan -g -O0 %s -c -o %t.o +// RUN: %clangxx_asan -g -O0 %t.o -o %t -sectcreate mysegment mysection /dev/null +// RUN: %run %t 2>&1 | FileCheck %s + +#include + +int main() { + printf("Hello, world!\n"); + // CHECK: Hello, world! +}