public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: mm_alloc()'ed structure leak
Date: Mon, 09 Feb 2009 16:12:43 +0100	[thread overview]
Message-ID: <1234192363.5951.129.camel@laptop> (raw)
In-Reply-To: <1234190649.16083.44.camel@pc1117.cambridge.arm.com>

On Mon, 2009-02-09 at 14:44 +0000, Catalin Marinas wrote:
> On Mon, 2009-02-09 at 12:18 +0000, Catalin Marinas wrote:
> > Basically bash forks and executes a command like "host kernel.org" which
> > finishes normally but the corresponding mm_struct isn't freed (I get
> > this consistently every time I run the above command):
> > 
> > unreferenced object 0xcfed4070 (size 368):
> >   comm "bash", pid 1674, jiffies 421592
> >   backtrace:
> >     [<c0082bd4>] kmemleak_alloc+0x140/0x2b0
> >     [<c007ff2c>] kmem_cache_alloc+0xd0/0x100
> >     [<c0036980>] mm_alloc+0x14/0x44
> >     [<c008a99c>] bprm_mm_init+0xc/0x13c
> >     [<c008ab70>] do_execve+0xa4/0x218
> >     [<c002718c>] sys_execve+0x34/0x54
> >     [<c0023e80>] ret_fast_syscall+0x0/0x28
> 
> Dumping the object in question:
> 
> mm_struct.mm_users = 0
> mm_struct.mm_count = 1
> 
> It looks like the mm_count didn't get to 0 hence no structure freeing
> via mmdrop().
> 
> The leak disappears if I revert commit 38d47c1b7075 - "futex: rely on
> get_user_pages() for shared futexes". Peter, any idea?

Looks like the futex key references go wrong somewhere, I'll go look at
it.




  reply	other threads:[~2009-02-09 15:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 12:18 mm_alloc()'ed structure leak Catalin Marinas
2009-02-09 13:12 ` Catalin Marinas
2009-02-09 14:44 ` Catalin Marinas
2009-02-09 15:12   ` Peter Zijlstra [this message]
2009-02-09 16:45     ` Peter Zijlstra
2009-02-09 16:47       ` Peter Zijlstra
2009-02-09 17:28         ` Catalin Marinas
2009-02-09 18:26           ` [PATCH] futex: fix reference leak Peter Zijlstra
2009-02-09 18:53             ` Pallipadi, Venkatesh
2009-02-09 18:57               ` [PATCH -v2] " Peter Zijlstra
2009-02-09 20:49                 ` Darren Hart
2009-02-11 12:28                 ` Ingo Molnar
2009-02-11 15:36                   ` [PATCH -v3] " Peter Zijlstra
2009-02-11 15:49                     ` Ingo Molnar
2009-02-11 15:56                       ` Peter Zijlstra
2009-02-11 16:26                         ` Ingo Molnar
2009-02-11 17:10                           ` [PATCH -v4] " Peter Zijlstra
2009-02-11 17:24                             ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234192363.5951.129.camel@laptop \
    --to=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox