🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #741

Too-many-open-files bug in NNTP 1.5.10 server fixed

#741
From: Oliver Laumann
Date: Mon, 15 Oct 1990 10:53
21 lines
1587 bytes
I think I've found the bug that causes the NNTP 1.5.10 server to get
into a mode where it prints "spawn: pipe: Too many open files" for every
incoming article.

The culprit is the call to vfork() followed by a call to closelog() in
the child process in server/spawn.c.  closelog() not only closes the
file descriptor used by syslog(), but also sets (or clears; I don't have
the sources) a variable shared between closelog and syslog to indicate
that the socket must be re-opened in the next call to syslog().

Since spawn.c uses vfork() instead of fork(), this variable is also
set or cleared in the parent process, so that the next call to syslog()
re-opens the socket, although it has only been closed in the child
process.  This is repeated until all available file descriptors are in use.

I don't know an easy fix for this other than replacing vfork by fork.

Regards,
--
Oliver Laumann     net@TUB.BITNET     net@tub.cs.tu-berlin.de     net@tub.UUCP
Technical Details
Message-ID: <1802@tub.UUCP>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!news-server.csri.toronto.edu!math.lsa.umich.edu!caen!sdd.hp.com!wuarchive!uunet!mcsun!unido!tub!net

Show Full Headers
Complete Article Headers
Message-ID: <1802@tub.UUCP>
Subject: Too-many-open-files bug in NNTP 1.5.10 server fixed
Date: Mon, 15 Oct 1990 10:53:00 +0000
From: net@tub.UUCP (Oliver Laumann)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp!utzoo!utstat!news-server.csri.toronto.edu!math.lsa.umich.edu!caen!sdd.hp.com!wuarchive!uunet!mcsun!unido!tub!net
Newsgroups: news.software.nntp
Reply-To: net@tub.UUCP (Oliver Laumann)
Organization: Technical University of Berlin, Germany
Lines: 20