pread() and missing memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hola,

I have a program which pread()'s /proc/<pid>/mem.  It's similar to
kcheat, if anybody has seen that program.

Occaisionally, pread() will read less bytes than requested, and I'm not
talking about hitting EOF, I'm talking about somewhere in the middle of
the mem file.

The author of kcheat has clearly found the same wierd problem of not
being able to read certain offsets in the mem file.

Looking at his sourcecode, he notes the first address unsuccessfully
read and calls it a "missing page".  He then increments the read pointer
by PAGE_SIZE and resumes reading the mem file till he either hits the
end of the file or hits another address which can't be read in (and
again he skips by PAGE_SIZE and continutes).

I'm curious what these "missing pages" are.  Is this supposed to be
normal?  Is there anything I can do to make sure that all of a process's
memory is available via pread()s to /proc/<pid>/mem?

I'm assuming that if address X can't be read in by pread(), then all
addresses up to X + PAGE_SIZE are also unavailable?

Pointers to more extensive info would be appreciated.

Thanks!
Peter


-- 
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux