[uClinux-dev] boa memory leak

Matthew Natalier matthewn at snapgear.com
Mon Mar 24 18:08:04 EST 2003


An execve will clean up all of the memory for the current process.  The
new process (in this case the cgi program) will replace the existing
process (in this case boa).  It looks like the mmap structures are freed
from within load_flat_file which is called by do_execve (eventually).

If you are finding that the memory is not freed, then it is a bug in
your platform.  Check that your is_in_rom macro (called from mmnommy/mmap.c)
is defined properly.  On m68knommu it is defined in



Bryan Larsen (uClinux) wrote:
> The strdup in create_argv() cgi.c:248 is never freed.  The bug exists in
> both the very old Arcturus March 2002 distribution and the current CVS as
> well as boa 94.14rc9.  I can't believe nobody has run into this before. 
> Maybe other libc's free memory after an execve finishes or something. 
> (The leak occurs with both uClibc and uC-libc).
> For now, I'm just commenting the line out.  If nobody else has fixed it,
> I'll put together a proper fix.  It's hard to use malloc'd memory here as
> the fork terminates with the execve.
> Bryan
> _______________________________________________
> uClinux-dev mailing list
> uClinux-dev at uclinux.org
> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
> This message was resent by uclinux-dev at uclinux.org

Matthew Natalier
Systems Programmer
p: +61 7 3435 2805
f: +61 7 3891 3630
matthewn at SnapGear.com
Custom Embedded Solutions
Security Appliances

More information about the uClinux-dev mailing list