Menu

#1 parses /proc/N/maps incorrectly

open
nobody
None
5
2006-09-28
2006-09-28
No

Quoth the proc(1) manpage:

The format is:

address perms offset dev inode
pathname
08048000-08056000 r-xp 00000000 03:0c 64593
/usr/sbin/gpm

In src/proc.c, preload parses the line as follows:

count = sscanf (buffer, "%lx-%lx %*15s %lx
%*u:%*u %*u %"FILELENSTR"s",

The dev field is parsed as decimal integers, but they
are actually hexadecimals. As my root partition happens
to be dev fe:01, preload doesn't find any executables,
and thus doesn't really do anything.

The attached patch should fix the problem.

Discussion

  • Johan Kiviniemi

    Johan Kiviniemi - 2006-09-28

    Fixes the parsing of /proc/N/maps

     
  • Behdad Esfahbod

    Behdad Esfahbod - 2006-10-03

    Logged In: YES
    user_id=47601

    Thanks. Will commit as soon as sf.net's cvs is back up :-(.

     
  • Dennis Schridde

    Dennis Schridde - 2013-04-21

    > Thanks. Will commit as soon as sf.net's cvs is back up :-(.

    Has this been done, yet?

     

Log in to post a comment.

MongoDB Logo MongoDB