> On Jun 19, 2015, at 4:41 PM, Saiprasad Chavali <[email protected]> wrote:
>
> Hi,
> I am using the standard API to initialize the lists :
> “InitializeListHead(XXX)”. I don’t see it get stuck. If I remove the
> Assertion check, it goes through, no issues. The node values and the count
> are fine.
>
~/work/src/edk2(master)>git grep PcdMaximumLinkedListLength -- *.dec
MdePkg/MdePkg.dec:1844:
gEfiMdePkgTokenSpaceGuid.PcdMaximumLinkedListLength|1000000|UINT32|0x00000003
The default for PcdMaximumLinkedListLength is a large value. Did you set it to
another value in your DSC file?
> What cause a memory corruption if we think that is the only case? A repeated
> call to insertion/remove? Is not happening sequentially?
>
Well it is C code so memory corruption is easy. Have a bad pointer, or pass the
same data into multiple calls. If you are casting to (LIST_ENTRY *) that may be
a bug too.
LIST_ENTRY ListData;
LIST_ENTRY *ListHead = &ListData;
LIST_ENTRY *ListEntry = &ListData;
InitializeListHead (ListHead);
for (i=0; i<2; i++) {
InsertHeadList (ListHead, ListEntry);
}
Thanks,
Andrew Fish
> Thanks
> Sai
>
>
>
> From: Andrew Fish [mailto:[email protected] <mailto:[email protected]>]
> Sent: Friday, June 19, 2015 4:29 PM
> To: [email protected] <mailto:[email protected]>
> Subject: Re: [edk2] Assertion in Linked list - help
>
>
> On Jun 19, 2015, at 4:18 PM, Saiprasad Chavali <[email protected]
> <mailto:[email protected]>> wrote:
>
> Hi,
>
> I hit the Assertion (ASSERT (Count < PcdGet32 (PcdMaximumLinkedListLength))),
> “Linked list is too long” inside the “InternalBaseLibIsNodeInList” of baselib
> “linkedlist.c”.
>
> Almost all the Linked list API, calls this function. There is not one
> particular API that throws this error when Invoked inside the Dxe Driver.
>
> If I comment this Assertion call everything works fine. The node elements in
> the lists at any point of the time or no more than 3 or 4. So wondering what
> could be the cause of this assertion.
>
> It happens most of the time, some kind of timing issue. Suspecting memory
> corruption of the links, if so any reason (or) is anything wrong in the way I
> initialize the linked lists?
>
>
> How do you initialize the lists? The lists are circular so I guess you could
> get stuck in an infinite loop, if you initialize them incorrectly or have
> memory corruption.
>
> Thanks,
>
> Andrew Fish
>
>
> Your help is so much appreciated.
>
> Thanks
> Sai
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> edk2-devel mailing list
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/edk2-devel
> <https://lists.sourceforge.net/lists/listinfo/edk2-devel>
------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel