dammIT

A rantbox

Thu 24 January 2008

Debugging for fun and profit

Posted by Michiel Scholten in posts   

Now and then I run into a crashed irssi. It crashes when the lag becomes way high [stupid adsl modem], or when doing an /upgrade or /quit. I narrowed it down to a Perl script I have that adds !command-style commands to irssi's list of commands for controlling a bot of mine.

So, I tried to debug it. I installed irssi on my laptop [normally, I have it 24/7 online in a screen session on my server], copied the config from my server and started to thinker around. As it segfaults, I would be able to get some info with gdb, so I tried to run irssi in gdb [gdb irssi]. That didn't work, as it didn't show an irssi window. So, I set ulimit -c unlimited in the bash terminal to be able to get a core dump, started irssi, logged into the channel, loaded the perl plugin and /quit. It neatly coredumped. Then I was able to do a gdb irssi ./core, which provided me some info. A bt didn't give me any useful info though. Also, the info gdb provided wasn't that useful because the binary I was running here [installed from the Debian repository] is stripped from debugging symbols... [And no irssi-dbg is provided]. Oh well, let's hope they fixed things in svn already [found a reference to other scripts segfaulting irssi similarly; an issue that seemed to be fixed for 0.8.13 in svn].

Someone have an idea what could cause the segfault? I think it has to do with the script adding commands, but how and why...

Comments