If you are lucky when your kernel module crashes, you would get an oops with a log with a lot of information, such as values in the registers etc. One such information is the stack trace (The same is true for core dumps, but I had originally asked this for kernel modules). Take this example:
[<f97ade02>] ? skink_free_devices+0x32/0xb0 [skin_kernel]
[<f97aba45>] ? cleanup_module+0x1e5/0x550 [skin_kernel]
[<c017d0e7>] ? __stop_machine+0x57/0x70
[<c016dec0>] ? __try_stop_module+0x0/0x30
[<c016f069>] ? sys_delete_module+0x149/0x210
[<c0102f24>] ? sysenter_do_call+0x12/0x16
My guess is that the +<number1>/<number2> has something to do with the offset from function in which the error has occurred. That is, by inspecting this number, perhaps looking at the assembly output I should be able to find out the line (better yet, instruction) in which this error has occurred. Is that correct?
My question is, what are these two numbers exactly? How do you make use of them?
This means the offending instruction is
0x32bytes from the start of the functionskink_free_devices()which is0xB0bytes long in total.If you compile your kernel with
-genabled, then you can get the line number inside functions where the control jumped using the tooladdr2lineor our good oldgdbSomething like this
So just give the address you want to inspect to
addr2lineorgdband they shall tell you the line number in the source file where the offending function is presentSee this article for full details
EDIT:
vmlinuxis the uncompressed version of the kernel used for debugging and is generally found @/lib/modules/$(uname -r)/build/vmlinuxprovided you have built your kernel from sources.vmlinuzthat you find at/bootis the compressed kernel and may not be that useful in debugging