Re: Exact leak location in KMemleak Output

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

 



On Wed, Oct 27, 2010 at 11:11 PM, Mulyadi Santosa
<mulyadi.santosa@xxxxxxxxx> wrote:
> Hi...
>
> On Thu, Oct 28, 2010 at 00:10, Sankar P <sankar.curiosity@xxxxxxxxx> wrote:
>> Hi,
>>
>> I have an out of tree kernel module with the source:
>>
>> static __init int hello_init(void)
>> {
>> Â Â Â char *ptr;
>> Â Â Â ptr = vmalloc(512);
>> Â Â Â ptr = vmalloc(512);
>> Â Â Â ptr = vmalloc(512);
>>
>> Â Â Â printk(KERN_ALERT "Hello World");
>>
>> Â Â Â return 0;
>> }
>>
>> Now I compile this file (hello.c) using my Makefile as follows:
>>
>> EXTRA_CFLAGS=-g
>> obj-m := hello-kernel.o
>> hello-kernel-objs := hello.o
>>
>>
>> Now if I insmod my hello-kernel.ko file and then do a `cat
>> /sys/kernel/debug/kmemleak` I get an output:
>>
>> unreferenced object 0xf8211000 (size 512):
>> Âcomm "insmod", pid 9602, jiffies 3666022 (age 1553.469s)
>
> That's because the code path that causes the leak is running on behalf
> of "insmod" process....

So, is it impossible get the exact location of leaks that exist in
external kernel modules ? and their init/exit functions ?

-- 
Sankar P
http://psankar.blogspot.com

--
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