From owner-freebsd-current@FreeBSD.ORG Tue Jan 8 03:51:03 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A33A916A41B; Tue, 8 Jan 2008 03:51:03 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: from www.mmlab.cse.yzu.edu.tw (www.mmlab.cse.yzu.edu.tw [140.138.150.166]) by mx1.freebsd.org (Postfix) with ESMTP id 4069913C47E; Tue, 8 Jan 2008 03:51:03 +0000 (UTC) (envelope-from avatar@mmlab.cse.yzu.edu.tw) Received: by www.mmlab.cse.yzu.edu.tw (qmail, from userid 1000) id 1FD528C9A86; Tue, 8 Jan 2008 11:51:00 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by www.mmlab.cse.yzu.edu.tw (qmail) with ESMTP id 0BC228C9A84; Tue, 8 Jan 2008 11:51:00 +0800 (CST) Date: Tue, 8 Jan 2008 11:50:59 +0800 (CST) From: Tai-hwa Liang To: John Baldwin In-Reply-To: <200801041256.43153.jhb@freebsd.org> Message-ID: <0801081149011.85336@www.mmlab.cse.yzu.edu.tw> References: <474D81DB.7020004@FreeBSD.org> <200801031652.20807.jhb@freebsd.org> <0801041816427.55589@www.mmlab.cse.yzu.edu.tw> <200801041256.43153.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Remko Lodder , freebsd-current@freebsd.org, kib@freebsd.org Subject: Re: [Fwd: Re: kern/118258 sysctl causing panics on 7.0-xxx] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2008 03:51:03 -0000 On Fri, 4 Jan 2008, John Baldwin wrote: > On Friday 04 January 2008 05:19:28 am Tai-hwa Liang wrote: >> On Thu, 3 Jan 2008, John Baldwin wrote: >>> On Thursday 29 November 2007 10:53:32 pm Tai-hwa Liang wrote: >>>> On Wed, 28 Nov 2007, Remko Lodder wrote: >>>>> Hello, >>>>> >>>>> So as per Jeff's information, can someone from the -current >>>>> list either contact jeff or try to resolve the problems >>>>> mentioned? :) >>>> >>>> This is a longstanding bug which also exists in RELENG_6. It turns > out >>>> that 'sysctl kern.ttys' after a terminal device is removed could trigger >>>> this panic reliably. For example, do 'sysctl kern.ttys' multiple times >>>> after detaching an USB serial-to-rs232 cable or a PCMCIA modem card. >>>> >>>> Alternatively, following script would demo the panic if you don't have >>>> a physically removable terminal device: >>>> >>>> #!/bin/sh >>>> # >>>> # Warning! Running this script as root will panic your CURRENT box... >>>> # >>>> while true; do >>>> kldload dcons >>>> kldunload dcons >>>> ls /dev >>>> sysctl kern.ttys >>>> sleep 1 >>>> done >>>> >>>> This seems to be a race between devfs and destroy_dev(), Cc'ing kib@ >>>> since he probably has more clues in this area. >>> >>> Try this patch. Also available at >>> http://www.FreeBSD.org/~jhb/patches/ttys_sysctl.patch >> >> With this patch, -CURRENT no longer boots and panics as follows: > > Fixed, was missing an unlock at the bottom of the loop. Patch is updated at > the same URL. This one works like a charm! I've tried with USB-to-RS232 cable as well as aforementioned script. Now -CURRENT wouldn't panic by dumping kern.ttys. Great work! -- Thanks, Tai-hwa Liang