From owner-acpi-jp@jp.freebsd.org  Sat Sep 29 04:05:56 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id EAA65836;
	Sat, 29 Sep 2001 04:05:56 +0900 (JST)
	(envelope-from owner-acpi-jp@jp.FreeBSD.org)
Received: from thalia.fm.intel.com (fmfdns02.fm.intel.com [132.233.247.11])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with ESMTP id EAA65826
	for <acpi-jp@jp.freebsd.org>; Sat, 29 Sep 2001 04:05:54 +0900 (JST)
	(envelope-from robert.moore@intel.com)
Received: from fmsmsxvs041.fm.intel.com (fmsmsxv041-1.fm.intel.com [132.233.48.109])
	by thalia.fm.intel.com (8.9.1a+p1/8.9.1/d: relay.m4,v 1.43 2001/09/24 21:10:20 root Exp $) with SMTP id TAA03031
	for <acpi-jp@jp.freebsd.org>; Fri, 28 Sep 2001 19:05:45 GMT
Received: from FMSMSX018.fm.intel.com ([132.233.42.197])
 by fmsmsxvs041.fm.intel.com (NAVGW 2.5.1.6) with SMTP id M2001092812023702231
 for <acpi-jp@jp.freebsd.org>; Fri, 28 Sep 2001 12:02:37 -0700
Received: by fmsmsx018.fm.intel.com with Internet Mail Service (5.5.2653.19)
	id <TZZYVBG1>; Fri, 28 Sep 2001 11:58:25 -0700
Message-ID: <B9ECACBD6885D5119ADC00508B68C1EA2FDF36@orsmsx107.jf.intel.com>
From: "Moore, Robert" <robert.moore@intel.com>
To: "'acpi-jp@jp.freebsd.org'" <acpi-jp@jp.freebsd.org>, kuriyama@imgsrc.co.jp
Date: Thu, 27 Sep 2001 09:42:44 -0700
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: text/plain;
	charset="iso-8859-1"
Reply-To: acpi-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: acpi-jp 1310
Subject: [acpi-jp 1310] RE: Stopped at AcpiExTruncateFor32bitTable+0x1
	3
Errors-To: owner-acpi-jp@jp.freebsd.org
Sender: owner-acpi-jp@jp.freebsd.org
X-Originator: robert.moore@intel.com


This is the correct fix, I have already incorporated it into the code for
the next release. 

The ASL line "Name (_ADR, Zero)" exposed the problem because of the constant
term "Zero".

Thanks,
Bob


-----Original Message-----
From: Mitsuru IWASAKI [mailto:iwasaki@jp.freebsd.org]
Sent: Thursday, September 27, 2001 8:48 AM
To: acpi-jp@jp.freebsd.org; kuriyama@imgsrc.co.jp
Subject: [acpi-jp 1306] Re: Stopped at AcpiExTruncateFor32bitTable+0x13


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 ()

