Debugging Elfeed with DTrace

If you don’t follow Chris Wellons over at nullprogram.com, you really should. Wellons always has interesting posts, and often discusses fascinating technical details. He’s shown me how to do things that I didn’t know Emacs could do like rendering fractals. His posts on the Elfeed DSL implementation and working with Emacs strings are brilliant and every Elisp programmer should study them.

A while back, he got a bug report about Elfeed occasionally failing. The bug was not reproducible and Wellons couldn’t get it to happen on his machine at all. I’ve also never experienced it so it’s not common. That makes it particularly hard to debug.

Wellons knew that the problem was somewhere between Curl, which takes care of downloading the RSS XML, and Elfeed. It could be in Curl, in Emacs, or in Elfeed itself. Wellons realized pretty quickly that what he needed was DTrace but that’s not available on Linux, which he uses, so he decided to install FreeBSD on a Raspberry Pi that he had sitting around and do his debugging there. Serendipitously, that had the added benefit that it caused to bug fire reasonably reliability. Using DTrace, he was able to discover what was happening. Be sure to follow the link and discover what that was and see the details of his debugging. One of the unexpected benefits of his fix that affects us all is that Elfeed is now much faster. I saw a dramatic increase in the speed of Elfeed’s RSS downloading. Until I read his post, I didn’t know what had happened.

This is a great post and I learned some new things from it. You probably will too so it’s definitely worth your while.

Update [2018-01-25 Thu 13:03]: Insert missing comma so the sentence makes sense.

This entry was posted in General and tagged , . Bookmark the permalink.