Closed chenhengqi closed 1 year ago
@chenhengqi file path and line info information is coming from DWARF. If you kernel image doesn't have DWARF info recorded, you won't see file:line piece. If you have a version of vmlinux with DWARF embedded built separately, you can try passing it as -k
The kernel is custom built by myself without strip.
$ file vmlinux
vmlinux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=92bcafd537b953cc3d545520f8d607d4331250ca, with debug_info, not stripped
Retry with -k
, still not working.
@chenhengqi I'm sorry, I have no idea. Maybe you can debug it yourself? I'm a bit swamped with other stuff right now, so unlikely to get to this any time soon (especially that repro is on your side only).
OK, will try to debug it.
@chenhengqi any updates? were you able to figure this out?
I see the same issue on Fedora Rawhide kernel 6.1.0-0.rc1.20221019gitaae703b02f92.17.fc38.aarch64, one thing I see is that the vmlinux uses DWARF v5 debuginfo format, would that be an issue?
@ismail, @chenhengqi could it be that your kernel enables KASLR?
Check
$ zcat /proc/config.gz | grep RANDOMIZE_BASE
I filed https://github.com/anakryiko/retsnoop/issues/23 to keep track of this.
@ismail, @chenhengqi could it be that your kernel enables KASLR?
At least for me, yes:
❯ grep RANDOMIZE_BASE /boot/config-6.1.0-0.rc1.20221019gitaae703b02f92.17.fc38.aarch64
CONFIG_RANDOMIZE_BASE=y
Sorry, I missed the notification here.
And my dev machine (running on the cloud) was destroyed, I can't verify that.
@ismail, @chenhengqi forgot to mention this here, but https://github.com/anakryiko/retsnoop/pull/30 should have solved this problem. Can you guys please confirm?
$ cat /boot/config-6.1.0-rc4+| grep RANDOMIZE_BASE
CONFIG_RANDOMIZE_BASE=y
$ sudo ./retsnoop -e vfs_read -s -v
Using vmlinux image at /lib/modules/6.1.0-rc4+/build/vmlinux.
KASLR offset is 0x3a400000.
Sidecar PID is 51308.
Discovered 51753 available kprobes!
Found 1 attachable functions in total.
Skipped 105211 functions in total.
Function 'vfs_read' is marked as an entry point.
Attached to function #1 'vfs_read'.
Total 1 kernel functions attached successfully!
Successfully attached in 11 ms.
Receiving data...
17:03:18.004763 -> 17:03:18.004768 TID/PID 51305/51305 (sudo/sudo):
entry_SYSCALL_64_after_hwframe+0x63 (arch/x86/entry/entry_64.S:120:0)
do_syscall_64+0x5c (do_syscall_x64 @ arch/x86/entry/common.c:50:12)
__x64_sys_read+0x19 (fs/read_write.c:621:1)
ksys_read+0xb5 (fs/read_write.c:613:9)
! 0us [-EAGAIN] vfs_read
^C17:03:18.010266 -> 17:03:22.121734 TID/PID 51308/51308 (4/4):
Failed to get symbolized function name: 0
SIGPIPE caught, exiting!
Going to close this, it works now.
I see in README, all output comes with file info and line info, this is very useful. Like:
But when I play it locally, the stack traces do NOT contains file info and line info:
What am I missing here ?