From owner-svn-src-head@FreeBSD.ORG Tue May 31 21:58:16 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB59106564A; Tue, 31 May 2011 21:58:16 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 6D51B8FC0A; Tue, 31 May 2011 21:58:16 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id p4VLkI1U058137; Tue, 31 May 2011 15:46:18 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id p4VLkI2h058136; Tue, 31 May 2011 15:46:18 -0600 (MDT) (envelope-from ken) Date: Tue, 31 May 2011 15:46:18 -0600 From: "Kenneth D. Merry" To: mdf@FreeBSD.org Message-ID: <20110531214618.GA57498@nargothrond.kdm.org> References: <201105311729.p4VHTwrZ033296@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r222537 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2011 21:58:16 -0000 On Tue, May 31, 2011 at 14:00:18 -0700, mdf@FreeBSD.org wrote: > On Tue, May 31, 2011 at 10:29 AM, Kenneth D. Merry wrote: > > Author: ken > > Date: Tue May 31 17:29:58 2011 > > New Revision: 222537 > > URL: http://svn.freebsd.org/changeset/base/222537 > > > > Log: > > ?Fix apparent garbage in the message buffer. > > > > ?While we have had a fix in place (options PRINTF_BUFR_SIZE=128) to fix > > ?scrambled console output, the message buffer and syslog were still getting > > ?log messages one character at a time. ?While all of the characters still > > ?made it into the log (courtesy of atomic operations), they were often > > ?interleaved when there were multiple threads writing to the buffer at the > > ?same time. > > This seems to panic my box with "lock "msgbuf" 0xfffffe0127ffffe0 > already initialized". > > Unfortunately, though I booted with a fresh CURRENT this morning > successfully, both /boot/kernel and /boot/kernel.old give this panic. > To add insult to injury, when the kernel drops into the debugger, my > keyboard input no longer works so I can't get a stack, etc. Uh-oh! > So: > > 1) Is there anything else I can do to help debug this? > 2) how can I resurrect this box without a reinstall? > > I will try to repro on a virtual machine so I have a snapshot to come back to. My guess is that this is an issue with the message buffer reinitialization path. lock_init() (called by mtx_init()) has an assert to make sure that the lock is initialized, and that is just a flag check. Since the spin lock is part of the message buffer structure, if it is held over from a previous boot, the LO_INITIALIZED flag may still be set. Try power cycling the machine. If it is an issue with re-initialization, that should clear the memory and allow you to boot. My testing has been with VMs (under Xen), so the reinit path has probably not been tested as fully as it should have been. Sorry about that! As for the debugger, that's another issue altogether. It does work for me, but then again if the spin lock initialization is broken for the message buffer that may affect things. Try a cold boot and see if that helps. If so, I think we can probably just bzero the mutex in msgbuf_reinit() and that will fix things. Ken -- Kenneth Merry ken@FreeBSD.ORG