From owner-freebsd-stable@FreeBSD.ORG Mon Mar 29 20:18:37 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9A601065677 for ; Mon, 29 Mar 2010 20:18:37 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 572778FC1F for ; Mon, 29 Mar 2010 20:18:37 +0000 (UTC) Received: by bwz8 with SMTP id 8so5104378bwz.3 for ; Mon, 29 Mar 2010 13:18:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.154.75 with HTTP; Mon, 29 Mar 2010 13:18:35 -0700 (PDT) X-Originating-IP: [93.203.25.218] In-Reply-To: <201003291427.34641.jhb@freebsd.org> References: <20100329173038.GA4969@icarus.home.lan> <201003291427.34641.jhb@freebsd.org> Date: Mon, 29 Mar 2010 22:18:35 +0200 Received: by 10.204.32.214 with SMTP id e22mr4897837bkd.5.1269893915645; Mon, 29 Mar 2010 13:18:35 -0700 (PDT) Message-ID: From: "C. P. Ghost" To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: random FreeBSD panics X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Mar 2010 20:18:38 -0000 On Mon, Mar 29, 2010 at 8:27 PM, John Baldwin wrote: >> To developers: what incentives would help get this issue well-needed >> attention? =A0This problem makes kernel debugging, panic analysis, and >> other console-oriented viewing basically impossible. > > I was recently going to look at it. =A0The somewhat drastic approach I wa= s going > to take was to add a simple serializing lock around trap_fatal() and a fe= w > other places that do similar block prints (e.g. mca_log()). =A0One of the= issues > with fixing this in printf itself is that you'd want probably want to > serialize complete lines of text on a per-thread basis. =A0You would want= to be > able to accumulate this line of text across multiple calls to printf (thi= nk of > it as line-buffering ala stdio). =A0However, some folks may be nervous ab= out > printf not printing things immediately. > > The other issue is that lots of code assumes it can call printf from anyw= here > and everywhere. =A0Mostly this just means that if you add locking and lin= e- > buffering to printf(9) you have to be very careful to make sure it works = in > odd places. =A0Probably a lot of this could be solved by deferring things= like > trap_fatal() until panic() has already been called (which is bde's prefer= red > solution I think). How about serializing all printf(9) through a dedicated kernel thread? Mayb= e something as flexible as syslogd for kernel space (klogd), that could also redirect output to a file, to a serial console etc...? > John Baldwin -cpghost. --=20 Cordula's Web. http://www.cordula.ws/