From owner-acpi-jp@jp.freebsd.org  Fri Sep 28 00:48:24 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id AAA69351;
	Fri, 28 Sep 2001 00:48:24 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from tasogare.imasy.or.jp (root@tasogare.imasy.or.jp [202.227.24.5])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id AAA69346
	for <acpi-jp@jp.freebsd.org>; Fri, 28 Sep 2001 00:48:23 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Received: from localhost (iwasaki.imasy.or.jp [202.227.24.92])
	by tasogare.imasy.or.jp (8.11.6+3.4W/8.11.6/tasogare) with ESMTP/inet id f8RFmLm36652;
	Fri, 28 Sep 2001 00:48:21 +0900 (JST)
	(envelope-from iwasaki@jp.FreeBSD.org)
Date: Fri, 28 Sep 2001 00:48:18 +0900 (JST)
Message-Id: <20010928.004818.41631667.iwasaki@jp.FreeBSD.org>
To: acpi-jp@jp.freebsd.org, kuriyama@imgsrc.co.jp
From: Mitsuru IWASAKI <iwasaki@jp.freebsd.org>
In-Reply-To: <7m66a5bf0p.wl@waterblue.imgsrc.co.jp>
References: <7mpu8gc9th.wl@waterblue.imgsrc.co.jp>
	<20010925.233119.07584163.iwasaki@jp.FreeBSD.org>
	<7m66a5bf0p.wl@waterblue.imgsrc.co.jp>
X-Mailer: Mew version 2.0 on Emacs 20.7 / Mule 4.0 (HANANOEN)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1306
Subject: [acpi-jp 1306] Re: Stopped at AcpiExTruncateFor32bitTable+0x13
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: iwasaki@jp.freebsd.org

Hi, I think I understood the problem.

> > Could someone show us the back trace of this?  Just type `t' here in DDB.
> 
> Here is copy by hand...

Thanks Kuriyama-san, please try the paches.
Bob, could you review this patch?

Index: exresnte.c
===================================================================
RCS file: /home/ncvs/src/sys/contrib/dev/acpica/exresnte.c,v
retrieving revision 1.1.1.7
diff -u -r1.1.1.7 exresnte.c
--- exresnte.c	26 Aug 2001 22:28:17 -0000	1.1.1.7
+++ exresnte.c	27 Sep 2001 06:53:29 -0000
@@ -359,7 +359,10 @@
 
         /* Truncate value if we are executing from a 32-bit ACPI table */
 
-        AcpiExTruncateFor32bitTable (ObjDesc, WalkState);
+        if (WalkState != NULL)  
+        {
+            AcpiExTruncateFor32bitTable (ObjDesc, WalkState);
+        }
         break;
 
 
> AcpiExTruncateFor32bitTable(c11d5e40,0,c0473b10,0,c0473bd0) at +0x13
> AcpiExResolveNodeToValue(c0473b10,0,0,c11c5300,c0473b14) at +0x140
> AcpiExResolveToValue(c0473b10,0,c11c5300,c0473ba0,c0473bd0) at +0x3f
> AcpiNsGetObjectValue(c11c5300,c0473b2c,0,c11c5320,c11d4e30) + 0xc3
> AcpiNsEvaluateByHandle(c11c5300,0,c0473ba0,c0473c08,c11c5320) + 0x86

Reviewing this trace, I noticed that your DSDT has _ADR with named constants
like
                Name(_ADR, Zero)
# I have never seen this before... I saw only "Name(_ADR, 0x0)" style one.

Anyway, it seems that AcpiExResolveNodeToValue() always gets NULL
WalkState from AcpiNsGetObjectValue() in this case.

Also I reproduced the problem in userland debugger.  The trace is
attached.

Thanks

% ./acpicadb /tmp/CF-A2R4H2.dsdt
Parsing Methods:....................................................................................................................................
132 Control Methods found and parsed (412 nodes total)
ACPI Namespace successfully loaded at root 0x80891ac
- f _ADR
                 \_SB_.PCI0._ADR (0x8093f28) - Integer
            \_SB_.PCI0.ISA_._ADR (0x8094ca8) - Integer
            \_SB_.PCI0.IDE_._ADR (0x8096228) - Integer
       \_SB_.PCI0.IDE_.IDE0._ADR (0x80974a8) - Reference
  \_SB_.PCI0.IDE_.IDE0.HDD0._ADR (0x8097a28) - Reference
  \_SB_.PCI0.IDE_.IDE0.HDD1._ADR (0x8097ca8) - Reference
       \_SB_.PCI0.IDE_.IDE1._ADR (0x8097ea8) - Reference
  \_SB_.PCI0.IDE_.IDE1.HDD2._ADR (0x8098428) - Reference
  \_SB_.PCI0.IDE_.IDE1.HDD3._ADR (0x8098628) - Reference
            \_SB_.PCI0.USB_._ADR (0x8098828) - Integer
            \_SB_.PCI0.PWR_._ADR (0x8098b28) - Integer
            \_SB_.PCI0.VGA0._ADR (0x8098c28) - Integer
            \_SB_.PCI0.AC9A._ADR (0x8098fa8) - Integer
            \_SB_.PCI0.CRD0._ADR (0x80990a8) - Integer
            \_SB_.PCI0.LAN_._ADR (0x80992a8) - Integer
            \_SB_.PCI0.MDM0._ADR (0x8099628) - Integer
            \_SB_.PCI0.PDC_._ADR (0x8099b28) - Integer
- debug _SB_.PCI0._ADR
Executing \_SB_.PCI0._ADR
Execution of \_SB_.PCI0._ADR returned object 0x80b3000 Buflen 10
  [Integer] = 000000000
- debug _SB_.PCI0.IDE_.IDE0._ADR
Executing \_SB_.PCI0.IDE_.IDE0._ADR
Segmentation fault (core dumped)
% gdb acpicadb acpicadb.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd"...
Core was generated by `acpicadb'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib/libc.so.5...done.
Reading symbols from /usr/libexec/ld-elf.so.1...done.
#0  0x8061347 in AcpiExTruncateFor32bitTable (ObjDesc=0x808baa8, WalkState=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/executer/exutils.c:240
240	    if ((!ObjDesc) ||
(gdb) bt
#0  0x8061347 in AcpiExTruncateFor32bitTable (ObjDesc=0x808baa8, WalkState=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/executer/exutils.c:240
#1  0x805f09f in AcpiExResolveNodeToValue (StackPtr=0xbfbff56c, WalkState=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/executer/exresnte.c:362
#2  0x805f480 in AcpiExResolveToValue (StackPtr=0xbfbff56c, WalkState=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/executer/exresolv.c:298
#3  0x80650a9 in AcpiNsGetObjectValue (Node=0x80974a8, 
    ReturnObjDesc=0xbfbff59c)
    at /usr/ports/devel/acpicatools/work/acpicadb/../namespace/nseval.c:633
