Re: Exact leak location in KMemleak Output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Oct 28, 2010 at 1:54 PM, Catalin Marinas
<catalin.marinas@xxxxxxx> wrote:
> On Wed, 2010-10-27 at 20:24 +0100, Sankar P wrote:
>> Now I removed the "static __init" from the hello_init function and I
>> got an output of:
>>
>> unreferenced object 0xf9042000 (size 512):
>> Â comm "insmod", pid 12068, jiffies 13995923 (age 51.096s)
>> Â hex dump (first 32 bytes):
>> Â Â 6f 64 75 6c 65 00 00 00 00 00 00 2e 73 79 6d 74 Âodule.......symt
>> Â Â 61 62 00 2e 73 74 72 74 61 62 00 2e 73 68 73 74 Âab..strtab..shst
>> Â backtrace:
>> Â Â [<c10b0001>] create_object+0x114/0x1db
>> Â Â [<c148b4d0>] kmemleak_alloc+0x21/0x3f
>> Â Â [<c10a43e9>] __vmalloc_node+0x83/0x90
>> Â Â [<c10a44b9>] vmalloc+0x1c/0x1e
>> Â Â [<f9036021>] init_module+0x21/0x2f [hello_kernel]
>> Â Â [<c1001226>] do_one_initcall+0x71/0x113
>> Â Â [<c1056c48>] sys_init_module+0x1241/0x1430
>> Â Â [<c100284c>] sysenter_do_call+0x12/0x22
>> Â Â [<ffffffff>] 0xffffffff
>
> That's because once a module was initialised, the __init functions and
> ksym entries are removed from the module, to save space. When a memory
> allocation takes place, kmemleak stores the backtrace as pointers to
> code. When reporting a leak, it does the ksym look-up to match the
> address against a function name.

FWIW, I made a blog post explaining my experience, so that if someone
googles in future for linux kernel memory leak detection, it might
help them. thank you all.

http://psankar.blogspot.com/2010/11/detecting-memory-leaks-in-kernel.html

Sankar

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux