From owner-freebsd-sparc64@FreeBSD.ORG Mon Feb 13 18:19:12 2006 Return-Path: X-Original-To: freebsd-sparc64@freebsd.org Delivered-To: freebsd-sparc64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E839616A420 for ; Mon, 13 Feb 2006 18:19:12 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 81B5C43D72 for ; Mon, 13 Feb 2006 18:18:49 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 8364877 for multiple; Mon, 13 Feb 2006 13:18:09 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k1DIIkid050977; Mon, 13 Feb 2006 13:18:46 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-sparc64@freebsd.org, Antoine Brodin Date: Mon, 13 Feb 2006 12:23:50 -0500 User-Agent: KMail/1.9.1 References: <200602131150.k1DBo6S1074438@freefall.freebsd.org> In-Reply-To: <200602131150.k1DBo6S1074438@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602131223.51561.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1286/Mon Feb 13 06:41:56 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: sparc64/93226: DEBUG_LOCKS (really stack_save()) causes panics on sparc64 X-BeenThere: freebsd-sparc64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the Sparc List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Feb 2006 18:19:13 -0000 On Monday 13 February 2006 06:50, Antoine Brodin wrote: > The following reply was made to PR sparc64/93226; it has been noted by > GNATS. > > From: Antoine Brodin > To: bug-followup@FreeBSD.org, kris@FreeBSD.org > Cc: > Subject: Re: sparc64/93226: DEBUG_LOCKS (really stack_save()) causes panics > on sparc64 > Date: Mon, 13 Feb 2006 12:44:34 +0100 > > This is a multi-part message in MIME format. > > --Multipart=_Mon__13_Feb_2006_12_44_34_+0100_lHFJ6LWhOkOa2zgV > Content-Type: text/plain; charset=US-ASCII > Content-Transfer-Encoding: 7bit > > Here is a proposed patch. > > It is untested (just compile tested) since I don't have this hardware. > > --Multipart=_Mon__13_Feb_2006_12_44_34_+0100_lHFJ6LWhOkOa2zgV > Content-Type: text/plain; > name="sparc64-stack_save.diff" > Content-Disposition: attachment; > filename="sparc64-stack_save.diff" > Content-Transfer-Encoding: 7bit > > Index: sys/sparc64/sparc64/db_trace.c > =================================================================== > RCS file: /home/ncvs/src/sys/sparc64/sparc64/db_trace.c,v > retrieving revision 1.24 > diff -u -p -r1.24 db_trace.c > --- sys/sparc64/sparc64/db_trace.c 3 Aug 2005 04:27:39 -0000 1.24 > +++ sys/sparc64/sparc64/db_trace.c 13 Feb 2006 11:31:13 -0000 > @@ -307,6 +307,12 @@ stack_save(struct stack *st) > callpc = fp->fr_pc; > if (!INKERNEL(callpc)) > break; > + /* > + * Don't bother traversing trap-frames. > + * tl0_* and tl1_* are just below fork_trampoline > + */ > + if (callpc < (vm_offset_t)fork_trampoline) > + break; > if (stack_put(st, callpc) == -1) > break; > fp = (struct frame *)(fp->fr_fp + SPOFF); If there are kernel functions before the assembly ones (dependent on link order) then this would wrongly bail when it hit those. I think you need to do what the ddb stack tracing code does which is to lookup the symbol name and do a bcmp() on the first 4 chars to recognize trapframes. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org