Re: Possible memory leak via alloc_pid()

From: Catalin Marinas
Date: Thu Jul 30 2009 - 05:17:09 EST


On Wed, 2009-07-29 at 19:36 -0500, Serge E. Hallyn wrote:
> Quoting Andrew Morton (akpm@xxxxxxxxxxxxxxxxxxxx):
> > On Wed, 8 Jul 2009 22:33:31 +0100
> > Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
> > > There's a kmemleak report of a struct pid allocation in alloc_pid()
> > > which somehow gets lost:
[...]
> > > This is the gdm fork for starting Xorg (with pid 2739). It first
> > > logged me in automatically, after which I logged out and gdm started
> > > another Xorg. The pid structure for the first Xorg is reported as a
> > > leak. The Xorg with pid 2739 is no longer present on my system.
> > >
> > > Using gdb vmlinux /proc/kcore shows that the pid->count is 2, so
> > > that's why it probably wasn't freed by put_pid():
[...]
> thanks for the report. Note that kernel modules can increment those
> counds through find_get_pid().

It is possible that there are more *get_pid() calls than put_pid() but I
couldn't track them.

> Can you send your kernel .config and
> the output of lsmod?

I logged this as http://bugzilla.kernel.org/show_bug.cgi?id=13868. I
uploaded the ARM .config file (no modules loaded). I'll upload the x86
config as well later today (it's on my home machine but it's pretty much
the default Ubuntu 9.04 .config with CONFIG_KMEMLEAK enabled).

Thanks.

--
Catalin

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/