mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.19-rc1 00/10] Kernel memory leak detector 0.11
Date: Wed, 18 Oct 2006 11:13:44 +0100	[thread overview]
Message-ID: <b0943d9e0610180313ob813549r8181504c50de8a52@mail.gmail.com> (raw)
In-Reply-To: <6bffcb0e0610090718x185cc03cv20a117cf8f3c45e@mail.gmail.com>

Hi Michal,

On 09/10/06, Michal Piotrowski <michal.k.k.piotrowski@gmail.com> wrote:
> I have a new false positives :)
> http://www.stardust.webpages.pl/files/o_bugs/kmemleak-0.11/ml.txt

I eventually found some time to look at these reports. See below for
comments (I removed the duplicates):

unreferenced object 0xdff2213c (size 398):
  [<c0166bc1>] memleak_alloc
  [<c0164d15>] __kmalloc_track_caller
  [<c01548c1>] __kzalloc
  [<c024361b>] platform_device_alloc
  [<c03e9076>] add_pcspkr
  [<c03e48bd>] do_initcalls
  [<c03e496a>] do_basic_setup
  [<c0100421>] init
  [<c01039ab>] kernel_thread_helper
  [<ffffffff>]

Kmemleak is probably right in that this code will never be able to
free the platform device (the pointer was only stored on the stack).
However, this won't be needed and I'll mark it as not being a leak.

unreferenced object 0xf4f4eb68 (size 8):
  [<c0166bc1>] memleak_alloc
  [<c0164d15>] __kmalloc_track_caller
  [<c01548c1>] __kzalloc
  [<c0166479>] __percpu_alloc_mask
  [<fd954a1b>] snmp6_mib_init
  [<fd926017>] ip6t_hook
  [<fd9260f2>] __param_forward
  [<c013b5ad>] sys_init_module
  [<c0102dd5>] sysenter_past_esp
  [<ffffffff>]

This might be a real leak since the previous kmemleak versions were
ignoring all the percpu allocations. I'm a bit confused about the
calling chain between ip6t_hook and snmp6_mib_init. Maybe the network
people could shed some light on this.

unreferenced object 0xf4a17304 (size 1412):
  [<c0166bc1>] memleak_alloc
  [<c0164c2d>] __kmalloc
  [<fd95c587>] addrconf_sysctl_register
  [<fd926337>] __param_forward
  [<fd92619e>] __param_forward
  [<c013b5ad>] sys_init_module
  [<c0102dd5>] sysenter_past_esp
  [<ffffffff>]
unreferenced object 0xf48f75bc (size 8):
  [<c0166bc1>] memleak_alloc
  [<c0164d15>] __kmalloc_track_caller
  [<c0154915>] kstrdup
  [<fd95c5fa>] addrconf_sysctl_register
  [<fd926337>] __param_forward
  [<fd92619e>] __param_forward
  [<c013b5ad>] sys_init_module
  [<c0102dd5>] sysenter_past_esp
  [<ffffffff>]

I have the same problem with the stack trace here - can't find
__param_forward in the code and it also looks strange to have a
recursive call into this function.

I suspect you use the skge.c Ethernet driver. Is it possible to link
this into the kernel (not as a module) and maybe together with the
networking stuff? It might show a clearer stack trace.

unreferenced object 0xf44869e4 (size 160):
  [<c0166bc1>] memleak_alloc
  [<c0164a30>] kmem_cache_alloc
  [<c02a91a0>] __alloc_skb
  [<f9882439>] FillRxDescriptor
  [<f9882408>] FillRxRing
  [<f9881bdf>] SkGeOpen
  [<c02adcda>] dev_open
  [<c02af332>] dev_change_flags
  [<c02e27dd>] devinet_ioctl
  [<c02e4372>] inet_ioctl
  [<c02a5844>] sock_ioctl
  [<ffffffff>]
unreferenced object 0xf45101ec (size 1828):
  [<c0166bc1>] memleak_alloc
  [<c0164d15>] __kmalloc_track_caller
  [<c02a91cb>] __alloc_skb
  [<f9882439>] FillRxDescriptor
  [<f9882408>] FillRxRing
  [<f9881bdf>] SkGeOpen
  [<c02adcda>] dev_open
  [<c02af332>] dev_change_flags
  [<c02e27dd>] devinet_ioctl
  [<c02e4372>] inet_ioctl
  [<c02a5844>] sock_ioctl
  [<ffffffff>]

The above is probably not a leak but it looks more like badly written
code. It looks like the pointers to the sk_buff structures are stored
in memory allocated by pci_alloc_consistent. Kmemleak doesn't scan
this area as it is usually meant for DMA'ing data and not for holding
pointers kernel structures. I can mark it as not a leak.

Thanks.

-- 
Catalin

      parent reply	other threads:[~2006-10-18 10:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-09 12:48 Catalin Marinas
2006-10-09 12:48 ` [PATCH 2.6.19-rc1 01/10] Base support for kmemleak Catalin Marinas
2006-10-09 12:48 ` [PATCH 2.6.19-rc1 02/10] Some documentation " Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 03/10] Add the memory allocation/freeing hooks " Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 04/10] Modules support " Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 05/10] Add kmemleak support for i386 Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 06/10] Add kmemleak support for ARM Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 07/10] Remove some of the kmemleak false positives Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 08/10] Keep the __init functions after initialization Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 09/10] Simple testing for kmemleak Catalin Marinas
2006-10-09 12:49 ` [PATCH 2.6.19-rc1 10/10] Update the MAINTAINERS file " Catalin Marinas
2006-10-09 14:18 ` [PATCH 2.6.19-rc1 00/10] Kernel memory leak detector 0.11 Michal Piotrowski
2006-10-09 17:44   ` Michal Piotrowski
2006-10-18 10:13   ` Catalin Marinas [this message]

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=b0943d9e0610180313ob813549r8181504c50de8a52@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    /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®