My Liferea crashes are not Liferea's fault

November 19, 2011

Back in Fedora15VsMe I said bad things about the current version of Liferea, especially that it was crash-prone. I have been trying to debug these crashes ever since they started, and I now believe that this is not Liferea's fault; instead it is a bug in the underlying GLib IO library that it is using. For the benefit of anyone else hitting this who is doing Internet searches, I will describe the crash and the bug.

All of my crashes have been directly in g_tls_client_connection_gnutls_finish_handshake() (which is part of libgiognutls, a GIO module), in a call chain that eventually runs through g_io_stream_dispose() (all of this is obtained from running the latest git version of Liferea under gdb). The TLS routine crashes because it is trying to dereference a NULL pointer (inout_error in the source code Fedora 15 uses, which is a GError **). This pointer is ultimately NULL because g_io_stream_dispose() calls g_io_stream_close() with a null error parameter. However, the documentation for g_io_stream_close() is very clear that the error parameter may be NULL (which means to not try to store any information about any errors that happen).

(It's not clear where inside libgiognutls the bug actually lies. Clearly something is making an assumption that there's always a place to put an error, but it may be a higher level function involved in closing down connections. Oh, and now that I've started doing web searches on the TLS routine's name, I've found Debian bug #628068 and it appears that the glib-networking people fixed this in August.)

Diagnosing all of this was made much easier by how Fedora handles their 'debuginfo' packages. Before I started doing this, I had the vague impression that debuginfo packages simply had the symbol tables for the various libraries and programs, so that gdb could give you symbolic backtraces and so on. As I've discovered, this is not all that you get with debuginfo packages; you also get the full source for the package in /usr/src/debug. Oh, and of course gdb knows where to find the source so you get full source listings in stack backtraces and so on.

Having full source immediately available (once you find it) is a big boost to tracking down things like this. I'm not sure I would have bothered to dig into this issue very much if I hadn't had the source code there to browse; sure, I could get it by fetching source RPMs and unpacking them and so on, but that's enough extra work that I might well have not bothered.

(On the flipside, had I not taken the system programmer approach I might have immediately Googled the TLS routine's name and found out much of this information.)

Hunting down the source of https URLs in my feeds turned out to be somewhat more work than I expected. I had one live feed that had switched to https; since it was just something that I inherited from the default feed list of a very old version of liferea, I removed it. Then there were a few feeds from very dead sites that were now redirecting to https versions of domain parking sites. It's possible that there will still be crashes if feed entries try to include things like images via HTTPS URLs, but I'll have to see.

Written on 19 November 2011.
« The drawback of modern X font handling
Google Groups fails both anti-spam and basic mailing list management »

Page tools: View Source, Add Comment.
Login: Password:
Atom Syndication: Recent Comments.

Last modified: Sat Nov 19 01:49:16 2011
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.