From owner-freebsd-current Tue Mar 4 10:44:55 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C49D37B48A for ; Tue, 4 Mar 2003 10:44:53 -0800 (PST) Received: from mail.speakeasy.net (mail15.speakeasy.net [216.254.0.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id D092F43F3F for ; Tue, 4 Mar 2003 10:44:51 -0800 (PST) (envelope-from jhb@FreeBSD.org) Received: (qmail 17323 invoked from network); 4 Mar 2003 18:44:55 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail15.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 4 Mar 2003 18:44:55 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.6/8.12.6) with ESMTP id h24IgLhT045459; Tue, 4 Mar 2003 13:42:21 -0500 (EST) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <15971.59141.326652.334367@grasshopper.cs.duke.edu> Date: Tue, 04 Mar 2003 13:45:05 -0500 (EST) From: John Baldwin To: Andrew Gallatin Subject: RE: witness_get: witness exhausted? Cc: freebsd-current@freebsd.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 03-Mar-2003 Andrew Gallatin wrote: > > I'm developing a character driver which tracks a lot of state on a > per-open basis. I've got several mutexes in there which are > initialzed at open, and destroyed at close. After a few > dozen opens, witness seems to croak with: > > witness_get: witness exhausted > > Am I leaking something? Or is the witness code? I looked at > subr_witness.c, and I don't see witness_free() being called from > witness_destroy(). There's probably some design constraint that > I don't understand. Unfortunately dead witnesses may still be stuck in the lock order hierarchy and I haven't figured out yet how to properly handle the case of free'ing a witness structure from the tree while preserving the correct lock orders. You can try http://www.freebsd.org/~jhb/patches/witness.patch but I don't think it will help with your specific case. > FWIW, Witness (and the FreeBSD debugging environment in general) is > why I've gotten approval to co-develop this driver on FreeBSD (in > addition to linux). Its already caught several locking bugs. Glad to hear it is at least working in some cases. :) -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message