mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Possible memory leak via inotify_add_watch
@ 2009-07-06 22:03 Catalin Marinas
  2009-07-06 22:59 ` Eric Paris
  2009-07-07  2:09 ` Eric Paris
  0 siblings, 2 replies; 7+ messages in thread
From: Catalin Marinas @ 2009-07-06 22:03 UTC (permalink / raw)
  To: Eric Paris; +Cc: Linux Kernel Mailing List

Hi Eric,

I'm getting a few kmemleak reports like the one below (it may as well
be just a false positive). All of these allocations happened during
udevd.

unreferenced object 0xc399fd80 (size 84):
  comm "udevd", pid 879, jiffies 4294897228
  backtrace:
    [<c01e0c3a>] create_object+0xfa/0x250
    [<c01e1e7d>] kmemleak_alloc+0x5d/0x70
    [<c01dac1b>] kmem_cache_alloc+0x14b/0x190
    [<c0213800>] sys_inotify_add_watch+0xc0/0x2a0
    [<c010300c>] sysenter_do_call+0x12/0x38
    [<ffffffff>] 0xffffffff

Printing this object with gdb on /proc/kcore shows:

(gdb) print {struct inotify_inode_mark_entry}0xc399fd80
$2 = {fsn_entry = {mask = 134250504, refcnt = {counter = 1}, inode = 0x0,
    group = 0x0, i_list = {next = 0x0, pprev = 0x0}, g_list = {
      next = 0xc399fd98, prev = 0xc399fd98}, lock = {raw_lock = {
        slock = 1028}, magic = 3735899821, owner_cpu = 4294967295,
      owner = 0xffffffff, dep_map = {key = 0xc0d3e59c, class_cache = 0x0,
        name = 0xc068413d "&entry->lock"}}, free_i_list = {next = 0x6b6b6b6b,
      prev = 0x6b6b6b6b}, free_g_list = {next = 0x6b6b6b6b,
      prev = 0x6b6b6b6b}, free_mark = 0xc0213720 <inotify_free_mark>}, wd = 28}

It seems that is was freed via fsnotify_destroy_mark_by_entry() since
group and inode members are NULL and it was removed from any list. The
fsn_entry.refcnt, however, is still 1. Kmemleak cannot find any
pointer to this object (though it doesn't track alloc_pages memory
blocks).

Thanks.

-- 
Catalin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-07-07 21:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-06 22:03 Possible memory leak via inotify_add_watch Catalin Marinas
2009-07-06 22:59 ` Eric Paris
2009-07-07  2:09 ` Eric Paris
2009-07-07 13:03   ` Catalin Marinas
2009-07-07 13:11     ` Eric Paris
2009-07-07 16:24     ` Eric Paris
2009-07-07 21:30       ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®