-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Allocate handles for custom marshalers in ALCs instead of in the AppDomain. #25105
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
Looks like the pending checks are finished on AzDO and the timeout is from Helix queue length being too long. I'm going to merge this in. |
@jkoritzinsky I've just ran this inside of a collectible AssemblyLoadContext and it doesn't work correctly. It crashes during LoaderAllocator shutdown, as you can see below. The problem is that at the point where it is trying to free the handle, the LoaderAllocator's handle table and in fact the managed LoaderAllocator that keeps that table is long gone.
|
It looks like there's one path that the destructor isn't called from within LoaderAllocator shutdown. When there's a race between multiple threads to create the same custom marshaler info, only one is kept and the others are released. |
…omain. (dotnet/coreclr#25105) Commit migrated from dotnet/coreclr@a8b4c8f
Fixes #25100