Re: (fwd) Bug#557528: tin: feed_articles() segfaults on spurious SIGPIPE
Dennis Preiser <[email protected]> Tue, 24 Nov 2009 21:36:29 +0100
| Newsgroups | gmane.network.tin.devel |
|---|---|
| Message-ID | <[email protected]> |
On 22.11.2009, at 20:11, Urs Janßen wrote:
> I'm seeing (very) infrequent segfaults when feed-saving articles.
> Apparently, this occurs when tin gets a SIGPIPE, probably from writing
> to the network socket. (I have a very flaky DSL, so it's quite
> possible
> the connection sometimes get dropped just when tin is about to write.)
>
> When that happens, pclose(pipe_fp) will segfault, since pipe_fp is
> NULL.
> ----- End forwarded message -----
When receiving SIGPIPE, got_sig_pipe becomes TRUE in
signal.c:signal_handler().
feed.c:feed_articles() calls handle_SIGPIPE() which expands to:
if (got_sig_pipe) goto got_sig_pipe_while_piping
Changing the macro to:
if (got_sig_pipe) { \
if (function == FEED_PIPE) \
goto got_sig_pipe_while_piping; \
else \
got_sig_pipe = FALSE; \
}
might solve this issue. The "goto" is only useful when 'pipe'ing
articles (FEED_PIPE). Other FEED_* functions must not jumpt to the
label.
Dennis