diff --git a/util/linux/memory_map.cc b/util/linux/memory_map.cc index a8da66c9..a274790e 100644 --- a/util/linux/memory_map.cc +++ b/util/linux/memory_map.cc @@ -102,10 +102,20 @@ ParseResult ParseMapsLine(DelimitedFileReader* maps_file_reader, LOG(ERROR) << "format error"; return ParseResult::kError; } - if (end_address <= start_address) { + if (end_address < start_address) { LOG(ERROR) << "format error"; return ParseResult::kError; } + // Skip zero-length mappings. + if (end_address == start_address) { + std::string rest_of_line; + if (maps_file_reader->GetLine(&rest_of_line) != + DelimitedFileReader::Result::kSuccess) { + LOG(ERROR) << "format error"; + return ParseResult::kError; + } + return ParseResult::kSuccess; + } // TODO(jperaza): set bitness properly #if defined(ARCH_CPU_64_BITS)