From owner-freebsd-current@FreeBSD.ORG Wed Sep 15 21:53:04 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 549DB16A4CE for ; Wed, 15 Sep 2004 21:53:04 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2AB843D1F for ; Wed, 15 Sep 2004 21:53:01 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i8FLquJt027421 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 15 Sep 2004 17:52:56 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i8FLqp5u070651; Wed, 15 Sep 2004 17:52:51 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16712.47539.384362.207478@grasshopper.cs.duke.edu> Date: Wed, 15 Sep 2004 17:52:51 -0400 (EDT) To: Kip McAtee In-Reply-To: <200409151104.23912.kmcatee@firetide.com> References: <200409151104.23912.kmcatee@firetide.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: freebsd-current@freebsd.org Subject: Re: remote kernel gdb stack frames corrupted after breakpoint or step X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 15 Sep 2004 21:53:04 -0000 Kip McAtee writes: > Greetings- > > I'm building on 5.3-BETA4 (and 6.0 current) > with gdb (and kgdb) 6.1.1. > > I can get into the remote kernel debugger with > sysctl debug.kdb.enter=1 > > I can set a breakpoint and continue. > When it hits the breakpoint I get: > > Breakpoint 2, wakeup (ident=0xc0c0f9e8) at ../../../kern/kern_synch.c:253 > 253 sleepq_broadcast(ident, SLEEPQ_MSLEEP, -1); > (kgdb) c > Continuing. > > Program received signal SIGSEGV, Segmentation fault. > > Looking at the backtrace implies that the stack frames > are not displayed correctly. I'm setting: > FWIW, I see the same thing when continuing from breakpoints in RELENG_5 via ddb. I've appended a log from my serial console. Interestingly, dropping into the debugger via break on console works like a charm, its only inserted breakpoints which don't work. I think this started happening after the ddb->kdb conversion. Drew [send halt on serial console] db> break sched_switch db> c [thread 100004] Stopped at sched_switch+0x1: movl %esp,%ebp db> tr sched_switch(1,0,0,0,0) at sched_switch+0x1 idle_proc(0,e3f78d48,10e90,10e98,10ea0) at idle_proc+0x143 fork_exit(c04fa329,0,e3f78d48) at fork_exit+0x80 fork_trampoline() at fork_trampoline+0x8 --- trap 0x1, eip = 0, esp = 0xe3f78d7c, ebp = 0 --- db> c kernel trap 12 with interrupts disabled Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x0 fault code = supervisor read, page not present instruction pointer = 0x8:0xc0527256 stack pointer = 0x10:0xe3f78c8c frame pointer = 0x10:0xe3f78c9c code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, def32 1, gran 1 processor eflags = resume, IOPL = 0 current process = 12 (idle: cpu0) [thread 100004] Stopped at sched_switch+0xe: movl 0(%ebx),%edx db> tr sched_switch(0,10,44096318,47c326eb,ffc00014) at sched_switch+0xe end(74c085d0,b816,a3640000,c,89d0558b) at 0xc1562640 db> call cpu_reset cpu_reset called on cpu#0