Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with shuffle thunks tracking in collectible AssemblyLoaderAllocator #55697

Open
janvorli opened this issue Jul 15, 2021 · 2 comments
Open
Assignees
Milestone

Comments

@janvorli
Copy link
Member

janvorli commented Jul 15, 2021

The unloadability features in runtime don't track the lifetime of the shuffle thunks or the related delegate classes (looks like it happens only for delegates pointing to static methods) and when I have attempted to allocate them from the stub heap of the respective collectible loader allocator, they ended up being used after the loader allocator was destroyed and their underlying memory unmapped. That obviously resulted in crashes.

We should figure out how to track then in a way that would keep the loader allocator alive until all the shuffle thunks belonging to that allocator are destroyed.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged New issue has not been triaged by the area owner label Jul 15, 2021
@janvorli janvorli self-assigned this Jul 15, 2021
@janvorli janvorli added this to the 7.0.0 milestone Jul 15, 2021
@jeffschwMSFT jeffschwMSFT added area-VM-coreclr and removed untriaged New issue has not been triaged by the area owner labels Jul 16, 2021
janvorli added a commit to janvorli/runtime that referenced this issue Jun 29, 2022
There was a problem with using heap from the related LoaderAllocator for
shuffle thunk cache heap. I have tested it again and it seems that the
issue is gone, most likely fixed by some recent fixes in the
unloadability area.

So I am removing the workaround, making the cache use LoaderAllocator
local heap.

I have also found a bug in decrementing stub refcount not using RW
mapping at one place while testing this change, so I have fixed it.

Close dotnet#55697
@mangod9 mangod9 modified the milestones: 7.0.0, 8.0.0 Jul 27, 2022
@mangod9
Copy link
Member

mangod9 commented Jul 29, 2023

@janvorli doesnt feel like this is critical for 8?

@janvorli janvorli modified the milestones: 8.0.0, 9.0.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants