Development/Tutorials/Debugging/How to create useful crash reports (fr): Difference between revisions

From KDE TechBase
(Created page with '[email protected] Bonjour, Aspire one 751h-52Bk model ZA3 Application: kttsd (kttsd), signal: Aborted [Current thread is 1 (Thread 0xb5b316d0 (LWP 23263))] Thread...')
 
(Start translaction)
Line 1: Line 1:
{{Template:I18n/Language Navigation Bar|Development/Tutorials/Debugging/How to create useful crash reports}}
==Introduction==


Ce document décrit la façon de reproduire une backtrace utile de planter les applications KDE. Tout d'abord, quelques informations générales est donné. Puis, nous allons décrire pour plusieurs distributions de la façon de préparer vos paquets KDE et de gagner la backtrace. Cela devrait être suffisant pour la plupart des gens.
Il ya des sections supplémentaires sur la façon de créer backtraces avec le débogueur GNU et avec Valgrind, qui sont parfois utiles.


==Comment créer des rapports de bug utiles==


A good crash report at [http://bugs.kde.org Bugzilla] consists of two parts: a '''description''' of how to reproduce the crash and a '''backtrace''' of the crash. With one of those elements missing, it is much harder (if not impossible) for developers to tackle the problem.


A description should consist of more than only "it crashed". Try to describe everything you did prior to the crash. Did you click on a button, opened a particular website or file which caused problems? That little detail which may look useless to you may be useful for the developer, so just write it down.


Bonjour,
A more insightful article on how to write good bug descriptions is available [http://www.chiark.greenend.org.uk/~sgtatham/bugs.html at this link], please read that before reporting bugs.


Don't attach the backtrace to the bug report. Instead, simply paste it. This way it is much easier for developers to search for duplicate reports, because attachments will not be searched.


Aspire one 751h-52Bk  model ZA3
If you paste a backtrace to a report, make sure you strip all but one or two of the
(no debugging symbols found)
lines from the backtrace as they make it harder to read.


Even though pasting backtraces directly is preferred over adding an attachment, please do not paste other things like logs (valgrind, strace or terminal output) or example data (mails, HTML files and so on). Use attachments for these items.


===Backtraces===


Application: kttsd (kttsd), signal: Aborted
Backtraces are essential. They may look meaningless to you, but they might actually contain a wealth of useful information. A backtrace describes which functions were called prior to the crash, so that developers may track down in which function the mess started. Having good backtraces has a downside: [[Development/Tutorials/Debugging/Debugging_symbols|libraries and executables occupy much more disk space than their optimized counter parts]]. That's the reason why many distros choose to install stripped files, '''which results in useless backtraces''':
[Current thread is 1 (Thread 0xb5b316d0 (LWP 23263))]


Thread 44 (Thread 0xb3dfcb70 (LWP 23337)):
(no debugging symbols found)
#0 0xb67318bf in __pthread_mutex_unlock_full () from /lib/i686/libpthread.so.0
  Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
#1 0xb68278f6 in pthread_mutex_unlock () from /lib/i686/libc.so.6
(no debugging symbols found)
#2 0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
(no debugging symbols found)
#3 0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
(no debugging symbols found)
#4 0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
(no debugging symbols found)
#5 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
(no debugging symbols found)
#6 0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
(no debugging symbols found)
#7 0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
(no debugging symbols found)
#8 0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
[Thread debugging using libthread_db enabled]
#9 0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
[New Thread -1233848624 (LWP 12212)]
#10 0xb681957e in clone () from /lib/i686/libc.so.6
  [New Thread -1255081072 (LWP 12820)]
  [New Thread -1240921200 (LWP 12819)]
[New Thread -1266680944 (LWP 12818)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
  0xffffe410 in __kernel_vsyscall ()
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb6a1210b in ?? () from /lib/tls/i686/cmov/libpthread.so.0
#2 0xb6a85afe in ?? () from /usr/lib/libX11.so.6
#3 0x00000003 in ?? ()
#4 0x082149c0 in ?? ()
#5 0x00003ffc in ?? ()
#6  0x00000000 in ?? ()


Thread 43 (Thread 0xb2eeab70 (LWP 23490)):
But no worries, with some modifications you can create full blown backtraces for KDE applications.
#0  0xb31cd053 in ?? () from /usr/lib/libpulse.so.0
#1  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#2  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#3  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#4  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#5  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#6  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#7  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 42 (Thread 0xb1ee8b70 (LWP 23683)):
===Preparing your KDE packages===
#0  0xb6731aec in __pthread_mutex_unlock_full () from /lib/i686/libpthread.so.0
#1  0xb68278f6 in pthread_mutex_unlock () from /lib/i686/libc.so.6
#2  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 41 (Thread 0xb16e7b70 (LWP 23808)):
If your distribution has debugging-enabled packages, install them.
#0  0xb67318e1 in __pthread_mutex_unlock_full () from /lib/i686/libpthread.so.0
#1  0xb68278f6 in pthread_mutex_unlock () from /lib/i686/libc.so.6
#2  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 40 (Thread 0xb0ee6b70 (LWP 23855)):
It is easy to see which debug packages you are missing from looking at the backtrace. For example, take the following line from a backtrace:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 39 (Thread 0xb06e5b70 (LWP 23904)):
  #6  0xb7975bdc in ?? () from /usr/lib/libkmailprivate.so.4
#0 0xb6827af4 in ?? () from /lib/i686/libc.so.6
#1  0xb680e258 in poll () from /lib/i686/libc.so.6
#2 0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 38 (Thread 0xafee4b70 (LWP 23955)):
The <tt>??</tt> indicates that the library <tt>libkmailprivate.so.4</tt> does not have debug information, which might be available in separate debug packages. In this case, it is pretty easy to guess that you need to install debug packages for KMail to get a better backtrace.
#0  0xffffe414 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 37 (Thread 0x96e49b70 (LWP 24021)):
Sometimes, you need to install more than one debug package to get a good backtrace. This depends on how the distribution splits up the packages. For example, for some distributions it is enough to install the debug package for <tt>kdepim</tt> to get enough debugging information for a crash in KMail, for other distributions there is an additional debug package just for KMail.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 36 (Thread 0x92647b70 (LWP 24142)):
Here's a list of how to obtain debug packages for some distributions:
#0  0xb67307bd in __pthread_mutex_lock_full () from /lib/i686/libpthread.so.0
#1  0xb68278b6 in pthread_mutex_lock () from /lib/i686/libc.so.6
#2  0xb31883ff in pa_mutex_lock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd0a0 in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 35 (Thread 0x8de45b70 (LWP 24183)):
*'''Debian''' - Debian offers <tt>-dbg</tt> packages to easy create useful backtraces. Just install the corresponding <tt>-dbg</tt> package. e.g. <tt>kdepim-dbg</tt> for KMail crashes. The dependencies of -dbg makes sure to pull in the other right packages (kdelibs-dbg, gdb, and so on).
#0  0xb68278f4 in pthread_mutex_unlock () from /lib/i686/libc.so.6
<!--*'''Fedora''' ???-->
#1  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
*'''FreeBSD ports''' - Please refer to the [http://freebsd.kde.org/faq.php#AKDEapplicationcrashedandIwanttofileabugreportathttpbugskdeorgbutthebacktraceintheKDECrashManagerisuselessWhatcanIdo KDE on FreeBSD FAQ].
#2  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
*'''Gentoo''' - Gentoo has its [http://www.gentoo.org/proj/en/qa/backtraces.xml own document] describing how to proceed.
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
*'''Mandriva''' - Mandriva 2007.0 and up has additional debugging packages for all of KDE (in fact, for all of its packages). Just install the corresponding <tt>-debug</tt> package, like <tt>kdebase-debug</tt> and <tt>kdemultimedia-debug</tt>. You probably want to install <tt>kdelibs-debug</tt> anyways.
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
** Note: the <tt>-debug</tt> packages are in separate repositories. For instance, for all packages in <tt>main</tt>, you'll find the debugging package in repository <tt>debug_main</tt>.
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
*'''Kubuntu/Ubuntu''' - The Ubuntu family makes things quite easy. Every official KDE module has an additional package in the repository, suffixed with <tt>-dbg</tt>. Always install <tt>kdelibs5-dbg</tt>, because all KDE applications use kdelibs (kdelibs-dbg for KDE 3 applications). Then you should install a -dbg package for the application which crashed. For example if KOrganizer crashed you should install <tt>kdepim-dbg</tt> as well.  If the program is not from an official KDE module and has no -dbg package, you can install the -dbgsym package from the repository listed on this [https://wiki.kubuntu.org/DebuggingProgramCrash Debugging Program Crashes] page.
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
*:During the Ubuntu development cycle the Apport crash handler is turned on which will report crashes to launchpad.net and do the backtrace for you, if you would rather use the KDE crash handler turn Apport off in /etc/defaults/apport
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
*'''openSUSE''' - You should only install the <tt>-debuginfo</tt> packages, for example: <tt>kdepimlibs4-debuginfo</tt>. You can find these packages in [http://en.opensuse.org/KDE/Repositories KDE repositories]. There is also a dedicated [http://en.opensuse.org/Bugs:An_application_crashed openSUSE debugging page].
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
*'''Fedora''' - Fedora has its [http://fedoraproject.org/wiki/StackTraces own document] describing how to proceed. (A debuginfo repository has to be enabled.)
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 34 (Thread 0x89643b70 (LWP 24190)):
If your distribution doesn't have debugging-enabled packages for KDE, you'll have to compile KDE from sources:
#0  0xb68278da in pthread_mutex_unlock () from /lib/i686/libc.so.6
#1  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
#2  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 33 (Thread 0xb26e9b70 (LWP 24202)):
* If you're using KDE 3, then at the configure stage, you should supply the parameter <tt>--enable-debug=full</tt> in order to build debug symbols in the resulting files.
#0  0xb6827ae3 in ?? () from /lib/i686/libc.so.6
* If you're using KDE 4, then at the cmake stage, you should supply the parameter <tt>-DCMAKE_BUILD_TYPE=debugfull</tt>If you want to specify your own CXXFLAGS, then use <tt>-DCMAKE_BUILD_TYPE=None CMAKE_CXX_FLAGS="-O0 -g"</tt>You can change the CMAKE_CXX_FLAGS as appropriate for your needs.
#1  0xb680e258 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5 0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 32 (Thread 0x84e41b70 (LWP 24211)):
Then it's just <tt>make</tt> and <tt>make install</tt> as you're used to.
#0  0xb673062f in __pthread_mutex_lock_full () from /lib/i686/libpthread.so.0
#1  0xb68278b6 in pthread_mutex_lock () from /lib/i686/libc.so.6
#2  0xb31883ff in pa_mutex_lock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd0a0 in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 31 (Thread 0x7be3db70 (LWP 24217)):
===Crash!===
#0  0xb6827acf in ?? () from /lib/i686/libc.so.6
#1  0xb680e258 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 30 (Thread 0x8063fb70 (LWP 24274)):
Now it's time to crash your application. The KDE Crash Dialog should appear right after the crash, which shows the Backtrace tab.
#0  0xb6827b5b in ?? () from /lib/i686/libc.so.6
#1  0xb680e230 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 29 (Thread 0x72e39b70 (LWP 24282)):
[[Image:Kde-crash-handler.png|center|300px|KDE Crash Dialog]]
#0  0xb31baa40 in pa_mainloop_prepare () from /usr/lib/libpulse.so.0
#1  0xb31bb90f in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#2  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#3  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#4  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#5  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#6  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 28 (Thread 0x6e637b70 (LWP 24383)):
Click that tab and wait for a minute. This process may take quite some memory, so things may go sluggish all of a sudden. But the result should look much better. For example:
#0  0xb6827acf in ?? () from /lib/i686/libc.so.6
#1  0xb680e258 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 27 (Thread 0x69e35b70 (LWP 24431)):
Using host libthread_db library "/lib/libthread_db.so.1".
#0 0xb673062c in __pthread_mutex_lock_full () from /lib/i686/libpthread.so.0
[Thread debugging using libthread_db enabled]
#1 0xb68278b6 in pthread_mutex_lock () from /lib/i686/libc.so.6
[New Thread -1232783168 (LWP 7604)]
#2  0xb31883ff in pa_mutex_lock () from /usr/lib/libpulsecommon-0.9.16.so
[KCrash handler]
#3  0xb31cd0a0 in ?? () from /usr/lib/libpulse.so.0
#6  0x0806be76 in TreeMapItem::parent (this=0x0)
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.h:285
#5 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#7  0x08065fea in TreeMapItemList::compareItems (this=0xbfec04a8, item1=0x0,
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
    item2=0x0)  
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.cpp:720
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8 0xb7281619 in QGList::operator== () from /usr/qt/3/lib/libqt-mt.so.3
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9 0x0806d498 in QPtrList<TreeMapItem>::operator== (this=0xbfec04a8,
#10 0xb681957e in clone () from /lib/i686/libc.so.6
    list=@0xbfec0468) at /usr/qt/3/include/qptrlist.h:74
#10 0x08062e18 in TreeMapWidget::mousePressEvent (this=0xbfec03ac,
    e=0xbfebff1c)
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.cpp:1840
#11 0xb7004a63 in QWidget::event () from /usr/qt/3/lib/libqt-mt.so.3
#12 0xb6f6bca7 in QApplication::internalNotify ()  
    from /usr/qt/3/lib/libqt-mt.so.3
#13 0xb6f6ca88 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3
#14 0xb7725a84 in KApplication::notify (this=0xbfec055c, receiver=0xbfec03ac,
    event=0xbfebff1c)
    at /home/bram/KDE/kde3/kdelibs/kdecore/kapplication.cpp:550
  #15 0xb6f0bfd2 in QETWidget::translateMouseEvent ()  
    from /usr/qt/3/lib/libqt-mt.so.3
#16 0xb6f0b8b0 in QApplication::x11ProcessEvent ()  
    from /usr/qt/3/lib/libqt-mt.so.3
#17 0xb6f1b761 in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3
#18 0xb6f82831 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3
#19 0xb6f826b6 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3
#20 0xb6f6b72f in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3
#21 0x0805181e in main (argc=134673960, argv=0xffffffff)
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/main.cpp:55


Thread 26 (Thread 0x65633b70 (LWP 24521)):
This looks better, right? It shows memory addresses, the source files and line numbers and the parameters passed to functions. Which make it more helpful to the developer where to look for the problem.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 25 (Thread 0x7763bb70 (LWP 24553)):
{{note|You '''need''' GDB installed to get the backtrace of a crash. Please read the next section to know what GDB is, and how to install it.}}
#0  0xb680e23a in poll () from /lib/i686/libc.so.6
#1  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#2  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#3  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#4  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#5  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#6  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#7  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#8  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 24 (Thread 0x5c62fb70 (LWP 24580)):
===Retrieving a backtrace with GDB===
#0  0xb680e1f9 in poll () from /lib/i686/libc.so.6
#1  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#2  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#3  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#4  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#5  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#6  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#7  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#8  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 23 (Thread 0x57e2db70 (LWP 24589)):
In some cases, it is not possible to create a backtrace with the KDE Crash Dialog. This may be caused by an application which entered an infinite loop, or the crash dialog did not appear at all for some reason. You can try to grab a backtrace with <tt>gdb</tt>, the [http://sourceware.org/gdb/ GNU Debugger]. GDB is widely available through distribution packages.
#0  0xb6827afb in ?? () from /lib/i686/libc.so.6
#1  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#2  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#3  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#4  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#5  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#6  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#7  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#8  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 22 (Thread 0x4ee29b70 (LWP 24641)):
Invoking GDB differs from the situation. You can run an application from inside gdb, or attach gdb to an already running process. The latter may be useful when an application already has entered an infinite loop. But we will first start with running an application inside gdb. From the shell, run:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 21 (Thread 0x60e31b70 (LWP 24693)):
  $ gdb someKDEapp
#0 0xb6827ae3 in ?? () from /lib/i686/libc.so.6
#1  0xb680e258 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 20 (Thread 0x4a627b70 (LWP 24776)):
The GDB prompt will appear. Note that this does not start the application itself, you should run it by invoking the <tt>run</tt> command:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 19 (Thread 0x45e25b70 (LWP 24840)):
  (gdb) run
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 18 (Thread 0x41623b70 (LWP 24920)):
This will run the application like you are used to, and you can work with it like normal (it only consumes far more memory and may feel sluggish). Now it's time to reproduce your crash. When you succeed, the application just closes and you should return to your GDB prompt. Now it's time to run the 'backtrace' command:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 17 (Thread 0x3ce21b70 (LWP 24970)):
{{note|Some KDE applications (such as JuK and KTorrent) have special code to ensure that there is only one running instance of the application at a timeFor these applications you should type in "run --nofork" at the (gdb) prompt instead of "run" because otherwise gdb will try to debug the wrong processIf you are unsure as to whether to use --nofork just try itIf the application says it's an unknown option you can remove --nofork.}}
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2 0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4 0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5 0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 16 (Thread 0x3861fb70 (LWP 25027)):
  (gdb) thread apply all backtrace
#0 0xb6731aff in __pthread_mutex_unlock_full () from /lib/i686/libpthread.so.0
#1  0xb68278f6 in pthread_mutex_unlock () from /lib/i686/libc.so.6
#2  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 15 (Thread 0x33e1db70 (LWP 25083)):
This should give a good backtrace which can be posted at the KDE Bugzilla.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 14 (Thread 0x2f61bb70 (LWP 25165)):
In case you want to attach to an existing process, run the following command in the shell:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 13 (Thread 0x5362bb70 (LWP 25209)):
  $ gdb someKDEapp pid
#0 0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 12 (Thread 0x26617b70 (LWP 25259)):
where ''pid'' is the process ID of the process you want to attach to. Once attached, and the process is in an infinite loop, after using the 'backtrace' command again a useful backtrace will appear. You can use 'continue' command to let the application run again and press Ctrl+C in gdb to be able to again enter commands.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 11 (Thread 0x21e15b70 (LWP 25312)):
===Retrieving a backtrace with Valgrind===
#0  0xb6731aea in __pthread_mutex_unlock_full () from /lib/i686/libpthread.so.0
#1  0xb68278f6 in pthread_mutex_unlock () from /lib/i686/libc.so.6
#2  0xb318822f in pa_mutex_unlock () from /usr/lib/libpulsecommon-0.9.16.so
#3  0xb31cd07a in ?? () from /usr/lib/libpulse.so.0
#4  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#5  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#6  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#7  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#8  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#9  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#10 0xb681957e in clone () from /lib/i686/libc.so.6


Thread 10 (Thread 0x1d613b70 (LWP 25366)):
When it comes to crashes, [http://www.valgrind.org Valgrind] is also a useful tool to create a backtrace. It's not a substitution for GDB, but rather a supplement.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 9 (Thread 0x18e11b70 (LWP 25418)):
When you run an application in valgrind, every piece of memory read or written by the application is being checked. Valgrind will report erroneous memory operations in the standard output or in a log file. Since most crashes are due to an invalid memory read, valgrind can be useful to track down where the problem occurs.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 8 (Thread 0x2ae19b70 (LWP 25477)):
{{note|Valgrind consists of several tools in order to check or profile an application. For this article, we only use memcheck, the default tool when valgrind is being invoked.}}
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 7 (Thread 0x1460fb70 (LWP 25548)):
Like GDB, Valgrind makes running an application much slower, while consuming a lot more resources.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 6 (Thread 0xfe0db70 (LWP 25584)):
Start the application within valgrind:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb680e246 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 5 (Thread 0xae0ab70 (LWP 25643)):
  $ valgrind --log-file=someKDEapp someKDEapp
#0 0xb6827b5b in ?? () from /lib/i686/libc.so.6
#1  0xb680e230 in poll () from /lib/i686/libc.so.6
#2  0xb31cd096 in ?? () from /usr/lib/libpulse.so.0
#3  0xb31ba1f0 in pa_mainloop_poll () from /usr/lib/libpulse.so.0
#4  0xb31bb91d in pa_mainloop_iterate () from /usr/lib/libpulse.so.0
#5  0xb31bb9f4 in pa_mainloop_run () from /usr/lib/libpulse.so.0
#6  0xb31ccf7e in ?? () from /usr/lib/libpulse.so.0
#7  0xb31892a3 in ?? () from /usr/lib/libpulsecommon-0.9.16.so
#8  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#9  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 4 (Thread 0xb60bb70 (LWP 25694)):
Now reproduce the crash. As soon as this happens, the application and valgrind will terminate. What's left is a file named <tt>someKDEapp.pid</tt> where ''pid'' is replaced by the process ID of the valgrind process. The file may list more errors than the one causing the crash. Here's the bit causing the crash which corresponds to the GDB backtrace above:
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb67329e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0xb68276ed in pthread_cond_wait () from /lib/i686/libc.so.6
#3  0xb3319afe in ?? () from /usr/lib/libgstreamer-0.10.so.0
#4  0xb331b218 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#5  0xb5eeaa37 in ?? () from /usr/lib/libglib-2.0.so.0
#6  0xb5ee9364 in ?? () from /usr/lib/libglib-2.0.so.0
#7  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#8  0xb681957e in clone () from /lib/i686/libc.so.6


Thread 3 (Thread 0x9e08b70 (LWP 25695)):
==23292== Invalid read of size 4
#0 0xffffe424 in __kernel_vsyscall ()
==23292==    at 0x806BD9E: TreeMapItem::parent() const (treemap.h:285)
#1  0xb67329e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
==23292==    by 0x8065FB9: TreeMapItemList::compareItems(void*, void*) (treemap.cpp:720)
#2 0xb68276ed in pthread_cond_wait () from /lib/i686/libc.so.6
  ==23292==    by 0x50AC618: QGList::operator==(QGList const&) const (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
#3 0xb3319afe in ?? () from /usr/lib/libgstreamer-0.10.so.0
  ==23292==    by 0x806D3BF: QPtrList<TreeMapItem>::operator==(QPtrList<TreeMapItem> const&) const (qptrlist.h:74)
#4 0xb331b218 in ?? () from /usr/lib/libgstreamer-0.10.so.0
==23292==    by 0x8062DE7: TreeMapWidget::mousePressEvent(QMouseEvent*) (treemap.cpp:1840)
#5 0xb5eeaa37 in ?? () from /usr/lib/libglib-2.0.so.0
  ==23292==    by 0x4E2FA62: QWidget::event(QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
#6 0xb5ee9364 in ?? () from /usr/lib/libglib-2.0.so.0
  ==23292==    by 0x4D96CA6: QApplication::internalNotify(QObject*, QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
#7 0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
  ==23292==    by 0x4D97A87: QApplication::notify(QObject*, QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
#8 0xb681957e in clone () from /lib/i686/libc.so.6
==23292==    by 0x4809AC3: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:550)
  ==23292==    by 0x4D36FD1: QETWidget::translateMouseEvent(_XEvent const*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
  ==23292==    by 0x4D368AF: QApplication::x11ProcessEvent(_XEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
  ==23292==    by 0x4D46760: QEventLoop::processEvents(unsigned) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==  Address 0x2C is not stack'd, malloc'd or (recently) free'd


Thread 2 (Thread 0xa609b70 (LWP 25696)):
But to be sure, just attach the whole log file to the crash report.
#0  0xffffe424 in __kernel_vsyscall ()
#1  0xb67329e5 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/i686/libpthread.so.0
#2  0xb68276ed in pthread_cond_wait () from /lib/i686/libc.so.6
#3  0xb3319afe in ?? () from /usr/lib/libgstreamer-0.10.so.0
#4  0xb331b218 in ?? () from /usr/lib/libgstreamer-0.10.so.0
#5  0xb5eeaa37 in ?? () from /usr/lib/libglib-2.0.so.0
#6  0xb5ee9364 in ?? () from /usr/lib/libglib-2.0.so.0
#7  0xb672e885 in start_thread () from /lib/i686/libpthread.so.0
#8  0xb681957e in clone () from /lib/i686/libc.so.6
 
Thread 1 (Thread 0xb5b316d0 (LWP 23263)):
[KCrash Handler]
#6  0xffffe424 in __kernel_vsyscall ()
#7  0xb676c611 in raise () from /lib/i686/libc.so.6
#8  0xb676df62 in abort () from /lib/i686/libc.so.6
#9  0xb73c1a14 in qt_message_output () from /usr/lib/libQtCore.so.4
#10 0xb73c1b18 in qFatal () from /usr/lib/libQtCore.so.4
#11 0xb73c1c15 in qt_assert () from /usr/lib/libQtCore.so.4
#12 0x08056bdc in ?? ()
#13 0x0804fc72 in _start ()

Revision as of 17:35, 11 November 2009


Development/Tutorials/Debugging/How to create useful crash reports

Introduction

Ce document décrit la façon de reproduire une backtrace utile de planter les applications KDE. Tout d'abord, quelques informations générales est donné. Puis, nous allons décrire pour plusieurs distributions de la façon de préparer vos paquets KDE et de gagner la backtrace. Cela devrait être suffisant pour la plupart des gens. Il ya des sections supplémentaires sur la façon de créer backtraces avec le débogueur GNU et avec Valgrind, qui sont parfois utiles.

Comment créer des rapports de bug utiles

A good crash report at Bugzilla consists of two parts: a description of how to reproduce the crash and a backtrace of the crash. With one of those elements missing, it is much harder (if not impossible) for developers to tackle the problem.

A description should consist of more than only "it crashed". Try to describe everything you did prior to the crash. Did you click on a button, opened a particular website or file which caused problems? That little detail which may look useless to you may be useful for the developer, so just write it down.

A more insightful article on how to write good bug descriptions is available at this link, please read that before reporting bugs.

Don't attach the backtrace to the bug report. Instead, simply paste it. This way it is much easier for developers to search for duplicate reports, because attachments will not be searched.

If you paste a backtrace to a report, make sure you strip all but one or two of the

(no debugging symbols found)

lines from the backtrace as they make it harder to read.

Even though pasting backtraces directly is preferred over adding an attachment, please do not paste other things like logs (valgrind, strace or terminal output) or example data (mails, HTML files and so on). Use attachments for these items.

Backtraces

Backtraces are essential. They may look meaningless to you, but they might actually contain a wealth of useful information. A backtrace describes which functions were called prior to the crash, so that developers may track down in which function the mess started. Having good backtraces has a downside: libraries and executables occupy much more disk space than their optimized counter parts. That's the reason why many distros choose to install stripped files, which results in useless backtraces:

(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1233848624 (LWP 12212)]
[New Thread -1255081072 (LWP 12820)]
[New Thread -1240921200 (LWP 12819)]
[New Thread -1266680944 (LWP 12818)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
0xffffe410 in __kernel_vsyscall ()
#0  0xffffe410 in __kernel_vsyscall ()
#1  0xb6a1210b in ?? () from /lib/tls/i686/cmov/libpthread.so.0
#2  0xb6a85afe in ?? () from /usr/lib/libX11.so.6
#3  0x00000003 in ?? ()
#4  0x082149c0 in ?? ()
#5  0x00003ffc in ?? ()
#6  0x00000000 in ?? ()

But no worries, with some modifications you can create full blown backtraces for KDE applications.

Preparing your KDE packages

If your distribution has debugging-enabled packages, install them.

It is easy to see which debug packages you are missing from looking at the backtrace. For example, take the following line from a backtrace:

#6  0xb7975bdc in ?? () from /usr/lib/libkmailprivate.so.4

The ?? indicates that the library libkmailprivate.so.4 does not have debug information, which might be available in separate debug packages. In this case, it is pretty easy to guess that you need to install debug packages for KMail to get a better backtrace.

Sometimes, you need to install more than one debug package to get a good backtrace. This depends on how the distribution splits up the packages. For example, for some distributions it is enough to install the debug package for kdepim to get enough debugging information for a crash in KMail, for other distributions there is an additional debug package just for KMail.

Here's a list of how to obtain debug packages for some distributions:

  • Debian - Debian offers -dbg packages to easy create useful backtraces. Just install the corresponding -dbg package. e.g. kdepim-dbg for KMail crashes. The dependencies of -dbg makes sure to pull in the other right packages (kdelibs-dbg, gdb, and so on).
  • FreeBSD ports - Please refer to the KDE on FreeBSD FAQ.
  • Gentoo - Gentoo has its own document describing how to proceed.
  • Mandriva - Mandriva 2007.0 and up has additional debugging packages for all of KDE (in fact, for all of its packages). Just install the corresponding -debug package, like kdebase-debug and kdemultimedia-debug. You probably want to install kdelibs-debug anyways.
    • Note: the -debug packages are in separate repositories. For instance, for all packages in main, you'll find the debugging package in repository debug_main.
  • Kubuntu/Ubuntu - The Ubuntu family makes things quite easy. Every official KDE module has an additional package in the repository, suffixed with -dbg. Always install kdelibs5-dbg, because all KDE applications use kdelibs (kdelibs-dbg for KDE 3 applications). Then you should install a -dbg package for the application which crashed. For example if KOrganizer crashed you should install kdepim-dbg as well. If the program is not from an official KDE module and has no -dbg package, you can install the -dbgsym package from the repository listed on this Debugging Program Crashes page.
    During the Ubuntu development cycle the Apport crash handler is turned on which will report crashes to launchpad.net and do the backtrace for you, if you would rather use the KDE crash handler turn Apport off in /etc/defaults/apport
  • openSUSE - You should only install the -debuginfo packages, for example: kdepimlibs4-debuginfo. You can find these packages in KDE repositories. There is also a dedicated openSUSE debugging page.
  • Fedora - Fedora has its own document describing how to proceed. (A debuginfo repository has to be enabled.)

If your distribution doesn't have debugging-enabled packages for KDE, you'll have to compile KDE from sources:

  • If you're using KDE 3, then at the configure stage, you should supply the parameter --enable-debug=full in order to build debug symbols in the resulting files.
  • If you're using KDE 4, then at the cmake stage, you should supply the parameter -DCMAKE_BUILD_TYPE=debugfull. If you want to specify your own CXXFLAGS, then use -DCMAKE_BUILD_TYPE=None CMAKE_CXX_FLAGS="-O0 -g". You can change the CMAKE_CXX_FLAGS as appropriate for your needs.

Then it's just make and make install as you're used to.

Crash!

Now it's time to crash your application. The KDE Crash Dialog should appear right after the crash, which shows the Backtrace tab.

KDE Crash Dialog
KDE Crash Dialog

Click that tab and wait for a minute. This process may take quite some memory, so things may go sluggish all of a sudden. But the result should look much better. For example:

Using host libthread_db library "/lib/libthread_db.so.1". 
[Thread debugging using libthread_db enabled] 
[New Thread -1232783168 (LWP 7604)] 
[KCrash handler] 
#6  0x0806be76 in TreeMapItem::parent (this=0x0) 
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.h:285 
#7  0x08065fea in TreeMapItemList::compareItems (this=0xbfec04a8, item1=0x0, 
    item2=0x0) 
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.cpp:720 
#8  0xb7281619 in QGList::operator== () from /usr/qt/3/lib/libqt-mt.so.3 
#9  0x0806d498 in QPtrList<TreeMapItem>::operator== (this=0xbfec04a8, 
    list=@0xbfec0468) at /usr/qt/3/include/qptrlist.h:74 
#10 0x08062e18 in TreeMapWidget::mousePressEvent (this=0xbfec03ac, 
    e=0xbfebff1c) 
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/treemap.cpp:1840 
#11 0xb7004a63 in QWidget::event () from /usr/qt/3/lib/libqt-mt.so.3 
#12 0xb6f6bca7 in QApplication::internalNotify () 
   from /usr/qt/3/lib/libqt-mt.so.3 
#13 0xb6f6ca88 in QApplication::notify () from /usr/qt/3/lib/libqt-mt.so.3 
#14 0xb7725a84 in KApplication::notify (this=0xbfec055c, receiver=0xbfec03ac, 
    event=0xbfebff1c) 
    at /home/bram/KDE/kde3/kdelibs/kdecore/kapplication.cpp:550 
#15 0xb6f0bfd2 in QETWidget::translateMouseEvent () 
   from /usr/qt/3/lib/libqt-mt.so.3 
#16 0xb6f0b8b0 in QApplication::x11ProcessEvent () 
   from /usr/qt/3/lib/libqt-mt.so.3 
#17 0xb6f1b761 in QEventLoop::processEvents () from /usr/qt/3/lib/libqt-mt.so.3 
#18 0xb6f82831 in QEventLoop::enterLoop () from /usr/qt/3/lib/libqt-mt.so.3 
#19 0xb6f826b6 in QEventLoop::exec () from /usr/qt/3/lib/libqt-mt.so.3 
#20 0xb6f6b72f in QApplication::exec () from /usr/qt/3/lib/libqt-mt.so.3 
#21 0x0805181e in main (argc=134673960, argv=0xffffffff) 
    at /home/bram/KDE/kde3/kdeaddons/konq-plugins/fsview/main.cpp:55

This looks better, right? It shows memory addresses, the source files and line numbers and the parameters passed to functions. Which make it more helpful to the developer where to look for the problem.

Note
You need GDB installed to get the backtrace of a crash. Please read the next section to know what GDB is, and how to install it.


Retrieving a backtrace with GDB

In some cases, it is not possible to create a backtrace with the KDE Crash Dialog. This may be caused by an application which entered an infinite loop, or the crash dialog did not appear at all for some reason. You can try to grab a backtrace with gdb, the GNU Debugger. GDB is widely available through distribution packages.

Invoking GDB differs from the situation. You can run an application from inside gdb, or attach gdb to an already running process. The latter may be useful when an application already has entered an infinite loop. But we will first start with running an application inside gdb. From the shell, run:

$ gdb someKDEapp

The GDB prompt will appear. Note that this does not start the application itself, you should run it by invoking the run command:

(gdb) run

This will run the application like you are used to, and you can work with it like normal (it only consumes far more memory and may feel sluggish). Now it's time to reproduce your crash. When you succeed, the application just closes and you should return to your GDB prompt. Now it's time to run the 'backtrace' command:

Note
Some KDE applications (such as JuK and KTorrent) have special code to ensure that there is only one running instance of the application at a time. For these applications you should type in "run --nofork" at the (gdb) prompt instead of "run" because otherwise gdb will try to debug the wrong process. If you are unsure as to whether to use --nofork just try it. If the application says it's an unknown option you can remove --nofork.


(gdb) thread apply all backtrace

This should give a good backtrace which can be posted at the KDE Bugzilla.

In case you want to attach to an existing process, run the following command in the shell:

$ gdb someKDEapp pid

where pid is the process ID of the process you want to attach to. Once attached, and the process is in an infinite loop, after using the 'backtrace' command again a useful backtrace will appear. You can use 'continue' command to let the application run again and press Ctrl+C in gdb to be able to again enter commands.

Retrieving a backtrace with Valgrind

When it comes to crashes, Valgrind is also a useful tool to create a backtrace. It's not a substitution for GDB, but rather a supplement.

When you run an application in valgrind, every piece of memory read or written by the application is being checked. Valgrind will report erroneous memory operations in the standard output or in a log file. Since most crashes are due to an invalid memory read, valgrind can be useful to track down where the problem occurs.

Note
Valgrind consists of several tools in order to check or profile an application. For this article, we only use memcheck, the default tool when valgrind is being invoked.


Like GDB, Valgrind makes running an application much slower, while consuming a lot more resources.

Start the application within valgrind:

$ valgrind --log-file=someKDEapp someKDEapp

Now reproduce the crash. As soon as this happens, the application and valgrind will terminate. What's left is a file named someKDEapp.pid where pid is replaced by the process ID of the valgrind process. The file may list more errors than the one causing the crash. Here's the bit causing the crash which corresponds to the GDB backtrace above:

==23292== Invalid read of size 4
==23292==    at 0x806BD9E: TreeMapItem::parent() const (treemap.h:285)
==23292==    by 0x8065FB9: TreeMapItemList::compareItems(void*, void*) (treemap.cpp:720)
==23292==    by 0x50AC618: QGList::operator==(QGList const&) const (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x806D3BF: QPtrList<TreeMapItem>::operator==(QPtrList<TreeMapItem> const&) const (qptrlist.h:74)
==23292==    by 0x8062DE7: TreeMapWidget::mousePressEvent(QMouseEvent*) (treemap.cpp:1840)
==23292==    by 0x4E2FA62: QWidget::event(QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x4D96CA6: QApplication::internalNotify(QObject*, QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x4D97A87: QApplication::notify(QObject*, QEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x4809AC3: KApplication::notify(QObject*, QEvent*) (kapplication.cpp:550)
==23292==    by 0x4D36FD1: QETWidget::translateMouseEvent(_XEvent const*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x4D368AF: QApplication::x11ProcessEvent(_XEvent*) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==    by 0x4D46760: QEventLoop::processEvents(unsigned) (in /usr/qt/3/lib/libqt-mt.so.3.3.8)
==23292==  Address 0x2C is not stack'd, malloc'd or (recently) free'd

But to be sure, just attach the whole log file to the crash report.