Bugzilla – Bug 349
Implicit return objects are not released in Slack Mode
Last modified: 2008-10-07 22:14:01
You need to log in before you can comment on or make changes to this bug.
In Slack Mode when an exception occurs and all nested control methods are terminated, Implicit return objects are not released. INTERNAL BUG NUMBER: 210
Created an attachment (id=428) [details] ASL code to reproduce the bug Run the demo program in Slack Mode: "acpiexec.exe -s gr.aml"
Created an attachment (id=751) [details] proposed patch
Test result: < ":STST:functional:control:mf6c:PASS:" < ":STST:functional:control:mf6e:PASS:" --- > ":STST:functional:control:mf6c:FAIL:Errors # 16 00 00 00:" > ":STST:functional:control:mf6e:FAIL:Errors # 5C 00 00 00:" 81,83c81,83 < ":STST:functional:control:mf71:PASS:" < ":STST:functional:control:mff0:PASS:" < ":STST:functional:control:mff1:PASS:" --- > ":STST:functional:control:mf71:FAIL:Errors # 16 00 00 00:" > ":STST:functional:control:mff0:FAIL:Errors # 18 00 00 00:" > ":STST:functional:control:mff1:FAIL:Errors # 0C 00 00 00:" 1771c1771 < ":STST:Identity2MS:abbu:ms23:FAIL:Errors # 02 00 00 00:" --- > ":STST:Identity2MS:abbu:ms23:FAIL:Errors # 04 00 00 00:" 2100c2100 < ":STST:bug-demo:Demo of bug 186:mf6d:FAIL:Errors # 04 00 00 00:" --- > ":STST:bug-demo:Demo of bug 186:mf6d:FAIL:Errors # 06 00 00 00:"
Created an attachment (id=766) [details] proposed patch Test result: < ":STST:functional:control:mf6c:PASS:" < ":STST:functional:control:mf6e:PASS:" --- > ":STST:functional:control:mf6c:FAIL:Errors # 16 00 00 00:" > ":STST:functional:control:mf6e:FAIL:Errors # 5C 00 00 00:" 81,83c81,83 < ":STST:functional:control:mf71:PASS:" < ":STST:functional:control:mff0:PASS:" < ":STST:functional:control:mff1:PASS:" --- > ":STST:functional:control:mf71:FAIL:Errors # 16 00 00 00:" > ":STST:functional:control:mff0:FAIL:Errors # 18 00 00 00:" > ":STST:functional:control:mff1:FAIL:Errors # 0C 00 00 00:" 1771c1771 < ":STST:Identity2MS:abbu:ms23:FAIL:Errors # 02 00 00 00:" --- > ":STST:Identity2MS:abbu:ms23:FAIL:Errors # 04 00 00 00:" 2100c2100 < ":STST:bug-demo:Demo of bug 186:mf6d:FAIL:Errors # 04 00 00 00:" --- > ":STST:bug-demo:Demo of bug 186:mf6d:FAIL:Errors # 06 00 00 00:"
re-open this bug. the patch at #4 has problem, it calls AcpiDsClearImplicitReturn at AcpiDsMethodDataDeleteAll which never return an implicit return value in slack mode, it actually disables the slack mode. It now does not crash in slack mode because we have below code, /* * In slack mode execution, if there is no return value * we should implicitly return zero (0) as a default value. */ if (AcpiGbl_EnableInterpreterSlack && !PreviousWalkState->ImplicitReturnObj) { PreviousWalkState->ImplicitReturnObj = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER); if (!PreviousWalkState->ImplicitReturnObj) { return_ACPI_STATUS (AE_NO_MEMORY); } PreviousWalkState->ImplicitReturnObj->Integer.Value = 0; }
Created an attachment (id=800) [details] proposed patch We should not call AcpiDsClearImplicitReturn in AcpiDsMethodDataDeleteAll, because it removes the implicit return object and so it actually disables the slack mode. To fix possible memory leak, just call AcpiDsClearImplicitReturn on method error, see the patch.
Created an attachment (id=802) [details] proposed patch see