Open GoogleCodeExporter opened 9 years ago
OK, I'm out of my depths here, but since the backtraces always point to a
function in libcurl (not always the same function), and since the segfaults
would only happen when I have >1 thread, it didn't seem unreasonable to try out
the following patch to newsbeuter:
--- libnxml-0.18.1/xmlrss/nxml_download.c 2008-11-27 14:42:54.000000000 -0500
+++ libnxml-0.18.3/xmlrss/nxml_download.c 2008-08-21 17:55:49.000000000 -0400
@@ -76,6 +82,7 @@
curl_easy_setopt (curl, CURLOPT_URL, fl);
curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, __nxml_memorize_file);
curl_easy_setopt (curl, CURLOPT_FOLLOWLOCATION, 1);
+ curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt (curl, CURLOPT_FILE, (void *) chunk);
curl_easy_setopt (curl, CURLOPT_ENCODING, "gzip, deflate");
This one of the changes introduced in the move from libnxml 0.18.1, which
newsbeuter forks from, and libnxml 0.18.3, which is more recent. Googling says
the CURLOPT_NOSIGNAL flag has to do with whether libcurl is able to abort a
long DNS lookup by sending a signal. That's all I know.
But I can report that turning this flag on (and hence disabling libcurl's
ability to do those aborts) seems to cure my segfaults. I'll report back if
they reappear...but so far as I can now see, they're gone.
I don't know if this is the best long-term solution, since now my reloads take
a lot longer...
Original comment by prof...@jimpryor.net
on 30 Nov 2008 at 7:24
I wrote:
> since now my reloads take a lot longer...
In fact, sometimes they seem to be finishing promptly, other times they hang
indefinitely. If I do "newsbeuter -x reload -l6 -d LOGFILE" and do "tail -f
LOGFILE" in another terminal, I see that they're always hanging after printing
lines like this:
DEBUG: controller::reload: after internalize_rssfeed
This is with multiple threading enabled, and the CURLOPT_NOSIGNAL flag set as
decribed in the previous comment. Following some hints on the curl website, I
also recompiled my libcurl with c-ares support enabled (and recompiled
newsbeuter after doing so).
So I've made the segfaults go away but now sometimes (not always) a request to
"newsbeuter -x reload" will hang indefinitely...
Original comment by prof...@jimpryor.net
on 30 Nov 2008 at 11:35
Original issue reported on code.google.com by
prof...@jimpryor.net
on 30 Nov 2008 at 4:31