Index: lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc =================================================================== --- lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc +++ lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc @@ -111,11 +111,16 @@ void InitTracePcGuard(u32* start, u32* end) { if (!initialized) Initialize(); - CHECK(!*start); CHECK_NE(start, end); u32 i = pc_vector.size(); - for (u32* p = start; p < end; p++) *p = ++i; + for (u32* p = start; p < end; p++) + // Ignore zero padding. + if (*p) { + if (*p != 0xffffffff) // This module was initialized before. + return; + *p = ++i; + } pc_vector.resize(i); } @@ -155,7 +160,7 @@ SANITIZER_INTERFACE_ATTRIBUTE SANITIZER_WEAK_ATTRIBUTE void __sanitizer_cov_trace_pc_guard_init(u32* start, u32* end) { - if (start == end || *start) return; + if (start == end) return; pc_guard_controller.InitTracePcGuard(start, end); }