Article View: news.software.nntp
Article #81494NntpCache 3.0.2 uses up *ALL* file descriptors (fixed)
From: Etian
Date: Fri, 26 Jun 2009 23:06
Date: Fri, 26 Jun 2009 23:06
26 lines
1886 bytes
1886 bytes
I've been playing with nntpcache, and after hitting it hard for a long
session, it crashed other programs (including INN) which couldn't open
files. lsof showed that each process in nntpcache was opening files and
never closing them until the nntp session was closed, building up
thousands of file descriptors. So I went through article.c, looking for
open commands whose close commands might have fallen out of a loop. And
here is what I found:
In lines 554- 572 of src/article.c:
fd = open (artfile, O_RDONLY);
if (fd >= 0)
{do a bunch of stuff
} else
close (fd);
fd = -1;
The close is skipped when the open is successful, and only picked up by
the else clause, which should simply be deleted:
};
close (fd);
fd = -1;
This appears to have fixed the problem.
Etian
sonic-news
Technical Details
Message-ID:
<1251e$4a455476$bdb60b4b$25057@unlimited.sonic-news.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!news.glorb.com!news2.glorb.com!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-out.sonic-news.com!unlimited.sonic-news.com!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <1251e$4a455476$bdb60b4b$25057@unlimited.sonic-news.com> Subject: NntpCache 3.0.2 uses up *ALL* file descriptors (fixed) Date: Fri, 26 Jun 2009 17:06:20 -0600 From: Etian <546982121520@sonic-news.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!feeder.erje.net!news.glorb.com!news2.glorb.com!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-out.sonic-news.com!unlimited.sonic-news.com!not-for-mail User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 Newsgroups: news.software.nntp Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@sonic-news.com Organization: www.sonic-news.com Lines: 26 NNTP-Posting-Date: Fri, 26 Jun 2009 18:06:30 -0500 X-Trace: 1251e4a4554761813aeee25057