From owner-freebsd-current@FreeBSD.ORG Tue May 20 13:01:50 2003 Return-Path: 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 098B337B401; Tue, 20 May 2003 13:01:50 -0700 (PDT) Received: from rwcrmhc53.attbi.com (rwcrmhc53.attbi.com [204.127.198.39]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40E3043F85; Tue, 20 May 2003 13:01:49 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org (12-232-168-4.client.attbi.com[12.232.168.4]) by attbi.com (rwcrmhc53) with ESMTP id <20030520200148053008t05se>; Tue, 20 May 2003 20:01:48 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id NAA65528; Tue, 20 May 2003 13:01:47 -0700 (PDT) Date: Tue, 20 May 2003 13:01:46 -0700 (PDT) From: Julian Elischer To: "Daniel C. Sobral" In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: Julian Elischer cc: CURRENT cc: Robert Watson Subject: Re: /dev/null and KSE panic 100% reproducible X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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, 20 May 2003 20:01:50 -0000 On Tue, 20 May 2003, Julian Elischer wrote: > Someone put the following code into kern/kern_switch.c > /* > * Only allow non system threads to run in panic > * if they are the one we are tracing. (I think.. [JRE]) > */ > if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 && > (td->td_flags & TDF_INPANIC) == 0)) > goto retry; > > > It has the effect of throwing away threads that it has taken off teh run > queue if we are in a panic. > > at a later time anything that goes through these threads will assume > they are still on teh run queue and panic becasue they are not.. > > try the following: > > change it to: > > if (panicstr && ((td->td_proc->p_flag & P_SYSTEM) == 0 && > (td->td_flags & TDF_INPANIC) == 0)) { > /* note that it is no longer on the run queue */ > TD_SET_CAN_RUN(td); > goto retry; > } > > > if it fails you may try TD_SET_SUSPENDED(td) instead, but I think this > is better. > Note, this panic can only happen if you are already panicing, as seen below.. This is why I haven't seen it. > > > > panic: No strategy on dev null responsible for buffer 0xc776ab90 > > > > syncing disks, buffers remaining... 2230 2230 2229 2229 2229 2228 2228 > > 2228 2228 2228 2228 panic: KSE not on run queue