mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Holger Kiehl <Holger.Kiehl@dwd.de>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"David S. Miller" <davem@redhat.com>
Subject: Re: Finding memory leak
Date: Sat, 18 Oct 2003 19:23:53 +0200	[thread overview]
Message-ID: <20031018172353.GA12461@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0310171235150.23079-100000@praktifix.dwd.de>

On Fri, 17 October 2003 13:26:44 +0000, Holger Kiehl wrote:
> On Wed, 15 Oct 2003, Andrew Morton wrote:
> > Holger Kiehl <Holger.Kiehl@dwd.de> wrote:
> > >
> > >    - Is it correct to assume that an application cannot be the cause
> > >       of the leak, ie. it can only be in kernel or a driver?
> > 
> > Yes.
> > 
> > >     - How can I really prove that its the driver leaking the memory?
> > 
> > Look for instances of kmalloc(n, ...) for n in the range 1025 to 2048 which
> > do not have a matching kfree.
> > 
> Could only find two instances one allocating 14 bytes and the other 4096.
> Looking further I found several calls of dev_alloc_skb(). But I assume
> these calls are also not the cause, because I put in some printk and
> the size-2048 values do not go up when this is called.
> 
> Since the only thing running at that time is some application that receives
> a multicast stream from the DVB card and writes the data to the disk, I put
> in printk's at every kmalloc() or allocation functions in net/core and
> net/ipv4. After many trials I could narrow this down to every time the
> function igmpv3_newpack() in net/ipv4/igmp.c is called. This is always
> called twice very quickly (there where never any other printk's between
> these two calls). The size allocated by alloc_skb() in igmpv3_newpack()
> when size-2048 in slabinfo goes up is 1529 bytes (in skbuff.c this allocates
> 1596 bytes).
> 
> The kernel network code is way beyond my knowledge and I cannot determine
> how it frees up the memory again. Also, it is very very likely that the leak
> is at some completely different place and igmpv3_newpack() is just called
> shortly before or afterwards.
> 
> So the questions I have are:
> 
>   - Could someone please check igmpv3_newpack() and assure me that there
>     is no leak.

There was a leak, found by the stanford checker team.  I've provided a
broken fix, DaveM wanted to write a decent one.  Not sure if it has
already found it's way into the official kernel.

Jörn

-- 
Happiness isn't having what you want, it's wanting what you have.
-- unknown

  reply	other threads:[~2003-10-18 17:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-15 10:05 Holger Kiehl
2003-10-15 10:25 ` Andrew Morton
2003-10-17 13:26   ` Holger Kiehl
2003-10-18 17:23     ` Jörn Engel [this message]
2003-10-18 17:46       ` Jörn Engel
2003-10-18 17:59         ` Jörn Engel
2003-10-19  7:56           ` Holger Kiehl
2003-10-20  4:23           ` David S. Miller
2003-10-22 11:14             ` Holger Kiehl
2003-10-19  7:48         ` Holger Kiehl

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=20031018172353.GA12461@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=Holger.Kiehl@dwd.de \
    --cc=akpm@osdl.org \
    --cc=davem@redhat.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

all inboxes | Powered by JetHome®