building debugging symbol-enabled software in FreeBSD

Serious hackers/advanced users will know this, but in the event someone else is as clueless as I am and needs to generate a backtrace (aka stack trace/ or trace), this is what I ended up doing.

…[Switching to Thread 0x806f000 (LWP 100225)] 0x2847b90a in icaltzutil_fetch_timezone () from /usr/local/lib/libecal-1.2.so.7 (gdb) bt Well, that tells me where the bug is.

Serious hackers/advanced users will know this, but in the event someone else is as clueless as I am and needs to generate a backtrace (aka stack trace/ or trace), this is what I ended up doing.

make install WITH_DEBUG=1 FORCE_PKG_REGISTER=1

[From Bug 507579 – crash in e_timezone_dialog_set_timezone (zone=0x0) at e-timezone-dialog.c:693 (Evolution)]

I was seeing an instantaneous crash in evolution and when I reported, the developers asked for a trace. Hmm. It took awhile to look up how to do it (seems obvious now) but turns out the bug is actually in evolution-data-server.

I ran the debug version of evolution in gdb, the GNU debugger.

[/home/paul]:: gdb evolution GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you ar ewelcome to change it and/or distribute copies of it under certain conditions. Type “show copying” to see the conditions. There is absolutely no warranty for GDB. Type “show warranty” for details. This GDB was configured as “i386-marcel-freebsd”…

(gdb) r Starting program: /usr/local/bin/evolution

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x806f000 (LWP 100225)] 0x2847b90a in icaltzutil_fetch_timezone () from /usr/local/lib/libecal-1.2.so.7 (gdb) bt
Well, that tells me where the bug is.
% pkg_info -W /usr/local/lib/libecal-1.2.so.7 /usr/local/lib/libecal-1.2.so.7 was installed by package evolution-data-server-1.12.2

And now I know what application contains that chunk of code. So I built a debug version of it, and that was what was needed.

So always report bugs, even if the program isn’t one you rely on (I have never used evolution, but if I get it running, I might try it).

Leave a Reply

Your email address will not be published. Required fields are marked *