[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] Segmentation error



Nicolas <oxstone@xxxxxxx> writes:

> Program received signal SIGSEGV, Segmentation fault.
> 0x4202d71f in __strtoul_internal () from /lib/i686/libc.so.6
> (gdb) backtrace full
> #0  0x4202d71f in __strtoul_internal () from /lib/i686/libc.so.6
> No symbol table info available.
> #1  0x0804b373 in getgroup (g=0x40265624, server=1)
>     at /usr/include/stdlib.h:308

I'm at a loss here, because the line number information is missing. The
getgroup function is rather longish, so I can't figure which of the many
strtoul calls barfed.

I *guess* it died around line 820, in art = strtoul(fields[0], &q, 10)
-- that'd match this line:

>         fields = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}

and the fact that t and l are non-NULL.

Anyways, I ask for two things:

1. unpack your leafnode-1.9.32 source (or reuse the old unpacked source)
   and patch it with this patch, then recompile (make) and reinstall
   leafnode (make install, do not use make install-strip), see below for
   instructions.

2. See the DEBUGGING section in the README file, it tells you how to
   configure your syslogd to log news output. Oh, and type "touch
   /var/log/news.all" before sending a -HUP to syslogd.

Just save this mail into your leafnode-1.9.32 as "patchmail", then cd
there and type "patch <patchmail", then type "make && make install".

Let me know what it logs, and if it still crashes. Of particular
interest are the "Error: got unparsable XOVER line from server"
lines. By all means, NEVER use cut and paste, but redirect output to a
file, edit the output file (cut irrelevant parts) and use the "insert
file" function of your editor, if in doubt, uuencode.

If you want to attach a file, send it to my private address, the mailing
list software doesn't handle attachments. (it is going to be exchanged
real soon now).

--- ./fetchnews.c.orig	2003-01-15 23:58:57 +0100
+++ ./fetchnews.c	2003-01-15 23:59:30 +0100
@@ -797,7 +797,10 @@
 	    unsigned long art;
 	    const char *t;
 	    char *q;
+	    static mastr *ol;
+	    if (!ol) ol = mastr_new(1024);
 
+	    mastr_cpy(ol, l);
 	    /* split xover */
 	    /*@+loopexec@*/
 	    for (i = 0; l && l[0] && i < HD_MAX; i++) {
@@ -807,12 +810,20 @@
 		    y[0] = '\0';
 		    l = y + 1;
 		} else {
-		    l = 0;
+		    l = NULL;
 		};
 	    };
 	    /*@=loopexec@*/
+	    /* short line -- log and skip */
+	    if (i < 8) {
+		ln_log(LNLOG_SERR, LNLOG_CTOP,
+			"%s: Error: got unparsable XOVER line from server, "
+			"too few fields (%ld): \"%s\"",
+			current_server->name, i, mastr_str(ol));
+		continue;
+	    }
 	    for (; i < HD_MAX; i++)
-		fields[i] = 0;
+		fields[i] = NULL;
 	    art = strtoul(fields[0], &q, 10);
 	    if (q && art >= server && art <= last &&
 		stat(t = lookup(fields[h_mid]), &st) != 0) {


-- 
Matthias Andree
leafnode-1 download: http://sourceforge.net/projects/leafnode/
leafnode-1 docs/new: http://mandree.home.pages.de/leafnode/
leafnode-2 homepage: http://mandree.home.pages.de/leafnode/beta/

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list