sparc64/93226: DEBUG_LOCKS (really stack_save()) causes panics
on sparc64
John Baldwin
jhb at freebsd.org
Mon Feb 13 10:19:13 PST 2006
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 at laposte.net>
> To: bug-followup at FreeBSD.org, kris at 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 at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-sparc64
mailing list