Function 如何从转储中通过函数偏移地址获取行号

Function 如何从转储中通过函数偏移地址获取行号,function,linux-kernel,kernel,offset,function-address,Function,Linux Kernel,Kernel,Offset,Function Address,我第一次使用kasan时出现了以下类型的错误 ================================================================== BUG: AddressSanitizer: out of bounds access in kmalloc_oob_right+0x65/0x75 [test_kasan] at addr ffff8800693bc5d3 Write of size 1 by task modprobe/1689 =========

我第一次使用kasan时出现了以下类型的错误

==================================================================
BUG: AddressSanitizer: out of bounds access in kmalloc_oob_right+0x65/0x75 [test_kasan] at addr ffff8800693bc5d3
Write of size 1 by task modprobe/1689
=============================================================================
BUG kmalloc-128 (Not tainted): kasan error
-----------------------------------------------------------------------------

Disabling lock debugging due to kernel taint
INFO: Allocated in kmalloc_oob_right+0x3d/0x75 [test_kasan] age=0 cpu=0 pid=1689
 __slab_alloc+0x4b4/0x4f0
 kmem_cache_alloc_trace+0x10b/0x190
 kmalloc_oob_right+0x3d/0x75 [test_kasan]
 init_module+0x9/0x47 [test_kasan]
 do_one_initcall+0x99/0x200
 load_module+0x2cb3/0x3b20
 SyS_finit_module+0x76/0x80
 system_call_fastpath+0x12/0x17
INFO: Slab 0xffffea0001a4ef00 objects=17 used=7 fp=0xffff8800693bd728 flags=0x100000000004080
INFO: Object 0xffff8800693bc558 @offset=1368 fp=0xffff8800693bc720

如何从kmalloc_oob_right+0x65/0x75获取错误代码的行号

您需要调试内核和模块的调试信息。你是在启用调试信息的情况下构建的,对吗?。要解析地址中的源代码行,请查看binutils中的addr2line工具和elfutils中的eu-addr2line,它们可能会有所帮助。另请参阅,在调试内核模块时可能会有所帮助。