From owner-freebsd-current@FreeBSD.ORG Sat Feb 21 00:10:07 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 A70C71065687 for ; Sat, 21 Feb 2009 00:10:07 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by mx1.freebsd.org (Postfix) with ESMTP id 77F8B8FC08 for ; Sat, 21 Feb 2009 00:10:07 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from [10.9.200.133] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Fri, 20 Feb 2009 15:38:20 -0800 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from IRVEXCHCCR01.corp.ad.broadcom.com ([10.252.49.30]) by IRVEXCHHUB02.corp.ad.broadcom.com ([10.9.200.133]) with mapi; Fri, 20 Feb 2009 15:39:40 -0800 From: "David Christensen" To: "freebsd-current@freebsd.org" Date: Fri, 20 Feb 2009 15:40:56 -0800 Thread-Topic: Hopefully Simple Question on Debugging Kernel Modules Thread-Index: AcmTtKc3gs5fbKK5QXOxPePNXaU5dw== Message-ID: <5D267A3F22FD854F8F48B3D2B5238193394588D54D@IRVEXCHCCR01.corp.ad.broadcom.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: BN6+ CLIc CjGX Dlcs EOxv GLq2 GRe+ GuAn G0Wd HjKS Hsyu IbO8 I3J0 I/lv JF4/ JlEY; 1; ZgByAGUAZQBiAHMAZAAtAGMAdQByAHIAZQBuAHQAQABmAHIAZQBlAGIAcwBkAC4AbwByAGcA; Sosha1_v1; 7; {2E7814AB-1EE8-45EF-A78A-AE9AFD495446}; ZABhAHYAaQBkAGMAaABAAGIAcgBvAGEAZABjAG8AbQAuAGMAbwBtAA==; Fri, 20 Feb 2009 23:40:56 GMT; SABvAHAAZQBmAHUAbABsAHkAIABTAGkAbQBwAGwAZQAgAFEAdQBlAHMAdABpAG8AbgAgAG8AbgAgAEQAZQBiAHUAZwBnAGkAbgBnACAASwBlAHIAbgBlAGwAIABNAG8AZAB1AGwAZQBzAA== x-cr-puzzleid: {2E7814AB-1EE8-45EF-A78A-AE9AFD495446} acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 6581E1661RW878093-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: 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 00:10:09 -0000 I'm sure this is a simple question but the answer is alluding my Google 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=20 how I've managed to get the driver running at all without this but it's=20 time to do things the right way. I have KDB/DDB/GDB built into my=20 -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=20 identify the line number. Dave