Re: [Bugme-new] [Bug 11110] New: Core dumps do not include writable unmodified MAP_PRIVATE maps

Daniel Jacobowitz
2008-07-17T21:20:23Z

On Thu, Jul 17, 2008 at 04:39:30PM -0400, Neil Horman wrote:
> I'm not 100% sure, and I can see why the kernel might skip over untouched pages,
> but that seems like a bug to me. The memory is mapped, it should be readable by
> gdb after a core dump, and since its a mapped file, it can't be assumed to be
> zero, like heap memory that hasn't been faulted in yet.

I'm guessing this is an attempt not to dump shared library text
segments. We can't do it solely based on permissions; if I remember
right there's a readonly page in the application or ld.so associated
with the shared library list that is mprotected to read-only after
initialization (-z relro).

In April 2006 Dave M suggested only skipping if VM_EXEC. This will
dump some text segment bits (e.g. anything that had a software
breakpoint inserted), but not most; writable data is usually written
to (at least mostly).

--
Daniel Jacobowitz
CodeSourcery