Consider the following linux kernel dump stack trace, you can trigger a panic from the kernel source code by calling panic(\"debugging a linux kernel panic\");
:
In
unwind_backtrace+0x0/0xf8
what the+0x0/0xf8
stands for?
The first number (+0x0
) is the offset from the beginning of the function (unwind_backtrace
in this case). The second number (0xf8
) is the total length of the function. Given these two pieces of information, if you already have a hunch about where the fault occurred this might be enough to confirm your suspicion (you can tell (roughly) how far along in the function you were).
To get the exact source line of the corresponding instruction (generally better than hunches), use addr2line
or the other methods in other answers.