[uClibc] mmaps for malloc should be private

Alexandre Oliva aoliva at redhat.com
Mon Mar 22 00:32:59 UTC 2004


On Mar 21, 2004, David McCullough <davidm at snapgear.com> wrote:

> Jivin Alexandre Oliva lays it down ...
>> ... otherwise, if you happen to run a program linked with a uclibc for
>> non-MMU on a system that does provide an MMU, and it issues a fork()
>> system call, the memory will not be unshared.  Patch by David Howells
>> <dhowells at redhat.com>.

> The only problem is,  uClinux doesn't implement private mappings,  so the
> patch below will break all uClinux implementations using malloc :-)

Err...  Break in what sense?  The dynamic loader uses private mappings
for _dl_malloc and they work just fine on uClinux.  Why wouldn't they
work on for malloc() as well?

Sure, in uClibc they're not private in the sense that nobody else can
get to them, but the notion still applies, especially for MAP_ANON
maps.

For file maps, I can suppose that this would break, but this is not
the case we're talking about.

-- 
Alexandre Oliva             http://www.ic.unicamp.br/~oliva/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}



More information about the uClibc mailing list