CSOM - reading file.ListItemAllFields occasionally ends-up in stackoverflow

Oliver Dracus 0 Reputation points
2023-04-01T13:55:35.2233333+00:00

Hi,

my application is downloading files from SharePoint.Online and then I am using file.ListitemAllFields to be able to read fields on list item attached to that document (I need only fields like Editor, Modified, _ModerationStatus, _ModerationComment). Unfortunately, application is, periodically, crashing and from dump file I see:

This dump file has an exception of interest stored in it.
The stored exception information can be accessed via .ecxr.
(6904.4ea4): Stack overflow - code c00000fd (first/second chance not available)

MethodDesc: 00007ff8470f71c0
Method Name: Microsoft.SharePoint.Client.ClientRequest.AddQueryIdAndResultObject(Int64, System.Object)
Class: 00007ff8470ef838
MethodTable: 00007ff8470f7358
mdToken: 00000000060000db
Module: 00007ff845314428
IsJitted: yes
CodeAddr: 00007ff846c0e060
Transparency: Transparent
MethodDesc: 00007ff845315f10
Method Name: Microsoft.SharePoint.Client.ClientObject.get_Query()
Class: 00007ff84534cdf0
MethodTable: 00007ff845315fd8
mdToken: 000000000600002c
Module: 00007ff845314428
IsJitted: yes
CodeAddr: 00007ff846c0eee0
Transparency: Transparent
MethodDesc: 00007ff847124b18
Method Name: Microsoft.SharePoint.Client.ListItem.LoadExpandoFields()
Class: 00007ff84710b268
MethodTable: 00007ff847124cc8
mdToken: 0000000006000602
Module: 00007ff845311e08
IsJitted: yes
CodeAddr: 00007ff848f26780
Transparency: Transparent
MethodDesc: 00007ff845315f10
Method Name: Microsoft.SharePoint.Client.ClientObject.get_Query()
Class: 00007ff84534cdf0
MethodTable: 00007ff845315fd8
mdToken: 000000000600002c
Module: 00007ff845314428
IsJitted: yes
CodeAddr: 00007ff846c0eee0
Transparency: Transparent
MethodDesc: 00007ff847124b18
Method Name: Microsoft.SharePoint.Client.ListItem.LoadExpandoFields()
Class: 00007ff84710b268

....

ERROR_CODE: (NTSTATUS) 0xc00000fd - A new guard page for the stack cannot be created.

(this is repeating until crash) so all points to some problem in Microsoft.SharePoint.Client*

Is there any other way to get list item fields connected to file uploaded to the SharePoint instead of doing file.ListItemAllFields. At the end, I need very small subset of fields and always only from exactly 1 document.

Thx

and

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,448 questions
SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,642 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 40,006 Reputation points Microsoft External Staff
    2023-04-03T03:04:46.89+00:00

    Hi @Oliver Dracus ,

    Per my research, this issue ussally caused by Recursive call. So I would suggest you to add some exit point to any of the recursive function which is at the start. Or just try commenting the recursive call, To Verify this is happening just because of Stack Overflow due to recursive call. If not recursive call, then possibly infinite loop.

    Here is a similar issue with yours, you can make a reference.

    https://stackoverflow.com/questions/24780196/a-new-guard-page-for-the-stack-cannot-be-created


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.