addr2line on kernel module

后端 未结 3 1566
梦毁少年i
梦毁少年i 2020-12-02 13:46

I\'m trying to debug kernel module. I suspect to have there some memory leaks. To check it I have prepared build with enabled Memory leak debugging for kernel and modules. A

3条回答
  •  不知归路
    2020-12-02 13:59

    You indeed need to run addr2line on your kernel module and not kernel but there is a twist -

    the kernel module file uses relative addresses, the crash address you have is actually composed of:

    offset inside module + module load address is memory.

    So what you need to do is find the kernel moduel load address is memory first by doing cat /proc/modules, finding to what module that address belongs to, in case you don't know, subtract the module load address from the crash address and feed that to addr2line

    good luck

提交回复
热议问题