Whats a “backtrace”, and how do I get one?
A “backtrace” is a list of what functions have been called in order to reach a certain point in a program. For example, the function main() may have called a function foo(), which in turn called a function bar(), so the backtrace at a point inside function bar() would look like: • Level 0: bar() • Level 1: foo() • Level 2: main() This can be thought of tracing the path of execution back to the beginning of the program, hence the term “backtrace”. Backtraces are most useful in determining where (and often why) a program crashed, since they indicate both the exact point at which the program crashed and the sequence of actions that led to the crash; for this reason, they are a standard feature of most debuggers. The instructions below are for the GNU debugger, GDB, but should be mostly applicable to other debuggers as well. The most common way to obtain a backtrace is from a core file, a file created when a program crashes that contains information about the program’s state at the time of