From owner-freebsd-hackers Wed Feb 26 11: 2:25 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E959237B401 for ; Wed, 26 Feb 2003 11:02:23 -0800 (PST) Received: from jordan.llnl.gov (jordan.llnl.gov [128.115.36.14]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3963743FBF for ; Wed, 26 Feb 2003 11:02:23 -0800 (PST) (envelope-from alley1@llnl.gov) Received: from jordan.llnl.gov (1683ff08e27b5bafdc810c1a454af79b@localhost [127.0.0.1]) by jordan.llnl.gov (8.12.6/8.12.6) with ESMTP id h1QJ2GvU003159; Wed, 26 Feb 2003 11:02:16 -0800 (PST) Received: from localhost (wea@localhost) by jordan.llnl.gov (8.12.6/8.12.6/Submit) with ESMTP id h1QJ2Cbw003156; Wed, 26 Feb 2003 11:02:12 -0800 (PST) Date: Wed, 26 Feb 2003 11:02:12 -0800 (PST) From: Ed Alley To: Cc: , Subject: Re: HOWTO track resource leaks in kernel modules? Message-ID: <20030226105759.N3150-100000@jordan.llnl.gov> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Re: Resource leaks Hi -- A question like yours (How to?) usually gets ignored on the hackers list. I've tried it before. I believe that they're only interested in bugs/hacks in the current source. I am not aware of any newsletter/questions digest that can/will answer a technical how-to like yours. My suggestion is to place panic(9) calls in strategic places in your code and see where it blows. Also putting strategic printf statements before the panic will help. Finally: don't compile as a module because the kernel.debug file will not have the module symbols in it, which makes it difficult to debug; you can load the module symbols with gdb (see the developers handbook) but that is a pain in the neck after a while. It's easy to switch from in-kernel to module after you have developed your package. I am not aware of any software that you can use to debug leaking resources except gdb -k. Look at the v_usecount, v_writecount, v_holdcount values in the struct vnode.h. Things like that. Ed Alley To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message