OSDN Git Service

Ignore the vector page in /proc/<pid>/maps
authorColin Cross <ccross@android.com>
Wed, 13 Jul 2011 05:32:43 +0000 (22:32 -0700)
committerColin Cross <ccross@android.com>
Wed, 13 Jul 2011 05:32:43 +0000 (22:32 -0700)
In kernel 2.6.37, the vector page was added to /proc/<pid>/maps,
but because it is located above TASK_SIZE (usually 0xbf000000),
it is considered to be in the kernel's address space, not the
process', so it doesn't show up in /proc/<pid>/pagemap.

When the vector page is detected, using the name "[vectors]",
remove it from the map.

Change-Id: I5f0758bbe5d2b927056fa9fee684fea63dd0fa4b

libpagemap/pm_process.c

index 1ab367d..0f54b48 100644 (file)
@@ -258,6 +258,9 @@ static int read_maps(pm_process_t *proc) {
         sscanf(line, "%lx-%lx %s %lx %*s %*d %" S(MAX_LINE) "s",
                &map->start, &map->end, perms, &map->offset, name);
 
+        if (!strcmp(name, "[vectors]"))
+            continue;
+
         map->name = malloc(strlen(name) + 1);
         if (!map->name) {
             error = errno;