Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758649AbZJPJtf (ORCPT ); Fri, 16 Oct 2009 05:49:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758581AbZJPJte (ORCPT ); Fri, 16 Oct 2009 05:49:34 -0400 Received: from cam-admin0.cambridge.arm.com ([193.131.176.58]:54124 "EHLO cam-admin0.cambridge.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758579AbZJPJtc (ORCPT ); Fri, 16 Oct 2009 05:49:32 -0400 Subject: Re: kmemleak errors From: Catalin Marinas To: Peter Teoh Cc: LKML , David Howells In-Reply-To: <804dabb00910152239m735708fai520abf6a39ab77e2@mail.gmail.com> References: <804dabb00910142027r7f771ee4n2855fef7dcffbacc@mail.gmail.com> <804dabb00910152239m735708fai520abf6a39ab77e2@mail.gmail.com> Content-Type: text/plain Organization: ARM Ltd Date: Fri, 16 Oct 2009 10:48:36 +0100 Message-Id: <1255686516.3008.15.camel@pc1117.cambridge.arm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 16 Oct 2009 09:48:37.0415 (UTC) FILETIME=[D5711B70:01CA4E45] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4481 Lines: 106 On Fri, 2009-10-16 at 13:39 +0800, Peter Teoh wrote: > sorry, i have overwritten the kernel image to follow up on another > kernel bugzilla report. but on another (32bit Fedora Core10) the > following is the kmemleak output (scan > /sys/kernel/debug/kmemleak is > done at least thrice) and the following output remained exactly not > changed - not even a single byte modified: > > unreferenced object 0xf70320a0 (size 32): > comm "swapper", pid 0, jiffies 4294667388 > hex dump (first 32 bytes): > 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [] kmemleak_alloc+0x100/0x13e > [] __kmalloc_track_caller+0x29f/0x315 > [] kmemdup+0x22/0x5a > [] selinux_cred_prepare+0x18/0x41 > [] security_prepare_creds+0x15/0x18 > [] prepare_creds+0xc4/0xeb > [] copy_creds+0x8a/0x2c5 > [] copy_process+0x31e/0x17bf > [] do_fork+0x256/0x556 > [] kernel_thread+0x85/0x8d > [] rest_init+0x1e/0x5a > [] start_kernel+0x383/0x388 > [] i386_start_kernel+0xae/0xb3 > [] 0xffffffff Possibly real leak. I cc'ed David Howells since he seems to be touching this code more frequently. > unreferenced object 0xf7253200 (size 32): > comm "swapper", pid 1, jiffies 4294669642 > hex dump (first 32 bytes): > a0 36 25 f7 00 00 00 00 00 00 00 00 00 00 00 00 .6%............. > 00 00 00 00 44 5f 25 f6 72 b7 47 c0 00 00 00 00 ....D_%.r.G..... > backtrace: > [] kmemleak_alloc+0x100/0x13e > [] kmem_cache_alloc+0x184/0x20a > [] kmemleak_test_init+0x25/0x6e8 > [] do_one_initcall+0x78/0x1fb > [] kernel_init+0x160/0x1dd > [] kernel_thread_helper+0x7/0x10 > [] 0xffffffff Please disable the kmemleak testing module as it introduces leaks explicitly for testing kmemleak. > unreferenced object 0xf5c16270 (size 16): > comm "swapper", pid 1, jiffies 4294673952 > hex dump (first 16 bytes): > 01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00 ................ > backtrace: > [] kmemleak_alloc+0x100/0x13e > [] kmem_cache_alloc+0x184/0x20a > [] selinux_file_alloc_security+0x34/0xdd > [] security_file_alloc+0x14/0x16 > [] get_empty_filp+0x10d/0x21d > [] do_filp_open+0x15d/0xebc > [] do_sys_open+0x93/0x16a > [] sys_open+0x23/0x2b > [] init_post+0x35/0x18f > [] kernel_init+0x1d3/0x1dd > [] kernel_thread_helper+0x7/0x10 > [] 0xffffffff Some of these could be triggered by an earlier leak, so resolving the first one would automatically make the rest disappear. It could also be that they are just false positive - pointers to them are stored in an area not scanned by kmemleak (like the one below). > unreferenced object 0xf58067c0 (size 32): > comm "modprobe", pid 2123, jiffies 4294698474 > hex dump (first 32 bytes): > 34 7e 60 f8 c0 6f 80 f5 50 d5 da f5 60 d5 da f5 4~`..o..P...`... > 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 ................ > backtrace: > [] kmemleak_alloc+0x100/0x13e > [] kmem_cache_alloc+0x184/0x20a > [] trace_define_field+0x23/0x192 > [] trace_define_common_fields+0x1d/0x12a > [] ftrace_define_fields_i915_ring_wait_end+0x10/0x67 [i915] > [] event_create_dir+0x3d7/0x45a > [] trace_module_notify+0x307/0x568 > [] notifier_call_chain+0x30/0x7f > [] __blocking_notifier_call_chain+0x52/0x67 > [] blocking_notifier_call_chain+0x11/0x13 > [] sys_init_module+0xd9/0x273 > [] sysenter_do_call+0x12/0x2d > [] 0xffffffff These look like false positives since kmemleak doesn't scan all the sections in a module. I proposed a patch here: http://lkml.org/lkml/2009/10/15/155 But it doesn't seem to fix it. I'll send another. -- 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/