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

Re: [leafnode-list] 2.0b8_ma3 SIGPIPE?!



Raymond Scholz <rscholz@xxxxxx> writes:

> 2. Sometimes (read: once on every run) fetchnews segfaults.
[...]
> Full backtrace:
>
> Program received signal SIGPIPE, Broken pipe.
> 0x400b84e4 in write () from /lib/libc.so.6

SIGPIPE is completely different from SIGSEGV.

SIGPIPE may simply indicate that the connection no longer exists.
(Remote host closed connection?)

Run fetchnews with full debugging to see the NNTP commands sent.

$ nc news.nexgo.de nntp
200 newsread1.nexgo.de InterNetNews NNRP server INN 2.3.3 (20010624 prerelease) ready (posting ok).
503 Timeout after 10 seconds, closing connection.
$ nc news.nexgo.de nntp
200 newsread1.nexgo.de InterNetNews NNRP server INN 2.3.3 (20010624 prerelease) ready (posting ok).
group gnu.emacs.sources
480 Authentication required for command
quit
205 .
$

(The timeout seems to increase once I had sent any input.)

There is a problem with authentication in getfirstlast().
In fetchnews.c:413ff:

|     if (get_long(l, &n) && n == 480) {
|         if (authenticate())
|             putaline(nntpout, "GROUP %s", g->name);
|         else
|             return -1;
|     }
|     if (get_long(l, &n) && n == 411) {
|         /* group not available on server */
|         return -1;
|     }
|     if (sscanf(l, "%3ld %lu %lu %lu ", &n, &h, &window, last) < 4 || n != 211)
|         return FALSE;

fetchnews repeats the command, but doesn't read the server's
reply. sscanf() scans the buffer getaline() had put the first response
into. authenticate() uses getaline(), so the buffer may have been
overwritten or invalidated.

Stefan


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