[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTim7d-szCHm1F2Hndiraa0u5795tbg@mail.gmail.com>
Date: Thu, 12 May 2011 20:01:21 +0800
From: ttlxzz ccc <boyzccc@...il.com>
To: Daniel Baluta <daniel.baluta@...il.com>
Cc: linux-kernel@...r.kernel.org
Subject: Re: 答复: problem with kmemleak
Hi, Daniel:
I remove the module and didn't happen any exception. and U can see
that memory leak of insmod has been found int the kmemleak log. So I
think it doesn't happen in the rmmod.
Do you have other ideas, please?
thank you~~:)
On Thu, May 12, 2011 at 7:16 PM, Daniel Baluta <daniel.baluta@...il.com> wrote:
> On Thu, May 12, 2011 at 12:59 PM, chenxi <chenxi05@...du.com> wrote:
>> Thx, Maxin :)
>> ok
>> I did steps below:
>> 1 make oldconfig
>> 2 vim .config
>> ...
>> CONFIG_DEBUG_FS = y
>> CONFIG_DEBUG_KMEMLEAK = y
>> CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE = 1200
>> ...
>> 3 make ; make modules ; and replace the kernel; reboot
>> 4 mount -t debugfs debugfs /sys/kernel/debug
>> 4 I wrote a module like this
>> #include <linux/init.h>
>> #include <linux/module.h>
>> #include <linux/kernel.h>
>> #include <linux/vmalloc.h>
>>
>> void myfunc(void)
>> {
>> char *ptr;
>> ptr = vmalloc(512);
>> ptr = vmalloc(512);
>> ptr = vmalloc(512);
>> }
>>
>> int hello_init(void)
>> {
>> printk(KERN_ALERT "Hello World");
>> myfunc();
>> return 0;
>> }
>>
>> static void hello_exit(void)
>> {
>> printk(KERN_ALERT "Goodbye World");
>> }
>>
>> module_init(hello_init);
>> module_exit(hello_exit);
>>
>> MODULE_LICENSE("GPL v2");
>>
>> 5 clear the kmemleak
>> Echo clear > /sys/kernel/debug/kmemleak
>> 6 insmod the module
>> Insmod xxx.ko
>
> Can you please remove your module?
> I think the memory is leaked at unload time.
>
> thanks,
> Daniel
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists