From nobody@FreeBSD.org  Wed Sep 13 03:28:56 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id D393F16A403
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Sep 2006 03:28:56 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id A354D43D45
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Sep 2006 03:28:56 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k8D3SpdF074186
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 13 Sep 2006 03:28:51 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k8D3SpEf074185;
	Wed, 13 Sep 2006 03:28:51 GMT
	(envelope-from nobody)
Message-Id: <200609130328.k8D3SpEf074185@www.freebsd.org>
Date: Wed, 13 Sep 2006 03:28:51 GMT
From: Zhouyi Zhou <zhouyi04@ios.cn>
To: freebsd-gnats-submit@FreeBSD.org
Subject: kdb_backtrace core dump and a settlement
X-Send-Pr-Version: www-2.3

>Number:         103207
>Category:       kern
>Synopsis:       kdb_backtrace core dump and a settlement
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Sep 13 03:30:18 GMT 2006
>Closed-Date:    Wed Sep 13 12:11:54 GMT 2006
>Last-Modified:  Wed Sep 13 12:11:54 GMT 2006
>Originator:     Zhouyi Zhou
>Release:        FreeBSD 6.0
>Organization:
Institute of Software, Chinese Academy of Sciences
>Environment:
FreeBSD  6.0-RELEASE FreeBSD 6.0-RELEASE #41: Wed Sep 13 11:08:04 UTC 2006  
>Description:
The FreeBSD's DDB backtrace mechanism has a small bug on it.

sys/ddb/db_sym.c

249 void
250 db_symbol_values(sym, namep, valuep)
251         c_db_sym_t      sym;
252         const char      **namep;
253         db_expr_t       *valuep;
254 {
255         db_expr_t       value;
256 
257         if (sym == DB_SYM_NULL) {
258                 *namep = 0;
259                 return;
260         }
261 
262         X_db_symbol_values(db_last_symtab, sym, namep, &value);
263 
264         if (db_symbol_is_ambiguous(sym))
265                 *namep = db_qualify(sym, db_last_symtab->name);
266         if (valuep)
267                 *valuep = value;
268 }

sometimes the db_last_symtab will be 0 because of symbol lookup failure in previous stages, this will cause kernel to dump.



>How-To-Repeat:
add configuration option that will trigger kdb_backtrace such as 
options WITNESS_KDB
to kernel configuration file 
>Fix:
My modification is:
257 if (sym == DB_SYM_NULL||db_last_symtab==0) {
This seems to settle the problem
>Release-Note:
>Audit-Trail:

From: zhouyi zhou <zhouyi04@ios.cn>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/103207: kdb_backtrace core dump and a settlement
Date: Wed, 13 Sep 2006 11:44:18 +0800

 I see the last CVS ddb_sym.c MFC rev. 1.37, and its modification seems to 
 be more reasonable.
State-Changed-From-To: open->closed 
State-Changed-By: maxim 
State-Changed-When: Wed Sep 13 12:10:55 UTC 2006 
State-Changed-Why:  
As submitter noted the issue was fixed by kib@ in rev. 1.37 and MFC'ed 
to RELENG_6 then. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103207 
>Unformatted:
