Re: [edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode version of DebugLib

2014-08-27 Thread Tim Lewis
Mike -
Using a non-RSC version of debug lib isn't an option for these customers.
Is it possible to handle the allocation outside of the RSC call itself? And get 
notification if a new handler is installed to update
Tim

From: Kinney, Michael D [mailto:michael.d.kin...@intel.com]
Sent: Thursday, August 28, 2014 12:22 PM
To: edk2-devel@lists.sourceforge.net
Subject: Re: [edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode 
version of DebugLib

Tim,
Yes.  This issue has been around a while.  The workaround when you want to 
monitor every single pool operation in the DXE Core is to use a DebugLib 
instance that sends debug messages directly to a debug device such as 
MdePkg/Library/BaseDebugLibSerialPort.
The issue with using a DebugLib instance that sends debug messages through 
report status code is that the report status code services allocate from pool, 
which causes the recursion.
Thanks,
Mike

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Wednesday, August 27, 2014 9:00 PM
To: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: [edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode version 
of DebugLib

Symptom:
If "DEBUG_POOL" bit is set in PcdDebugPrintErrorLevel, BIOS will enter 
recursive loop. (A call B, B call C, C call A, )
Description:
This happens when the PeiDxeDebugLibReportStatusCode.inf version of DebugLib is 
used. We found it can be duplicated with revision 15913, although it appears 
the problem has been there for a while.
Procedure: Step by Step

1.DxeMain.c - Line 237, DxeMain()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

2.   DxeMain.c - Line 419, CoreInstallMultipleProtocolInterfaces()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

3.   Handle.c - Line 582, CoreInstallProtocolInterface()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

4.Handle.c - Line 311, CoreInstallProtocolInterfaceNotify()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

5.   Handle.c - Line 384, CoreAcquireProtocolLock()   <-First Lock

~\MdeModulePkg\Core\Dxe\Hand\Handle.c

6.   Handle.c - Line 389, CoreFindProtocolEntry (Protocol, TRUE)
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

7.   Handle.c - Line 136, AllocatePool()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

8.   MemoryAllocationLib.c - Line 405, InternalAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

9.   MemoryAllocationLib.c - Line 380, CoreAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

10.   Pool.c - Line 216, CoreAllocatePoolI()
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

11.   Pool.c - Line 343, DEBUG()  <- It will run when efidebug BIOS + 
(PcdDebugPrintErrorLevel  | DEBUG_POOL)
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

12.   DebugLib.c - Line 50, DebugPrint()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

13.   DebugLib.c - Line 219, REPORT_STATUS_CODE_EX()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

14.   ReportStatusCodeLib.c - Line 481, ReportStatusCodeEx()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

15.   ReportStatusCodeLib.c - Line 555, InternalReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

16.   ReportStatusCodeLib.c - Line 102, InternalGetReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

17.   ReportStatusCodeLib.c - Line 57, gBS->LocateProtocol()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

18.   Locate.c - Line 552, CoreLocateProtocol()
~\MdeModulePkg\Core\Dxe\Hand\Locate.c

19.   Locate.c - Line 583, CoreAcquireProtocolLock() <-Second Lock (enter 
ASSERT())

~\MdeModulePkg\Core\Dxe\Hand\Locate.c

20.   DebugLib.c - Line 253, DebugAssert()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

21.   DebugLib.c - Line 317, REPORT_STATUS_CODE_EX()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

22.Enter recursive loop, step 
21->14->15->...->21->14->15->..

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


Re: [edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode version of DebugLib

2014-08-27 Thread Kinney, Michael D
Tim,
Yes.  This issue has been around a while.  The workaround when you want to 
monitor every single pool operation in the DXE Core is to use a DebugLib 
instance that sends debug messages directly to a debug device such as 
MdePkg/Library/BaseDebugLibSerialPort.
The issue with using a DebugLib instance that sends debug messages through 
report status code is that the report status code services allocate from pool, 
which causes the recursion.
Thanks,
Mike

From: Tim Lewis [mailto:tim.le...@insyde.com]
Sent: Wednesday, August 27, 2014 9:00 PM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode version 
of DebugLib

Symptom:
If "DEBUG_POOL" bit is set in PcdDebugPrintErrorLevel, BIOS will enter 
recursive loop. (A call B, B call C, C call A, )
Description:
This happens when the PeiDxeDebugLibReportStatusCode.inf version of DebugLib is 
used. We found it can be duplicated with revision 15913, although it appears 
the problem has been there for a while.
Procedure: Step by Step

1.DxeMain.c - Line 237, DxeMain()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

2.   DxeMain.c - Line 419, CoreInstallMultipleProtocolInterfaces()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

3.   Handle.c - Line 582, CoreInstallProtocolInterface()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

4.Handle.c - Line 311, CoreInstallProtocolInterfaceNotify()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

5.   Handle.c - Line 384, CoreAcquireProtocolLock()   <-First Lock

~\MdeModulePkg\Core\Dxe\Hand\Handle.c

6.   Handle.c - Line 389, CoreFindProtocolEntry (Protocol, TRUE)
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

7.   Handle.c - Line 136, AllocatePool()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

8.   MemoryAllocationLib.c - Line 405, InternalAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

9.   MemoryAllocationLib.c - Line 380, CoreAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

10.   Pool.c - Line 216, CoreAllocatePoolI()
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

11.   Pool.c - Line 343, DEBUG()  <- It will run when efidebug BIOS + 
(PcdDebugPrintErrorLevel  | DEBUG_POOL)
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

12.   DebugLib.c - Line 50, DebugPrint()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

13.   DebugLib.c - Line 219, REPORT_STATUS_CODE_EX()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

14.   ReportStatusCodeLib.c - Line 481, ReportStatusCodeEx()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

15.   ReportStatusCodeLib.c - Line 555, InternalReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

16.   ReportStatusCodeLib.c - Line 102, InternalGetReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

17.   ReportStatusCodeLib.c - Line 57, gBS->LocateProtocol()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

18.   Locate.c - Line 552, CoreLocateProtocol()
~\MdeModulePkg\Core\Dxe\Hand\Locate.c

19.   Locate.c - Line 583, CoreAcquireProtocolLock() <-Second Lock (enter 
ASSERT())

~\MdeModulePkg\Core\Dxe\Hand\Locate.c

20.   DebugLib.c - Line 253, DebugAssert()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

21.   DebugLib.c - Line 317, REPORT_STATUS_CODE_EX()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

22.Enter recursive loop, step 
21->14->15->...->21->14->15->..

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel


[edk2] Endless Loop when DEBUG_POOL used with ReportStatusCode version of DebugLib

2014-08-27 Thread Tim Lewis
Symptom:
If "DEBUG_POOL" bit is set in PcdDebugPrintErrorLevel, BIOS will enter 
recursive loop. (A call B, B call C, C call A, )
Description:
This happens when the PeiDxeDebugLibReportStatusCode.inf version of DebugLib is 
used. We found it can be duplicated with revision 15913, although it appears 
the problem has been there for a while.
Procedure: Step by Step

1.DxeMain.c - Line 237, DxeMain()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

2.   DxeMain.c - Line 419, CoreInstallMultipleProtocolInterfaces()
~\MdeModulePkg\Core\Dxe\DxeMain\DxeMain.c

3.   Handle.c - Line 582, CoreInstallProtocolInterface()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

4.Handle.c - Line 311, CoreInstallProtocolInterfaceNotify()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

5.   Handle.c - Line 384, CoreAcquireProtocolLock()   <-First Lock

~\MdeModulePkg\Core\Dxe\Hand\Handle.c

6.   Handle.c - Line 389, CoreFindProtocolEntry (Protocol, TRUE)
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

7.   Handle.c - Line 136, AllocatePool()
~\MdeModulePkg\Core\Dxe\Hand\Handle.c

8.   MemoryAllocationLib.c - Line 405, InternalAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

9.   MemoryAllocationLib.c - Line 380, CoreAllocatePool()
~\MdeModulePkg\Library\DxeCoreMemoryAllocationLib\MemoryAllocationLib.c

10.   Pool.c - Line 216, CoreAllocatePoolI()
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

11.   Pool.c - Line 343, DEBUG()  <- It will run when efidebug BIOS + 
(PcdDebugPrintErrorLevel  | DEBUG_POOL)
~\MdeModulePkg\Core\Dxe\Mem\Pool.c

12.   DebugLib.c - Line 50, DebugPrint()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

13.   DebugLib.c - Line 219, REPORT_STATUS_CODE_EX()
~\IntelFrameworkModulePkg\Library\PeiDxeDebugLibReportStatusCode\DebugLib.c

14.   ReportStatusCodeLib.c - Line 481, ReportStatusCodeEx()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

15.   ReportStatusCodeLib.c - Line 555, InternalReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

16.   ReportStatusCodeLib.c - Line 102, InternalGetReportStatusCode()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

17.   ReportStatusCodeLib.c - Line 57, gBS->LocateProtocol()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

18.   Locate.c - Line 552, CoreLocateProtocol()
~\MdeModulePkg\Core\Dxe\Hand\Locate.c

19.   Locate.c - Line 583, CoreAcquireProtocolLock() <-Second Lock (enter 
ASSERT())

~\MdeModulePkg\Core\Dxe\Hand\Locate.c

20.   DebugLib.c - Line 253, DebugAssert()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

21.   DebugLib.c - Line 317, REPORT_STATUS_CODE_EX()
~\MdeModulePkg\Library\DxeReportStatusCodeLib\ReportStatusCodeLib.c

22.Enter recursive loop, step 
21->14->15->...->21->14->15->..

--
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/___
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel