Backtrace

Differences between revisions 4 and 6 (spanning 2 versions)
Revision 4 as of 2006-05-01 21:20:14
Size: 1106
Editor: ottawa-hs-64-26-167-206
Comment: Log GDB's output
Revision 6 as of 2006-05-01 21:21:48
Size: 1134
Editor: ottawa-hs-64-26-167-206
Comment:
Deletions are marked like this. Additions are marked like this.
Line 12: Line 12:
 1. Start the program under control of `gdb`: {{{  1. Start the program under control of {{{gdb}}}: {{{
Line 19: Line 19:
(gdb) thread apply all bt (gdb) backtrace
(gdb) thread apply all backtrace

A backtrace shows a listing of which program functions are still active. Since functions are nested when they are called, the program must record where it left one function, to jump into an inner one. It does this on the stack, which we dump for the backtrace,

By getting a backtrace at the point of a bug, a developer may be able to isolate where that bug is, because it will narrow down to the function, or even the line, that caused the erroneous behaviour.

Generation

Please ensure you have packages with debug symbols installed. You can do this by following the instructions at DebuggingProgramCrash.

  1. Make sure the GNU Debugger is installed.

    apt-get install gdb
  2. Start the program under control of gdb:

    gdb <program> 2>&1 | tee gdb.txt
    (gdb) handle SIG33 pass nostop noprint
    (gdb) run <arguments, if any>
  3. The program will start. Perform any actions necessary to reproduce the crash
  4. Retrieve a backtrace of the crash:

    (gdb) backtrace
    (gdb) thread apply all backtrace
  5. Attach the complete output from GDB, contained in gdb.txt, in your bug report.

Backtrace (last edited 2022-12-20 22:15:16 by sergiodj)