#4  0x8064e55 in AcpiNsEvaluateByHandle (Handle=0x80974a8, Params=0x80b5028, 
    ReturnObject=0xbfbff61c)
    at /usr/ports/devel/acpicatools/work/acpicadb/../namespace/nseval.c:411
#5  0x8064cfb in AcpiNsEvaluateByName (
    Pathname=0x80889d4 "\\_SB_.PCI0.IDE_.IDE0._ADR", Params=0x80b5028, 
    ReturnObject=0xbfbff61c)
    at /usr/ports/devel/acpicatools/work/acpicadb/../namespace/nseval.c:302
#6  0x8067de0 in AcpiEvaluateObject (Handle=0x0, 
    Pathname=0x80889d4 "\\_SB_.PCI0.IDE_.IDE0._ADR", ParamObjects=0xbfbff658, 
    ReturnBuffer=0xbfbff718)
    at /usr/ports/devel/acpicatools/work/acpicadb/../namespace/nsxfobj.c:253
---Type <return> to continue, or q <return> to quit---
#7  0x804cb9b in AcpiDbExecuteMethod (Info=0x80889c0, ReturnObj=0xbfbff718)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/debugger/dbexec.c:204
#8  0x804ccd2 in AcpiDbExecute (Name=0x8088886 "_SB_.PCI0.IDE_.IDE0._ADR", 
    Args=0x8088868, Flags=2)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/debugger/dbexec.c:334
#9  0x804b9b5 in AcpiDbCommandDispatch (
    InputBuffer=0x8088920 "debug _SB_.PCI0.IDE_.IDE0._ADR", WalkState=0x0, 
    Op=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/debugger/dbinput.c:648
#10 0x804be39 in AcpiDbSingleThread ()
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/debugger/dbinput.c:920
#11 0x804beb1 in AcpiDbUserCommands (Prompt=0, Op=0x0)
    at /usr/ports/devel/acpicatools/work/acpicadb/../interpreter/debugger/dbinput.c:987
#12 0x804961d in load_dsdt (dsdtfile=0xbfbff9d3 "/tmp/CF-A2R4H2.dsdt")
    at acpicadb.c:515
#13 0x804969b in main (argc=2, argv=0xbfbff894) at acpicadb.c:541
#14 0x8048c55 in _start ()


