<<< Date Index >>>     <<< Thread Index >>>

Re: how to debug (and fix) mutt?



Gary Johnson wrote:
On 2006-02-23, Bram Mertens <bram-mertens@xxxxxxxx> wrote:

On 2006-02-22, Gary Johnson wrote:

On 2006-02-22, Bram Mertens <bram-mertens@xxxxxxxx> wrote:


Can I add some options to add more logging? Mutt is unusable like this at the moment.

If you configured mutt with --enable-debug, mutt should dump a debuggable core file when it segfaults. The stack backtrace from the core file may provide more insight than the log file.

According to the debian/rules file below the mutt source dir mutt is
built with --enable-debug but no core file is produced.  At least not
where I'm looking for it, core files are dumped in the current dir,
right?


Right.


Can I start mutt from a debugger to get a stacktrace that way?


If you just want a stack backtrace, follow Toby's suggestions. You can also get a stack backtrace by running mutt from gdb. The way I prefer doing it, unless I'm debugging a startup problem, is to start mutt in one xterm, then use ps to find mutt's process ID and attach to it from a gdb running in a different xterm.

OK, I got a core file following Toby's instructions and when I run gdb mutt and start it with run -d 3 mutt starts.
After the segfault I entered bt and got the following:
(gdb) bt
#0  0xb7cf6aa8 in strncpy () from /lib/tls/i686/cmov/libc.so.6
#1  0x080d8943 in ?? ()
#2  0x00000000 in ?? ()

and when I run gdb -c core I get:
0:m8ram@valinor:~$ gdb -c core
GNU gdb 6.4-debian
Copyright 2005 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome 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 "i486-linux-gnu".
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
Core was generated by `mutt -d 9'.
Program terminated with signal 11, Segmentation fault.
#0  0xb7cffaa8 in ?? ()
(gdb) bt
#0  0xb7cffaa8 in ?? ()
(gdb)

I'm not used to gdb so I may still be missing something, if so please let me know.

Can anybody use the core file created?

Regards

Bram