🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.readers
3 messages
3 total messages Started by Wayne Davison Sun, 03 Oct 1993 17:59
mthreads crash in comp.sys.laptops
#6141
Author: Wayne Davison
Date: Sun, 03 Oct 1993 17:59
63 lines
2808 bytes
There's a bug in mthreads that has probably been around since version 1.0
when it parses more than 1024 bytes of references.  There's an article that
recently arrived in comp.sys.laptops that triggers this bug because there is
no space between the header and the article body and the entire article is
indented by whitespace (which is the indication of a continuation line).

The following patch can be directly applied to mthreads 3.x.  It can also
be hand-applied with only minor tweaks to any mthreads 2.x.  I've extended
the continuation-line checking in the references code to hopefully ignore
more of these bogus continuation headers in the future.

This patch will soon show up in an official release of mthreads (I wish I
had found this article before releasing version 3.1 the other day).

Index:mt-process.c
@@ -195,8 +195,8 @@
 	    } else
 	    if (len == 10 && strEQ(cp, "references")) {
+		int ref_len;
 		/* include preceding space in saved reference */
-		len = strlen(str + 1);
-		bcopy(str + 1, references, len + 1);
-		str = references + len;
+		ref_len = strlen(str + 1);
+		bcopy(str + 1, references, ref_len + 1);
 		/* check for continuation lines */
 #ifdef USE_NNTP
@@ -205,5 +205,5 @@
 		while ((cp = fgets(buf, sizeof buf, fp_article)) != Nullch) {
 #endif
-		    if (*cp != ' ' && *cp != '\t') {
+		    if ((*cp != ' ' && *cp != '\t') || !index(cp, '<')) {
 			goto process_line;
 		    }
@@ -212,13 +212,20 @@
 		    }
 		    *--cp = ' ';
+#ifdef USE_NNTP
+		    len = strlen(cp);
+#else
+		    len = strlen(cp) - 1;
+		    cp[len] = '\0';	/* remove newline */
+#endif
+		    str = references + ref_len;
 		    /* If the references are too long, shift them over to
 		    ** always save the most recent ones.
 		    */
-		    if ((len += strlen(cp)) > 1023) {
-			strcpy(buf, buf + len - 1023);
-			str -= len - 1023;
-			len = 1023;
+		    if ((ref_len += len) > 1023) {
+			strcpy(references, references + ref_len - 1023);
+			str -= ref_len - 1023;
+			ref_len = 1023;
 		    }
-		    strcpy(str, cp);
+		    bcopy(cp, str, len + 1);
 		}/* while */
 		break;
-- 
Wayne Davison
davison@borland.com
Re: mthreads crash in comp.sys.laptops
#6181
Author: Martin J. Dellwo
Date: Wed, 06 Oct 1993 13:23
13 lines
1344 bytes
What are the symptoms of this problem?  I've had trn 3.3 crash out
(nicely) while threading a large newsgroup.  I remotely access news
via NNTP and don't use mthreads but do threading on the fly.  I can't
remember the exact error message, but it catches some signal, restores
.newsrc and exits.

-M
-- 
Martin J. Dellwo     (215) 983-7396
E-mail:  r06a661@bcc26.kodak.com, mdellwo@Kodak.COM
Biophysics and Computational Chemistry
Sterling Winthrop Pharmaceuticals Research Division
Re: mthreads crash in comp.sys.laptops
#6182
Author: Wayne Davison
Date: Wed, 06 Oct 1993 18:45
18 lines
1501 bytes
According to Martin J. Dellwo <r06a661@bcc26.kodak.com>:
> What are the symptoms of this problem?  I've had trn 3.3 crash out
> (nicely) while threading a large newsgroup.

It doesn't affect trn at all.  If mthreads overflows its references
buffer it trashes a pointer or three and exits with some sort of
SIGSEV catch (mt.check would report the "severe signal" to the news
admin and they'd know to restart mthreads and check if there was a
problem).

If you have a crash situation for trn, please find a reproducible case
and let me know about it.  The easiest way for me to duplicate problems
such as this is for you to send me a compressed/uuencoded version of the
overview file for the group (it is easy to fake one if you don't actually
use overview files) and the line for the group out of your .newsrc file.
-- 
Wayne Davison
davison@borland.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads