Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Feb 2006 12:23:50 -0500
From:      John Baldwin <jhb@freebsd.org>
To:        freebsd-sparc64@freebsd.org, Antoine Brodin <antoine.brodin@laposte.net>
Subject:   Re: sparc64/93226: DEBUG_LOCKS (really stack_save()) causes panics on sparc64
Message-ID:  <200602131223.51561.jhb@freebsd.org>
In-Reply-To: <200602131150.k1DBo6S1074438@freefall.freebsd.org>
References:  <200602131150.k1DBo6S1074438@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <antoine.brodin@laposte.net>
> 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 <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602131223.51561.jhb>