Difference between revisions of "Stack Trace"
m (Me myself i moved to Stack Trace) |
(add note about nostrip on gentoo) |
||
Line 33: | Line 33: | ||
* http://www.dirac.org/linux/gdb/06-Debugging_A_Running_Process.php | * http://www.dirac.org/linux/gdb/06-Debugging_A_Running_Process.php | ||
* (in German) http://www.linuxwiki.de/gdb | * (in German) http://www.linuxwiki.de/gdb | ||
+ | |||
+ | == Debug symbol information == | ||
+ | Gnucash needs to be compiled in a way that has the debug symbols still included in the resulting binary libraries. When compiling gnucash from the tarball yourself, this is achieved by using the configure option <tt>./configure --enable-debug</tt>. | ||
+ | |||
+ | === Gentoo === | ||
+ | When emerging gnucash on gentoo, you need to make sure that | ||
+ | # the "debug" flag is enabled | ||
+ | # ''and'' "<tt>FEATURES=nostrip</tt>" is set to disable symbol stripping. |
Revision as of 09:01, 8 March 2007
What is a Stack Trace?
If GnuCash terminates abnormally (i. e. it crashes), then a stack trace is a very helpful information for the developers to figure out the program error that caused this crash.
How to obtain a Stack Trace
There are two possibilities to obtain a stack trace. You can choose either one, whichever seems easier or works better for you.
Attach gdb to running process
The program "gnucash" itself is not an executable but a script. Therefore it cannot be called directly by the gdb debugger. We propose to "attach" the gdb to the running gnucash process instead.
To attach to the running gnucash process:
- Start gnucash normally
- Use "ps afx" (some people prefere "ps aux") to find out the process number (PID) of the running gnucash process; it might be called "gnucash" or "gnucash-bin". Say the PID is 12345.
- Start gdb by typing "gdb"
- Attach to the running process by typing "attach 12345"; gdb will temporarily stop the program
- Continue program execution by typing "continue" at the "(gdb)" prompt
- Provoke the crash; type "backtrace" or shorthand "bt" at the gdb prompt to obtain the backtrace.
Please submit the backtrace together with the instructions on how to reproduce this crash as a new bug report into Bugzilla. Thank you for your contribution.
Starting GnuCash under gdb
Sometimes GnuCash might crash too early in the startup sequence such that you cannot attach gdb to the running process. In that case you can run gnucash under gdb. This is much easier as of GnuCash 2.0. To run GnuCash under gdb from the beginning:
- run "gnucash-env gdb gnucash-bin"
- at the gdb prompt, type: "run". Also add your parameters here, like "run --nofile"
- Provoke the crash; type "backtrace" or shorthand "bt" at the gdb prompt to obtain the backtrace.
See also
Other explanations on how to obtain stack traces:
- http://live.gnome.org/GettingTraces
- http://www.dirac.org/linux/gdb/06-Debugging_A_Running_Process.php
- (in German) http://www.linuxwiki.de/gdb
Debug symbol information
Gnucash needs to be compiled in a way that has the debug symbols still included in the resulting binary libraries. When compiling gnucash from the tarball yourself, this is achieved by using the configure option ./configure --enable-debug.
Gentoo
When emerging gnucash on gentoo, you need to make sure that
- the "debug" flag is enabled
- and "FEATURES=nostrip" is set to disable symbol stripping.