From owner-acpi-jp@jp.FreeBSD.org Wed Mar 13 06:36:28 2002
Received: (from daemon@localhost)
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) id g2CLaSE23808;
	Wed, 13 Mar 2002 06:36:28 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206])
	by castle.jp.FreeBSD.org (8.11.6+3.4W/8.11.3) with ESMTP/inet id g2CLaSc23803
	for <acpi-jp@jp.FreeBSD.org>; Wed, 13 Mar 2002 06:36:28 +0900 (JST)
	(envelope-from jhb@FreeBSD.org)
Received: (qmail 12326 invoked from network); 12 Mar 2002 21:36:20 -0000
Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender <jhb@FreeBSD.org>)
          by mail6.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP
          for <acpi-jp@jp.FreeBSD.org>; 12 Mar 2002 21:36:20 -0000
Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1])
	by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g2CLaiv27990;
	Tue, 12 Mar 2002 16:36:44 -0500 (EST)
	(envelope-from jhb@FreeBSD.org)
Message-ID: <XFMail.20020312163621.jhb@FreeBSD.org>
X-Mailer: XFMail 1.5.2 on FreeBSD
X-Priority: 3 (Normal)
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
In-Reply-To: <XFMail.20020312144005.jhb@FreeBSD.org>
Date: Tue, 12 Mar 2002 16:36:21 -0500 (EST)
From: John Baldwin <jhb@freebsd.org>
To: John Baldwin <jhb@freebsd.org>
Cc: msmith@freebsd.org, acpi-jp@jp.FreeBSD.org
Reply-To: acpi-jp@jp.FreeBSD.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+020312
X-Sequence: acpi-jp 1596
Subject: [acpi-jp 1596] RE: Problems with multiple PCI bridges on latest
Errors-To: owner-acpi-jp@jp.FreeBSD.org
Sender: owner-acpi-jp@jp.FreeBSD.org
X-Originator: jhb@FreeBSD.org


On 12-Mar-2002 John Baldwin wrote:
>> Fatal trap 12: page fault while in kernel mode
>> cpuid = 0; lapic.id = 00000000
>> fault virtual address   = 0x8
>> fault code              = supervisor read, page not present
>> instruction pointer     = 0x8:0xc0158e04
>> stack pointer           = 0x10:0xc040fc7c
>> frame pointer           = 0x10:0x0
>> code segment            = base 0x0, limit 0xfffff, type 0x1b
>>                         = DPL 0, pres 1, def32 1, gran 1
>> processor eflags        = interrupt enabled, resume, IOPL = 0
>> current process         = 0 (swapper)
>> kernel: type 12 trap, code=0
>> Stopped at      acpi_pcib_attach+0x1c0: movl    0x8(%ebp),%eax
>> db> t 
>> acpi_pcib_attach(1,c3186090,c31d0b00,c31e5680,c040fc94) at
>> acpi_pcib_attach+0x1c0
>> db_listwatch_cmd_cmd() at db_listwatch_cmd_cmd+0x1339
>> db>
>> 
>> (The stack trace looks a bit busted, btw)
>> 
>> (kgdb) l *acpi_pcib_attach+0x1c0
>> 0xc0158e04 is in acpi_pcib_attach (../../../dev/acpica/acpi_pcib.c:208).
>> 203         }
>> 204     
>> 205         /*
>> 206          * Attach the PCI bus proper.
>> 207          */
>> 208         if ((child = device_add_child(dev, "pci", sc->ap_bus)) == NULL)
>> {
>> 209             device_printf(device_get_parent(dev), "couldn't attach pci
>> bus");
>> 210             return_VALUE(ENXIO);
>> 211         }
>> 212     
>> 
>> So I'm guessing that sc is NULL here?
> 
> Err, nope.  Looking at that again, bp (frame pointer) is 0x0.  Maybe we are
> now
> overflowing our stack?  The entire problem seems to be a stack issue.  I'll
> try
> bumping KSTACK_PAGES to see if it goes away.  If it does then it seems ACPI
> needs to go on a stack diet of some sort. :-/

Hrm, well, bumping KSTACK_PAGES up to 3 and then 4 didn't help.  I added a
tweak to print out the base of the thread's stack and voila:

fault virtual address   = 0x8
fault code              = supervisor read, page not present
instruction pointer     = 0x8:0xc0158e04
stack pointer           = 0x10:0xc040ec7c
stack base              = 0x10:0xc040b000
frame pointer           = 0x10:0x0

It panic'd in teh same place with the same bogus traceback.  Note the same page
offset of sp: 0xc7c.  Also note that we are not overflowing the stack. :(

Maybe it's a buffer overflow of some sort?  Any ideas?

-- 

John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
