Re: Query regarding Kmemleak

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

 



Hi,

On Tue, Jan 31, 2012 at 8:47 PM, Smital Desai
<Smital.Desai@xxxxxxxxxxxxxxx> wrote:
>>
>>          I am  just trying to understand Kmemleak support.
>>
>>          In a test program ,  allocating some memory using and vmalloc
> () and
>> freeing it in exit () routine.
>>          But when i run a kmemleak , It reports this as a leak.
>>
>>          But isn't it a generic reuirement to allocate something for
> the lifetime of
>> the module and free when we remove the module. ?   Can somebody
>> explain ?

Can you give a real time example ?
More specifically, why a driver needs to allocate virtual memory
when still there is no user for that driver.

If driver is just loaded at boot time and unloaded at shutdown,
you cant keep memory allocated w/o any use.

Howsoever, false positives are possible in kmemleak case,
See,
http://lwn.net/Articles/187979/

"There are various other special cases which must be handled. For
example, memory obtained from vmalloc() will be pointed to by the
memory allocation code itself, but might still be leaked. In other
cases, memory is allocated which cannot be found by the scanning
algorithm; a number of special annotations are added to the kernel to
suppress the resulting false positive reports. The detector can also
be fooled by pointers which are left behind in disused memory, or by
random data which happens to look like a pointer to an allocated
block; in these cases, false-negatives will result. "

-- 
Thanks,
Viral Mehta

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[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