Skip to content

Conversation

AaronRobinsonMSFT
Copy link
Member

Comments in this code detail the logic and reasons for failure.

This should be considered for .NET 6.

Fixes #59072

/cc @davidwrighton @jkoritzinsky @elinor-fung

@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/1247477775

@dotnet dotnet deleted a comment from elinor-fung Sep 20, 2021
@dotnet dotnet deleted a comment from elinor-fung Sep 20, 2021
@davidwrighton
Copy link
Member

        gc.arrRef = (PTRARRAYREF)AllocateObjectArray((DWORD)localList.Size(), g_pObjectClass);

This change relies on this AllocateObjectArray call not triggering multiple GCs. While I think that such behavior would be unusual, I don't think its a good practice to rely on such a detail.


Refers to: src/coreclr/vm/interoplibinterface_comwrappers.cpp:355 in e820da6. [](commit_id = e820da6, deletion_comment = False)

Copy link
Member

@davidwrighton davidwrighton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The allocation problem here now looks solved.

@AaronRobinsonMSFT AaronRobinsonMSFT merged commit 2f68bf6 into dotnet:main Sep 21, 2021
@AaronRobinsonMSFT AaronRobinsonMSFT deleted the runtime59072 branch September 21, 2021 15:01
AaronRobinsonMSFT added a commit that referenced this pull request Sep 21, 2021
…59285)

* Handle a possible GC after allocating an array by iterating over the hash again.

Co-authored-by: Elinor Fung <[email protected]>
@AaronRobinsonMSFT
Copy link
Member Author

/backport to release/6.0-rc2

@github-actions
Copy link
Contributor

Started backporting to release/6.0-rc2: https://github.com/dotnet/runtime/actions/runs/1259570246

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

3 participants