Skip to content

Commit

Permalink
Fix ShuffleThunk cache heap (#105480)
Browse files Browse the repository at this point in the history
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.

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

Close #55697
  • Loading branch information
janvorli authored Jul 26, 2024
1 parent 5940292 commit 81976ed
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/coreclr/vm/loaderallocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1734,11 +1734,7 @@ void AssemblyLoaderAllocator::Init(AppDomain* pAppDomain)
LoaderAllocator::Init((BaseDomain *)pAppDomain);
if (IsCollectible())
{
// TODO: the ShuffleThunkCache should really be using the m_pStubHeap, however the unloadability support
// doesn't track the stubs or the related delegate classes and so we get crashes when a stub is used after
// the AssemblyLoaderAllocator is gone (the stub memory is unmapped).
// https://github.com/dotnet/runtime/issues/55697 tracks this issue.
m_pShuffleThunkCache = new ShuffleThunkCache(SystemDomain::GetGlobalLoaderAllocator()->GetExecutableHeap());
m_pShuffleThunkCache = new ShuffleThunkCache(m_pStubHeap);
}
}

Expand Down

0 comments on commit 81976ed

Please sign in to comment.