Ressources documentaires pour Mandriva Linux et les Logiciels Libres

Debugging applications crashes with GDB

Since the upgrade to GNOME 2.23, I’m unable to write emails with evolution. Each time I tried to write an email or reply to another one, evolution will crashed when trying to start the mail editor … In order to do a meaningful bug report, I’ve read the Analyzing a software crash HOWTO in Mandriva wiki. This is especially useful for cooker users. As gdb package was already installed on my system, at first I just need to add the _debug media in order to be able to install the -debug packages :
urpmi.addmedia main_debug
urpmi.addmedia contrib_debug

Then I installed just the evolution-debug package and start evolution with gdb like this :
gdb evolution
However many others -debug packages were missing, and gdb gave me the name of the packages to install. After a copy/paste, I installed all the missing packages. For the record, here is the command :
urpmi GConf2-debug ORBit2-debug aspell-debug at-spi-debug atk1.0-debug audiofile-debug avahi-debug cairo-debug cyrus-sasl-debug db46-debug dbus-debug dbus-glib-debug e2fsprogs-debug enchant-debug esound-debug evolution-data-server-debug fontconfig-debug freetype2-debug gamin-debug gcc-debug glib2.0-debug glibc-debug gnome-keyring-debug gnome-panel-debug gnome-vfs2-debug gnutls-debug gstreamer0.10-debug gtk+2.0-debug gtkhtml-3.14-debug gvfs-debug hal-debug ia_ora-gnome-debug krb5-debug libart_lgpl-debug libbonobo-debug libbonoboui-debug libgail-gnome-debug libgcrypt-debug libglade2.0-debug libgnome2-debug libgnomecanvas-debug libgnomeui2-debug libgpg-error-debug libice-debug libpng-debug libsm-debug libsoup-debug libtasn1-debug libvoikko-debug libx11-debug libxau-debug libxcb-debug libxcomposite-debug libxcursor-debug libxdamage-debug libxdmcp-debug libxext-debug libxfixes-debug libxi-debug libxml2-debug libxrandr-debug libxrender-debug libytnef-debug nspr-debug nss-debug nss_mdns-debug openssl-debug pango-debug pcre-debug pixman-debug rpm-debug zlib-debug

Once done, I start again gdb with evolution. At evolution crash, I enter the command thread apply all bt full to have the backtrace, however it was several lines long, and I couldn’t copy/paste the output easily for a bug report. The solution in this case is to run gdb in batch mode, and put in a file all the needed commands, and also redirected gdb output to a file. Here is the procedure :

  • create a file named for example evolution_gdb_cmd with the following content :
    thread apply all bt full
  • Then start gdb like this :
    gdb -batch -e evolution -x evolution_gdb_cmd > evolution_gdb_cmd.log

As you can see, gdb output will be redirected to evolution_gdb_cmd.log, and it will contain the full backtrace. now you just need to attached this file to the bug report.

Note : Please note that « thread apply all bt full » is used for threaded application. If there’s no thread in your application, you’d better use « bt full » instead.


Aucun commentaire jusqu'à présent.

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *


My Tweets