🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #47051

Re: solaris2.6 and inn2.2

#47051
From: RULER OF ALL USENET
Date: Thu, 22 Jun 2000 00:00
70 lines
3603 bytes
On 24 Aug 1999, Russ Allbery wrote:

> Brad Knowles <brad@shub-internet.org> writes:
> > Now that I think about it, the times when I've seen the most reports
> > from my monitor program that restarts actived when it dies, has been
> > when there have been lots of newsgroups being added/deleted from the
> 
> It's not that hard to track down.  GetGroupList() calls ReadInFile(),
> which calls ReadInDescriptor().  It promptly does:
>     /* Slurp, slurp. */
> So if the file grows or shrinks between the fstat() and xread(),
> ReadInDescriptor() returns NULL, which causes GetGroupList() to return
> FALSE, and actived promptly does an exit(1).

Heh.  Well, today we had actived die on our 2.something box,
which happens to be Slowaris 2.7, and attempting to start it
resulted in an immediate crash coredump powie whizbang thingy.

Now I looked through the logs after getting running to confirm
that it had indeed died immediately following an rmgroup, as I
suspected.

How did I get it to start again?  Simple.  Add a newgroup.  Then
no problems.

Why?  The size of our active file before I frobbed it into shape
was 1417216 bytes.  Where did it die?  in strchr() which is part
of GetLocalGroupList() in group.c (note that this k0de dates from
15.Nov 1998 in more-than-year-old source)......

    /* Get the new file. */
    active = XReadInFile(ACTIVE, (struct stat *)NULL);
    if (active == NULL) {
        syslog(L_ERROR, "%s cant read %s %m", ClientHost, ACTIVE);
        return FALSE;
    }
    /* Count lines. */
    for (p = active, i = 0; (p = strchr(p, '\n')) != NULL; p++, i++)
        continue;
                                 ^^^^^^

It'll be my luck that this was fixed before it was ripped from
the newer k0deZ.

I see an identical line in current k0de storage/ov.c:

/*
**  Build the newsgroup structures from the active file.
*/
STATIC void BuildGroups(char *active)
{
    NGHASH              *htp;
    NEWSGROUP           *ngp;
    char                *p;
    char                *q;
    int                 i;
    unsigned            j;
    int                 lines;
    int                 NGHbuckets;
    char                *fields[5];
    /* Count the number of groups. */
    for (p = active, i = 0; (p = strchr(p, '\n')) != NULL; p++, i++)
        continue;

The difference I see is that this just uses ReadInFile(), while
actived looks to be using mmap() in XReadInFile().



Technical Details
Message-ID: <Pine.BSF.3.96.1000622223315.4720F-100000@ME0WVAX.INT.TELE.DK>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <7p9ae7$t3$1@news247.ctel.msk.ru> <brad-1608991750150001@brad.techos.skynet.be> <7p9d1j$10e$1@news247.ctel.msk.ru> <7pjoav$81v$1@nclient1-gui.server.ntli.net> <ylogg11udz.fsf@windlord.stanford.edu> <7puu0a$rl5$1@news.inet.tele.dk> <brad-2508990102400001@dialup446.brussels2.skynet.be> <yliu64pye5.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <Pine.BSF.3.96.1000622223315.4720F-100000@ME0WVAX.INT.TELE.DK>
Subject: Re: solaris2.6 and inn2.2
Date: Thu, 22 Jun 2000 00:00:00 +0000
From: RULER OF ALL USENET <FLUFFIE@ILOVEYOU.int.tele.dk>
References: <7p9ae7$t3$1@news247.ctel.msk.ru> <brad-1608991750150001@brad.techos.skynet.be> <7p9d1j$10e$1@news247.ctel.msk.ru> <7pjoav$81v$1@nclient1-gui.server.ntli.net> <ylogg11udz.fsf@windlord.stanford.edu> <7puu0a$rl5$1@news.inet.tele.dk> <brad-2508990102400001@dialup446.brussels2.skynet.be> <yliu64pye5.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 637783850
X-Sender: FLUFFIE@ME0WVAX.INT.TELE.DK
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Complaints-To: Department of Beer <bitbucket@news.inet.tele.dk>
X-Trace: freebeer.netscum.dk 961707559 24575 193.163.158.4
Organization: Fluffy's Furbearers of Fortune
Mime-Version: 1.0
Newsgroups: news.software.nntp
X-Meow: bing-bong