bug-inetutils
[Top][All Lists]
Advanced

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

Re: [bug-inetutils] memory exhaustion in ftpd/ftpd.c


From: Dan Kegel
Subject: Re: [bug-inetutils] memory exhaustion in ftpd/ftpd.c
Date: Wed, 24 Dec 2003 07:37:10 -0800
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031007

Eric Schmeddes wrote:
I would like report a memory exhaustion problem occurring when
getting a binary file larger than the available memory from a
machine running ftpd using mmap().

The problem occurs in the function send_data() in ftpd/ftpd.c,
when using mmap() to access the file. It seems that when the
current get position in the mmapped buffer exceeds the currently
available machine memory, the running ftpd process gets killed
by the kernel.

I have only be able to reproduce this error when running without
a swap partition.

This is normal and expected for mmap-based servers.
(And it's not very smart, I agree.  mmap is probably not
the right way to serve files if VM is at all tight!)

Fortunately, you can probably work around this by doing

export ac_cv_func_mmap_fixed_mapped=no

before configuring ftpd.  This will cause it to use its
fallback, getc-based server code path.

You might consider using a different server... betaftpd
(when properly patched) behaves pretty well in embedded systems,
at least for what I've done.
http://www.pengutronix.de/software/ptxdist/patches-cvs/betaftpd-0.0.8pre17/generic/betaftpd-errhand.patch
is the patch we use.  (And if you're interested in performance,
there are a couple of patches there to convert betaftpd to
use sigio or epoll, vroom vroom...)
- Dan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]