From owner-p4-projects@FreeBSD.ORG Mon Jun 18 22:41:07 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0B9F41065672; Mon, 18 Jun 2012 22:41:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B131C106566C for ; Mon, 18 Jun 2012 22:41:06 +0000 (UTC) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 987D78FC0C for ; Mon, 18 Jun 2012 22:41:06 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q5IMf6pb020253 for ; Mon, 18 Jun 2012 22:41:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q5IMf6M3020250 for perforce@freebsd.org; Mon, 18 Jun 2012 22:41:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Mon, 18 Jun 2012 22:41:06 GMT Message-Id: <201206182241.q5IMf6M3020250@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 213103 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2012 22:41:07 -0000 http://p4web.freebsd.org/@@213103?ac=10 Change 213103 by rwatson@rwatson_svr_ctsrd_mipsbuild on 2012/06/18 22:40:01 Annotate a bug in FreeBSD/mips in-kernel stack walking: pcb_regs is used instead of pcb_context. However, if I drop in pcb_context, then I get a crash walking kernel stacks, so the existing stack walker appears inadequately robust. Rather than fix these bugs now, make a note for later. Affected files ... .. //depot/projects/ctsrd/beribsd/src/sys/mips/mips/stack_machdep.c#2 edit Differences ... ==== //depot/projects/ctsrd/beribsd/src/sys/mips/mips/stack_machdep.c#2 (text+ko) ==== @@ -57,6 +57,7 @@ stack_zero(st); + /* XXXRW: appears to be inadequately robust? */ for (;;) { stacksize = 0; if (pc <= (u_register_t)(intptr_t)btext) @@ -137,6 +138,7 @@ if (TD_IS_RUNNING(td)) panic("stack_save_td: running"); + /* XXXRW: Should be pcb_context? */ pc = td->td_pcb->pcb_regs.pc; sp = td->td_pcb->pcb_regs.sp; stack_capture(st, pc, sp); @@ -150,6 +152,7 @@ if (curthread == NULL) panic("stack_save: curthread == NULL)"); + /* XXXRW: Should be pcb_context? */ pc = curthread->td_pcb->pcb_regs.pc; sp = curthread->td_pcb->pcb_regs.sp; stack_capture(st, pc, sp);