Skip to content

Commit 39fddff

Browse files
pudge62maruipu
authored andcommitted
fix the module map of main executable on darwin platforms
skip the __PAGEZERO segment when calculate image range
1 parent 7aabdb8 commit 39fddff

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ void MemoryMappingLayout::DumpListOfModules(
433433
MemoryMappedSegmentData data;
434434
segment.data_ = &data;
435435
while (Next(&segment)) {
436-
if (segment.filename[0] == '\0') continue;
436+
// skip the __PAGEZERO segment, its vmsize is 0
437+
if (segment.filename[0] == '\0' || (segment.start == segment.end))
438+
continue;
437439
LoadedModule *cur_module = nullptr;
438440
if (!modules->empty() &&
439441
0 == internal_strcmp(segment.filename, modules->back().full_name())) {

0 commit comments

Comments
 (0)