OSDN Git Service

Use the uncached form of BacktraceMap::Create.
authorChristopher Ferris <cferris@google.com>
Tue, 5 Aug 2014 00:15:21 +0000 (17:15 -0700)
committerChristopher Ferris <cferris@google.com>
Tue, 5 Aug 2014 02:22:40 +0000 (19:22 -0700)
The code assumes that calling BacktraceMap::Create creates a map based
on the current state of the maps. This is not true by default, so
call the Create function indicating we want an uncached BacktraceMap object.

(cherry picked from 27a10f618357cf85cc0677a04f0a5a3a8a437aed)

Change-Id: Ic7a2dedaea9950174b24ede4dcda30ffe036fe93

runtime/mem_map.cc

index 1074253..438bee9 100644 (file)
@@ -153,9 +153,9 @@ static bool CheckMapRequest(byte* expected_ptr, void* actual_ptr, size_t byte_co
   uintptr_t expected = reinterpret_cast<uintptr_t>(expected_ptr);
   uintptr_t limit = expected + byte_count;
 
-  std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid()));
-  if (!map->Build()) {
-    *error_msg << StringPrintf("Failed to build process map to determine why mmap returned "
+  std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(getpid(), true));
+  if (map.get() == NULL) {
+    *error_msg << StringPrintf("Failed to create process map to determine why mmap returned "
                                "0x%08" PRIxPTR " instead of 0x%08" PRIxPTR, actual, expected);
 
     return false;