Most recent kernel where this bug did not occur: Distribution: Hardware Environment: Software Environment: Problem Description: The Linux kernel ACPI interpreter fails the following AML test when it is compiled into a simulator. So if an OEM BIOS includes this code, Linux would fail. Steps to reproduce: Run interpreter with the gr.asl demo code attached.
Created attachment 6181 [details] ASL code to reproduce bug
Created attachment 6182 [details] proposed patch
APPEARANCE While executing the AML code on a global level (out of any Method, immediately on a DefinitionBlock level) and being forced to handle some exception, ACPICA crashes (see the demo attached). ROOT CAUSE ACPICA attempts to retrieve elements of WalkState->MethodNode structure which is a NULL pointer in that case (global level AML code execution case). CONTENTS OF UPDATES 1. Eliminates the cause of the crash. dswexec.c The zero value of WalkState->MethodNode for the considered fragment of code is now treated as an indication of the global level execution (see dswexec.txt). In that case the exception handler is passed with the zero value Name parameter. Otherwise, the value passed as Name parameter is the name of the Method (WalkState->MethodNode->Name.Integer) being executed and caused exception, as it was earlier. 2. Provides the appropreate messages reported by the exception handler of AcpiExec utility: aeexec.c New global level execution exception case message: **** AcpiExec Exception: AE_AML_DIVIDE_BY_ZERO during execution on global level Opcode [Divide] @9 Method execution case (old message): **** AcpiExec Exception: AE_AML_DIVIDE_BY_ZERO during execution of method [M000] Opcode [Divide] @E ISSUE The change (1) above means that the interface of an exception handler is specified more exactly: zero Name parameter - exception during global level execution non-zero Name parameter - exception during Method execution This meaning of the Name parameter of an exception handler should be (somewhere) explicitly specified. REMARKS In a global level execution exception case (see log.txt): a) the message reported by ACPI_REPORT_ERROR (("AcpiUtDivide: Divide by zero\n")) is not aligned from the beginning of a new line (as it is usually): Completing Region/Field/Buffer/Package initialization: utmath-0239: *** Error: AcpiUtDivide: Divide by zero and b) a dot symbol in the fragment of the message below looks strangely: Executing subtree for Buffer/Package/Region nsinit-0400 [04] NsInitOneObject : Could not execute arguments for [BUF0] (Buffer), AE_AML_DIVIDE_BY_ZERO . (it is not due to the proposed update). ISSUE This (see (a) and (b) of REMARKS above) could be filed as a new low priority bug. UPDATED FILES source/tools/acpiexec/aeexec.c source/components/interpreter/dispatcher/dswexec.c: HOW UPDATES WERE TESTED The changes are obvious, so I didn't run aslts tests, but checked the updates only for the relevant .asl demo program attached. It causes global level execution exception and shows that interpretation after completion of the exception processing proceeds successfully. INTERNAL BUG NUMBER 162
Created attachment 6183 [details] The attached test run output
note that executing global level code (aka module level code) is planned for Linux, but not yet enabled by default.
Integrated for next release of ACPICA
Released in ACPICA version 20051216
ACPICA 20051216 shipped in Linux-2.6.16 closed.