Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932184AbWJRKNq (ORCPT ); Wed, 18 Oct 2006 06:13:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932183AbWJRKNp (ORCPT ); Wed, 18 Oct 2006 06:13:45 -0400 Received: from py-out-1112.google.com ([64.233.166.182]:48974 "EHLO py-out-1112.google.com") by vger.kernel.org with ESMTP id S932184AbWJRKNo (ORCPT ); Wed, 18 Oct 2006 06:13:44 -0400 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ddPS/cCoJ65EStP3PTI6z+IOGFl/QiwPDRhwuSvVnKsWT8AJ7BmR7a+4h02N1x5xGYIJ83GYf4lKgFYgzaZQbC+yPJQuEdrNDXKi93eyihyDrpjO06zZa0DxF7GFUspzSN0+fc21BBZY83bj3UxjpQVEbyxnuYVkyfIXdpvxIVk= Message-ID: Date: Wed, 18 Oct 2006 11:13:44 +0100 From: "Catalin Marinas" To: "Michal Piotrowski" Subject: Re: [PATCH 2.6.19-rc1 00/10] Kernel memory leak detector 0.11 Cc: linux-kernel@vger.kernel.org In-Reply-To: <6bffcb0e0610090718x185cc03cv20a117cf8f3c45e@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20061009124813.2695.8123.stgit@localhost.localdomain> <6bffcb0e0610090718x185cc03cv20a117cf8f3c45e@mail.gmail.com> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3689 Lines: 112 Hi Michal, On 09/10/06, Michal Piotrowski 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): [] memleak_alloc [] __kmalloc_track_caller [] __kzalloc [] platform_device_alloc [] add_pcspkr [] do_initcalls [] do_basic_setup [] init [] kernel_thread_helper [] 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): [] memleak_alloc [] __kmalloc_track_caller [] __kzalloc [] __percpu_alloc_mask [] snmp6_mib_init [] ip6t_hook [] __param_forward [] sys_init_module [] sysenter_past_esp [] 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): [] memleak_alloc [] __kmalloc [] addrconf_sysctl_register [] __param_forward [] __param_forward [] sys_init_module [] sysenter_past_esp [] unreferenced object 0xf48f75bc (size 8): [] memleak_alloc [] __kmalloc_track_caller [] kstrdup [] addrconf_sysctl_register [] __param_forward [] __param_forward [] sys_init_module [] sysenter_past_esp [] 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): [] memleak_alloc [] kmem_cache_alloc [] __alloc_skb [] FillRxDescriptor [] FillRxRing [] SkGeOpen [] dev_open [] dev_change_flags [] devinet_ioctl [] inet_ioctl [] sock_ioctl [] unreferenced object 0xf45101ec (size 1828): [] memleak_alloc [] __kmalloc_track_caller [] __alloc_skb [] FillRxDescriptor [] FillRxRing [] SkGeOpen [] dev_open [] dev_change_flags [] devinet_ioctl [] inet_ioctl [] sock_ioctl [] 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/