mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Issue using faddr2line on kernel modules
@ 2022-01-17  4:57 Kaiwan N Billimoria
  2022-01-17 19:48 ` Josh Poimboeuf
  0 siblings, 1 reply; 15+ messages in thread
From: Kaiwan N Billimoria @ 2022-01-17  4:57 UTC (permalink / raw)
  To: Linux Kernel Mailing List, jpoimboe; +Cc: Chi-Thanh Hoang

Hi there,

Am researching using the cool faddr2line script to help debug Oops'es
from kernel modules..
I find it works just fine when used against the unstripped vmlinux
with debug symbols.

My use case is for a kernel module which Oopses, though. Here's my scenario:
I built a module on a custom debug kernel (5.10.60) with most debug
options enabled...
KASLR is enabled by default as well.

A test kernel module Oopses on my x86_64 guest running this kernel with:
RIP: 0010:do_the_work+0x15b/0x174 [oops_tryv2]

So, i try this:

$ <...>/linux-5.10.60/scripts/faddr2line ./oops_tryv2.ko do_the_work+0x15b/0x174
bad symbol size: base: 0x0000000000000000 end: 0x0000000000000000
$

(It works fine with addr2line though!).
Now I think I've traced the faddr2line script's failure to locate
anything down to this:
...
done < <(${NM} -n $objfile | awk -v fn=$func -v end=$file_end '$3 ==
fn { found=1; line    =$0; start=$1; next } found == 1 { found=0;
print line, "0x"$1 } END {if (found == 1) print     line, end; }')

The nm output is:
$ nm -n ./oops_tryv2.ko |grep -i do_the_work
0000000000000000 t do_the_work
$

nm shows the text addr as 0x0; this is obviously incorrect (same 0x0
with objdump -d on the module).
Am I missing something? Any suggestions as to what I can try, to get
faddr2line working?

TIA,
Regards,
Kaiwan.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-02-11  3:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17  4:57 Issue using faddr2line on kernel modules Kaiwan N Billimoria
2022-01-17 19:48 ` Josh Poimboeuf
2022-01-17 20:27   ` Josh Poimboeuf
2022-01-18  2:40     ` Kaiwan N Billimoria
2022-01-18 17:52       ` Josh Poimboeuf
2022-01-19  3:57         ` Kaiwan N Billimoria
2022-01-19 21:21           ` Josh Poimboeuf
2022-01-19 23:43             ` Josh Poimboeuf
2022-01-20  5:14               ` Kaiwan N Billimoria
2022-01-20 17:17                 ` Josh Poimboeuf
2022-01-20 20:05                   ` Kaiwan N Billimoria
2022-01-27 11:24                     ` Kaiwan N Billimoria
2022-02-06 20:28                     ` Josh Poimboeuf
2022-02-07  2:23                       ` Kaiwan N Billimoria
2022-02-11  3:31                         ` Kaiwan N Billimoria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®