This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Socket leak when accept() is aborted by TCP RST?
- From: Grant Edwards <grant dot b dot edwards at gmail dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Wed, 28 Jul 2010 18:12:05 +0000 (UTC)
- Subject: [ECOS] Re: Socket leak when accept() is aborted by TCP RST?
- References: <i2nlp3$s1i$1@dough.gmane.org>
On 2010-07-27, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> I'm seeing what appears to me to be a socket leak in the accept()
> operation provided by the "new" BSD network stack.
The stack is definitely leaking sockets. I can now reliably reproduce
the problem by opening a TCP connection and then immediately causing a
TCP reset.
I've got 9 open sockets to start with, and max sockets is configured
to be 256. After repeating the open/reset sequence 244 times, I get
an "DEBUG: Out of sockets - waiting" message that repeats periodically
(but never recovers).
At that point, I can still ping the eCos system, but no new
connections can be opened.
In case anybody else would like to try it, here's a win32 program that
opens/resets a tcp connection 4 times per second:
http://www.panix.com/~grante/files/ecos/winopenclose.c
http://www.panix.com/~grante/files/ecos/winopenclose.exe
The accept() call will return -1 with errno==353 when the socket is
leaked.
--
Grant Edwards grant.b.edwards Yow! ... the MYSTERIANS are
at in here with my CORDUROY
gmail.com SOAP DISH!!
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss