From owner-freebsd-current@FreeBSD.ORG Sat Feb 21 02:47:51 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0DBB106566C for ; Sat, 21 Feb 2009 02:47:51 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id D148B8FC14 for ; Sat, 21 Feb 2009 02:47:50 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.localnet (ppp121-45-60-236.lns11.adl2.internode.on.net [121.45.60.236]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id n1L2lhO3040784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 21 Feb 2009 13:17:44 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: freebsd-current@freebsd.org Date: Sat, 21 Feb 2009 13:17:33 +1030 User-Agent: KMail/1.10.4 (Linux/2.6.27-11-generic; KDE/4.1.4; i686; ; ) References: <5D267A3F22FD854F8F48B3D2B5238193394588D54D@IRVEXCHCCR01.corp.ad.broadcom.com> In-Reply-To: <5D267A3F22FD854F8F48B3D2B5238193394588D54D@IRVEXCHCCR01.corp.ad.broadcom.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1722849.InnfbM87XX"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200902211317.41479.doconnor@gsoft.com.au> X-Spam-Score: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: David Christensen Subject: Re: Hopefully Simple Question on Debugging Kernel Modules 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: Sat, 21 Feb 2009 02:47:51 -0000 --nextPart1722849.InnfbM87XX Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 21 February 2009 10:10:56 David Christensen wrote: > I'm sure this is a simple question but the answer is alluding my Google eluding -^ > search capabilities. My driver is being loaded as a kernel module and > is failing with the following error: > > Fatal trap 12: page fault while in kernel mode > cpuid =3D 0; apic id =3D 00 > fault virtual address =3D 0xfffffffe40abe9dc > fault code =3D supervisor write data, page not present > instruction pointer =3D 0x8:0xffffffff920b638f > stack pointer =3D 0x10:0xffffffff9212bb10 > frame pointer =3D 0x10:0xffffffff9212bbb0 > code segment =3D base 0x0, limit 0xfffff, type 0x1b > =3D DPL 0, pres 1, long 1, def32 0, gran 1 > processor eflags =3D interrupt enabled, resume, IOPL =3D 0 > current process =3D 12 (irq268: bce0) > [thread pid 12 tid 100166 ] > Stopped at bce_intr+0x8df: addl $0x1,0x2c854(%r12,%rax,4) > db> > > I simply need to find the offending source line in my driver. Not sure > how I've managed to get the driver running at all without this but it's > time to do things the right way. I have KDB/DDB/GDB built into my > -CURRENT kernel already. It'd be great to find the source line while in > the kernel debugger but I'm also fine with rebooting the system to > identify the line number. DDB doesn't understand debugging symbols to that degree, however you could= =20 connect a GDB remotely using a serial or firewire connection (the later is= =20 much, much nicer) I imagine you could get GDB or some other tool to tell you what line that=20 offset corresponds to but I'm not sure how you go about doing that with=20 modules loaded unless you have a crash dump (or remote GDB on a live system) I guess you could also rebuild your .c files with.. -Wa,-adhlmsn=3D$foo.lst= and=20 look it up that way. =2D-=20 Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --nextPart1722849.InnfbM87XX Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iD8DBQBJn2tG5ZPcIHs/zowRAkglAKCmlFLD5sdGRfSaMmKCV8fYNTYvLgCeJ/Wd NVCxj4fFU30jPtmTKR1jXKk= =TIRH -----END PGP SIGNATURE----- --nextPart1722849.InnfbM87XX--