From owner-freebsd-current Sat Feb 8 5:39:48 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 7118D37B401 for ; Sat, 8 Feb 2003 05:39:46 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D8F343F93 for ; Sat, 8 Feb 2003 05:39:45 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from katana.zip.com.au (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id AAA05809; Sun, 9 Feb 2003 00:38:57 +1100 Date: Sun, 9 Feb 2003 00:39:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Kris Kennaway Cc: current@FreeBSD.ORG Subject: Re: Dumping broken? In-Reply-To: <20030208111854.GA13178@rot13.obsecurity.org> Message-ID: <20030209000140.H18099-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Sat, 8 Feb 2003, Kris Kennaway wrote: > I'm having lots of problems with crashdumps under 5.0. Most of the > time trying to force a dump via 'call doadump' returns an error about > 'Context switches not permitted in the debugger'. Calling it again > causes the system to hang. Is anyone else seeing this? This might be caused by ddb not disabling interrupts or by a driver bug (not keeping interrupts disabled, or not using polled mode for dumping so that dumping can work with interrupts disabled, or going near a mutex for dumping). If you call doadump() after ddb was invoked for certain fatal traps, then the 'Context switches not permitted in the debugger' is probably normal because of an old bug in ddb (it doesn't run with interrupts disabled in this case). Try the enclosed patch. Calls from ddb invoked by panic() shouldn't have this problem, but panic() is very likely to hang or die on a lock even before it gets to doadump(). %%% Index: db_interface.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/db_interface.c,v retrieving revision 1.69 diff -u -2 -r1.69 db_interface.c --- db_interface.c 21 Sep 2002 18:53:58 -0000 1.69 +++ db_interface.c 21 Sep 2002 23:56:57 -0000 @@ -78,4 +78,5 @@ kdb_trap(int type, int code, struct i386_saved_state *regs) { + u_int ef; volatile int ddb_mode = !(boothowto & RB_GDB); @@ -97,4 +98,8 @@ } + /* XXX is this correctly placed? SMP restart seems to be too early. */ + ef = read_eflags(); + disable_intr(); + switch (type) { case T_BPTFLT: /* breakpoint */ @@ -217,4 +222,7 @@ regs->tf_cs = ddb_regs.tf_cs & 0xffff; regs->tf_ds = ddb_regs.tf_ds & 0xffff; + + write_eflags(ef); + return (1); } %%% Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message