问题
I am running kmemleak on one of my modules to find leaks, below is the result after a while. From the result, what i understand is below address are object/s address in the .ko or .o file.
unreferenced object 0xffff8803c9708f10 (size 32):
comm "resiter_access_i_o", pid 2320, jiffies 4294798486
hex dump (first 32 bytes):
d8 8e 70 c9 03 88 ff ff a0 8e 70 c9 03 88 ff ff ..p.......p.....
68 8e 70 c9 03 88 ff ff 30 8e 70 c9 03 88 ff ff h.p.....0.p.....
backtrace:
[<ffffffff81516e3e>] kmemleak_alloc+0x5e/0xd0
[<ffffffff8117cf2a>] __kmalloc+0x1ea/0x330
[<ffffffffa04cafbb>] 0xffffffffa04cafbb
[<ffffffffa04ad3a0>] 0xffffffffa04ad3a0
[<ffffffffa04ae8fb>] 0xffffffffa04ae8fb
[<ffffffffa0422e3a>] 0xffffffffa0422e3a
[<ffffffffa0423022>] 0xffffffffa0423022
[<ffffffff81096e86>] kthread+0x96/0xa0
[<ffffffff8100c20a>] child_rip+0xa/0x20
[<ffffffffffffffff>] 0xffffffffffffffff
Based on my understanding, i did the following using gdb to find the function corresponding but i get the following error
gdb resiter_access_i_o.ko
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from resiter_access_i_o.ko ...done.
(gdb) info symbol 0xffffffffa04ae8fb
No symbol matches 0xffffffffa04ae8fb.
(gdb) q
Can some point me how to figure out the function corresponding to the above address? Thanks in advance...
回答1:
Why dont you try tools like object dump, crashdum, crashtool, etc. you should easily be able to find the function name from these tools and the objects you have
来源:https://stackoverflow.com/questions/21657112/analyzing-kmemleak-result