NetBSD Problem Report #35118

From stix@stix.id.au  Sat Nov 25 13:41:36 2006
Return-Path: <stix@stix.id.au>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id BE75563B400
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 25 Nov 2006 13:41:35 +0000 (UTC)
Message-Id: <20061125134127.96AFE7D@hactar.stix.org.au>
Date: Sun, 26 Nov 2006 00:41:27 +1100 (EST)
From: stix@stix.id.au
Reply-To: stix@stix.id.au
To: gnats-bugs@NetBSD.org
Subject: gdb6 "bt" fails on kernel dumps
X-Send-Pr-Version: 3.95

>Number:         35118
>Category:       toolchain
>Synopsis:       gdb6 "bt" fails on kernel dumps
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 25 13:45:00 +0000 2006
>Closed-Date:    Thu Feb 22 21:49:04 +0000 2007
>Last-Modified:  Thu Feb 22 21:49:04 +0000 2007
>Originator:     Paul Ripke
>Release:        NetBSD 4.99.4
>Organization:
>Environment:


System: NetBSD hactar.stix.org.au 4.99.4 NetBSD 4.99.4 (HACTAR) #7: Sat Nov 25 19:03:23 EST 2006 stix@zion.stix.org.au:/export/netbsd/current/obj.i386/export/netbsd/current/src/sys/arch/i386/compile/HACTAR i386
Architecture: i386
Machine: i386
>Description:
***************************************************************************
I've attempted to debug 3 dumps so far, and all have bogus backtraces.
Extracting other data (msgbuf macro, or xps) works fine.

>How-To-Repeat:

ksh$ gdb netbsd.0
GNU gdb 6.5
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386--netbsdelf"...(no debugging symbols found)

(gdb) symbol-file netbsd.0.gdb 
Reading symbols from /local/crash/netbsd.0.gdb...done.
(gdb) target kvm netbsd.0.core
#0  0x00000000 in ?? ()
(gdb) bt
#0  0x00000000 in ?? ()
#1  0xc0605000 in ?? ()
#2  0x00001000 in ?? ()
#3  0x000c5a1e in ?? ()
#4  0x0026f000 in ?? ()
#5  0x07efe000 in ?? ()
#6  0x07c8f000 in ?? ()
#7  0x00000001 in ?? ()
#8  0x00200a08 in ?? ()
#9  0x00000000 in ?? ()
(gdb)

>Fix:
unknown

>Release-Note:

>Audit-Trail:
From: Paul Ripke <stix@stix.id.au>
To: Christos Zoulas <christos@astron.com>
Cc: gnats-bugs@NetBSD.org
Subject: Re: toolchain/35118 gdb6 "bt" fails on kernel dumps
Date: Thu, 30 Nov 2006 21:35:36 +1100

 Hi Christos,

 Sorry about the delay in testing further... After your updates to gdb6:

 http://mail-index.netbsd.org/source-changes/2006/11/26/0013.html

 I've re-tested on a new dump, and it appears gdb can now trace back
 up to the first trap. eg:

 (gdb) bt
 #0  0xc0618000 in ?? ()
 #1  0xc0319242 in dumpsys () at /export/netbsd/current/src/sys/arch/i386/i386/machdep.c:1158
 #2  0xc0319368 in cpu_reboot (howto=260, bootstr=0x0) at /export/netbsd/current/src/sys/arch/i386/i386/machdep.c:869
 #3  0xc015afe8 in db_reboot_cmd (addr=-1071435613, have_addr=0, count=-1069376627, 
     modif=0xcb4d544c "\213\233BÀ\214\233BÀ4") at /export/netbsd/current/src/sys/ddb/db_command.c:762
 #4  0xc015ab80 in db_command (last_cmdp=0xc041cadc, cmd_table=0x0)
     at /export/netbsd/current/src/sys/ddb/db_command.c:507
 #5  0xc015af45 in db_command_loop () at /export/netbsd/current/src/sys/ddb/db_command.c:295
 #6  0xc015dd69 in db_trap (type=6, code=0) at /export/netbsd/current/src/sys/ddb/db_trap.c:101
 #7  0xc0315382 in kdb_trap (type=6, code=0, regs=0xcb4d5674)
     at /export/netbsd/current/src/sys/arch/i386/i386/db_interface.c:226
 #8  0xc032474e in trap (frame=0xcb4d5674) at /export/netbsd/current/src/sys/arch/i386/i386/trap.c:313
 #9  0xc010c01a in calltrap ()
 #10 0xcb4d5674 in ?? ()
 #11 0x00000010 in ?? ()
 #12 0xcb4d0030 in ?? ()
 #13 0xcb460010 in ?? ()
 #14 0x00000010 in ?? ()
 #15 0xcb380560 in ?? ()
 #16 0x00000000 in ?? ()

 Whereas, ddb, on the same dump, gives:

 kernel: supervisor trap page fault, code=0
 Stopped in pid 892.1 (find) at netbsd:lfs_putpages+0x3e3 movl %eax,0(%edx)
 db{1}> bt
 lfs_putpages(cb4d5780,1,0,c03b1060,cb380560) at netbsd:lfs_putpages+0x3e3
 VOP_PUTPAGES(cb380560,0,0,0,0) at netbsd:VOP_PUTPAGES+0x40
 vinvalbuf(cb380560,1,ffffffff,cb32781c,0) at netbsd:vinvalbuf+0x4f
 vclean(cb088868,800,0,37c,1) at netbsd:vclean+0x1d4
 vgonel(cb380560,cb32781c,2,c02d5a58,c09a601c) at netbsd:vgonel+0x55
 getcleanvnode(c09a6000,200000,0,ffffffff,cb4d5958) at netbsd:getcleanvnode+0xcf
 getnewvnode(5,c09a6000,c089a500,cb4d5954,0) at netbsd:getnewvnode+0xba
 lfs_vget(c09a6000,4a9,0,cb4d5a34,cb4d5a38) at netbsd:lfs_vget+0x12f
 ufs_lookup(cb4d5a5c,1,c03b0660,cb088868,cb4d5bd8) at netbsd:ufs_lookup+0x93d
 VOP_LOOKUP(cb088868,cb4d5bd8,cb4d5bec,c02e44a8,cb55e604) at netbsd:VOP_LOOKUP+0x2b
 lookup(cb4d5bc8,ca2d3c00,400,cb4d5be0,0) at netbsd:lookup+0x28a
 namei(cb4d5bc8,805ad58,64,c024cd0d,1306) at netbsd:namei+0x11a
 sys___lstat30(cb32781c,cb4d5c4b,cb4d5c68,805a048,805a000) at netbsd:sys___lstat30+0x46
 syscall_plain() at netbsd:syscall_plain+0x198
 --- syscall (number 389) ---
 0xbbbaa0f7:
 db{1}> 

 So, while looking quite a bit better, it's not quite there.

 --
 stix

