🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #20772

Re: nnrpd crashing...

#20772
From: Forrest J. Cavalier III
Date: Thu, 21 Aug 1997 00:00
64 lines
3062 bytes
In article <5tfs2m$54d$2@flood.xnet.com>, emarshal@logic.net wrote...
>
>Found a bug in article.c in INN 1.6b3. This is causing us much grief right
>now, and may actually be due to a misconfiguration on our end, but the
>problem is still there, regardless.
>
>Basically, the symptom was that connecting clients were getting dumped in
>the middle of transferring the headers of certain newsgroups (not all, and
>the ones that caused trouble were usually groups with a large number of
>unread articles). The problem turned out to be a segfault during execution
>of XOVER.
>
>Here's the gdb dump of what's happening:
>
>#0  0xef63a77c in atol ()
>#1  0x15124 in OVERfind (artnum=196701) at article.c:800
>#2  0x16030 in CMDxover (ac=2, av=0x4d8d0) at article.c:1103
>#3  0x1ce6c in main (argc=0, argv=0xeffffda4, env=0xeffffdac) at nnrpd.c:869
>
>At line 800 in article.c, we find:
>
>   800      for ( ; OVERarticle < artnum; OVERarticle = atol(OVERline))
>   801          if ((OVERline = QIOread(OVERqp)) == NULL) {
>   802              if (QIOtoolong(OVERqp))
>   803                  continue;
>   804              /* Don't close file; we may rewind. */
>   805              return NULL;
>   806          }
>
>atol() will segfault (at least under Linux ans Solaris) when the argument
>passed in is NULL; in this case, OVERline is getting set to NULL. Note,
>just before we get to line 800:
>
>   793      if (OVERarticle > artnum) {
>   794          (void)QIOrewind(OVERqp);
>   795          OVERlastarticle = 0;
>   796          OVERarticle = 0;
>   797          OVERline = NULL;
>   798      }
>
>Hence, OVERarticle is ending up greater than the current article number,
>and we're getting to this code. And, since OVERarticle will be 0, it will
>obviously be below artnum, so after the first iteration, the atol(NULL)
>call will be made.
>

Regardless of what happens in the code preceding it, the
The atol() is executed only after the first iteration through
the loop, which should set OVERline.  if QIOtoolong() returns
true, then you will get the failure.

I don't know what (if?) code in INN prevents .overview lines from
getting to be too long.   In any case, the code should be fixed
to handle that case anyway.

I'll get back to it, but you can hunt around for long lines in your 
.overview files to solve the immediate troubles.

Forrest Cavalier, Mib Software, INN customization and consulting
Commercial support for INN: http://www.mibsoftware.com/innsup.htm


Technical Details
Message-ID: <5thc7g$m49$1@news1.epix.net>
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: <5tfs2m$54d$2@flood.xnet.com>

Show Full Headers
Complete Article Headers
Message-ID: <5thc7g$m49$1@news1.epix.net>
Subject: Re: nnrpd crashing...
Date: Thu, 21 Aug 1997 00:00:00 +0000
From: mibsoft@epix.net (Forrest J. Cavalier III)
References: <5tfs2m$54d$2@flood.xnet.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.mbox.zip!not-for-mail
X-Deja-AN: 265692003
Organization: Mib Software
Newsgroups: news.software.nntp