From owner-freebsd-current@FreeBSD.ORG Fri Feb 23 11:35:03 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A601B16A402 for ; Fri, 23 Feb 2007 11:35:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by mx1.freebsd.org (Postfix) with ESMTP id 3E5DF13C467 for ; Fri, 23 Feb 2007 11:35:03 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from [212.82.216.227] (helo=fw.zoral.com.ua) by relay02.kiev.sovam.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.60) (envelope-from ) id 1HKYhR-0003Al-8X for freebsd-current@freebsd.org; Fri, 23 Feb 2007 13:35:01 +0200 Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by fw.zoral.com.ua (8.13.4/8.13.4) with ESMTP id l1NBYfmu041336 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 23 Feb 2007 13:34:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8) with ESMTP id l1NBYf9v043678; Fri, 23 Feb 2007 13:34:41 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.13.8/8.13.8/Submit) id l1NBYdTe043677; Fri, 23 Feb 2007 13:34:39 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 23 Feb 2007 13:34:39 +0200 From: Kostik Belousov To: "Wilkinson, Alex" Message-ID: <20070223113439.GK39168@deviant.kiev.zoral.com.ua> References: <20070223061822.GA1497@obelix.dsto.defence.gov.au> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9b/uWrIH8C2V3aH3" Content-Disposition: inline In-Reply-To: <20070223061822.GA1497@obelix.dsto.defence.gov.au> User-Agent: Mutt/1.4.2.2i X-Virus-Scanned: ClamAV version 0.88.7, clamav-milter version 0.88.7 on fw.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED,SPF_NEUTRAL autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on fw.zoral.com.ua X-Scanner-Signature: 8d2e66037c8999a784685da49934e311 X-DrWeb-checked: yes X-SpamTest-Envelope-From: kostikbel@gmail.com X-SpamTest-Group-ID: 00000000 X-SpamTest-Info: Profiles 802 [Feb 22 2007] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {received from trusted relay: not dialup} X-SpamTest-Method: none X-SpamTest-Method: Local Lists X-SpamTest-Rate: 0 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release Cc: freebsd-current@freebsd.org Subject: Re: kgdb(1) ... is it broken ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2007 11:35:03 -0000 --9b/uWrIH8C2V3aH3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 23, 2007 at 03:18:23PM +0900, Wilkinson, Alex wrote: > Hi all, >=20 > I have a reasonably recent version of current that is panic'ing at least = once > every 2 days. When I run kgdb(1) to do a backtrace it aint working correc= tly. >=20 > [FreeBSD 7.0-CURRENT #0: Wed Jan 24 14:24:54 WST 2007] >=20 > e.g. >=20 > The panic: >=20 > NVRM: Xid (0001:00): 8, Channel 00000000 > panic: Bad link elm 0xc4dc8900 next->prev !=3D elm > cpuid =3D 0 > KDB: enter: panic > [thread pid 909 tid 100080 ] > Stopped at kdb_enter+0x32: leave > db>tr > Tracing pid 909 tid 100080 td 0xc47231b0 > kdb_enter(c09ecabf,0,c09a4b15,e6a69a20,c47231b0,...) at kdb_enter+0x32 > panic(c09a4b15,c4dc8900,4c,c09e8778,64,...) at panic+0x191 > destroy_devl(c4714e80,e6a69a70,c0fe6cf0,c4dc8900,40,...) at destroy_devl= +0x330 > destroy_dev(c4dc8900,40,c47231b0,0,c4dc8900,...) at destroy_dev+0x13 > nvidia_dev_close(c4dc8900,3,2000,c47231b0,c4e287d8,...) at nvidia_dev_cl= ose+0xa4 > =09 > giant_close(c4dc8900,3,2000,c47231b0,e6a69adc,...) at giant_close+0x4f > devfs_close(e6a69b28,3,c4e28754) at devfs_close+0x2d1 > VOP_CLOSE_APV(c0a8de20,e6a69b28,c47231b0,c09f7b4c,11f,...) at VOP_CLOSE_= APV+0x69 > =09 > vn_close(c4e28754,3,c4306a80,c47231b0,203246,...) at vn_close+0x99 > vn_closefile(c4bf0a20,c47231b0,c09e9165,889,c4e28754,...) at vn_closefil= e+0x88 > fdrop_locked(c4bf0a20,c47231b0,2,c09ee59f,de,c47231b0,0,203246,c0b3b920,= e6a69c24 > ,c07517fb,c0af5494,0,c4b3522c,401,c09e9165,e6a69c4c,c0716a82,c4b3522c,1,= c09ebc01 > ,ae,0) at fdrop_locked+0xb9 > closef(c4bf0a20,c47231b0,c09e9165,401,c0739bd6,...) at closef+0x1f4 > kern_close(c47231b0,e,4,c4b346c0,1,...) at kern_close+0x188 > syscall(e6a69d38) at syscall+0x155 > Xint0x80_syscall() at Xint0x80_syscall+0x20 > --- syscall (0, FreeBSD ELF32, nosys), eip =3D 0x2, esp =3D 0x203292, eb= p =3D 0xc1d000 > 01 --- > MAXCPU(4000000,90ffff00,10c19ee7,58c28e8c,34c22fbb,...) at 0x2 > db>panic > panic: from debugger > cpuid =3D 0 > Uptime: 3d5h29m19s > Physical memory: 1007 MB > Dumping 219 MB: 204 188 172 156 140 124 108 92 76 60 44 28 12 > Dump complete >=20 > Upon a reboot I see this error: >=20 > savecore: reboot after panic: Bad link elm 0xc4dc8900 next->prev !=3D elm > Feb 23 15:02:22 obelix savecore: reboot after panic: Bad link elm 0xc4dc= 8900 next->prev !=3D elm >=20 > And then the backtrace: >=20 > #0 doadump () at pcpu.h:166 > 166 pcpu.h: No such file or directory. > in pcpu.h > (kgdb) where > #0 doadump () at pcpu.h:166 > #1 0xc0720c1b in boot (howto=3D260) at /usr/src/sys/kern/kern_shutdown.= c:411 > #2 0xc0720693 in panic (fmt=3D0xc09ab848 "from debugger") at > /usr/src/sys/kern/kern_shutdown.c:567 > #3 0xc047e490 in db_panic (addr=3D-1066121253, have_addr=3D0, count=3D-= 1, > modif=3D0xe6a69810 "") at /usr/src/sys/ddb/db_command.c:433 > #4 0xc047e870 in db_command_loop () at /usr/src/sys/ddb/db_command.c:401 > #5 0xc04805fb in db_trap (type=3D3, code=3D0) at /usr/src/sys/ddb/db_ma= in.c:222 > #6 0xc0744c19 in kdb_trap (type=3D0, code=3D0, tf=3D0xe6a699a4) at > /usr/src/sys/kern/subr_kdb.c:502 > #7 0xc0960ea5 in trap (frame=3D0xe6a699a4) at /usr/src/sys/i386/i386/tr= ap.c:621 > #8 0xc0948dbb in calltrap () at /usr/src/sys/i386/i386/exception.s:139 > #9 0x00000000 in ?? () > (kgdb)=20 >=20 > Things just aint working as per normal. >=20 > Has anyone had problems with running backtraces of kernel core dumps with= kgdb(1) ? Try this patch, it shall allow to see useful backtrace in kgdb (I really like to receive feedback on this one): Index: gnu/usr.bin/gdb/kgdb/trgt_i386.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/local/arch/ncvs/src/gnu/usr.bin/gdb/kgdb/trgt_i386.c,v retrieving revision 1.5 diff -u -r1.5 trgt_i386.c --- gnu/usr.bin/gdb/kgdb/trgt_i386.c 11 Sep 2005 05:36:30 -0000 1.5 +++ gnu/usr.bin/gdb/kgdb/trgt_i386.c 23 Feb 2007 11:31:39 -0000 @@ -146,7 +146,7 @@ *realnump =3D -1; =20 ofs =3D (regnum >=3D I386_EAX_REGNUM && regnum <=3D I386_FS_REGNUM) - ? kgdb_trgt_frame_offset[regnum] : -1; + ? kgdb_trgt_frame_offset[regnum] + 4 : -1; if (ofs =3D=3D -1) return; =20 BTW, you panic is caused by nvidia driver. I believe there is a patch by nvidia that would eliminate the problem. --9b/uWrIH8C2V3aH3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF3tFPC3+MBN1Mb4gRAvpmAKCMkYPo6PHwSm81Xmtmef706aEX2wCggj3k 5eO3Vj00Jp1vEFWhIfKdwXo= =sMus -----END PGP SIGNATURE----- --9b/uWrIH8C2V3aH3--