From: christos@zoulas.com (Christos Zoulas)
To: gnats-bugs@NetBSD.org, toolchain-manager@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, stix@stix.id.au
Cc: 
Subject: Re: toolchain/35118 gdb6 "bt" fails on kernel dumps
Date: Thu, 30 Nov 2006 08:24:45 -0500

 On Nov 30, 10:40am, stix@stix.id.au (Paul Ripke) wrote:
 -- Subject: Re: toolchain/35118 gdb6 "bt" fails on kernel dumps

 | The following reply was made to PR toolchain/35118; it has been noted by GNATS.
 | 
 |  Hi Christos,
 |  
 |  Sorry about the delay in testing further... After your updates to gdb6:
 |  
 |  http://mail-index.netbsd.org/source-changes/2006/11/26/0013.html
 |  
 |  I've re-tested on a new dump, and it appears gdb can now trace back
 |  up to the first trap. eg:

 [ traces deleted ]

 |  So, while looking quite a bit better, it's not quite there.

 Yes, I know :-(. I am still working on it. The trap frame is different, and
 I have to find where to specify that in the gdb code... On the brighter side
 I also fixed gdb5, so that gives a full trace.

 christos

From: Pavel Cahyna <pavel@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: christos@zoulas.com
Subject: Re: toolchain/35118 gdb6 "bt" fails on kernel dumps
Date: Fri, 1 Dec 2006 09:20:26 +0100

 On Thu, Nov 30, 2006 at 01:25:02PM +0000, Christos Zoulas wrote:
 >  Yes, I know :-(. I am still working on it. The trap frame is different, and
 >  I have to find where to specify that in the gdb code... On the brighter side
 >  I also fixed gdb5, so that gives a full trace.

 I think the OpenBSD support for that is in the file i386obsd-tdep.c in gdb
 sources.

 Pavel

State-Changed-From-To: open->feedback
State-Changed-By: skrll@netbsd.org
State-Changed-When: Thu, 18 Jan 2007 18:16:42 +0000
State-Changed-Why:
I've committed something that should help. Does -current work for you?


From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35118 CVS commit: src/gnu/dist/gdb6/gdb
Date: Thu, 18 Jan 2007 18:15:02 +0000 (UTC)

 Module Name:	src
 Committed By:	skrll
 Date:		Thu Jan 18 18:15:02 UTC 2007

 Modified Files:
 	src/gnu/dist/gdb6/gdb: i386nbsd-nat.c

 Log Message:
 Apply an iffy heuristic to detect a valid switchframe on the stack and
 extract the register state from this for the live kernel case. If there
 is no switchframe then use the frame pointer to get enough state for crash
 dump case.

 More information needs to be saved by savectx to avoid this mess.

 Should fix PR/35118


 To generate a diff of this commit:
 cvs rdiff -r1.3 -r1.4 src/gnu/dist/gdb6/gdb/i386nbsd-nat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: PR/35118 CVS commit: [netbsd-4] src/gnu/dist/gdb6/gdb
Date: Sun, 11 Feb 2007 13:37:08 +0000 (UTC)

 Module Name:	src
 Committed By:	tron
 Date:		Sun Feb 11 13:37:08 UTC 2007

 Modified Files:
 	src/gnu/dist/gdb6/gdb [netbsd-4]: i386nbsd-nat.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #414):
 	gnu/dist/gdb6/gdb/i386nbsd-nat.c: revision 1.4
 Apply an iffy heuristic to detect a valid switchframe on the stack and
 extract the register state from this for the live kernel case. If there
 is no switchframe then use the frame pointer to get enough state for crash
 dump case.
 More information needs to be saved by savectx to avoid this mess.
 Should fix PR/35118


 To generate a diff of this commit:
 cvs rdiff -r1.3 -r1.3.2.1 src/gnu/dist/gdb6/gdb/i386nbsd-nat.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: skrll@netbsd.org
State-Changed-When: Thu, 22 Feb 2007 21:49:04 +0000
State-Changed-Why:
Timeout on feedback


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.