-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Assert failure in SetLoaderAllocator() when calling a DynamicMethod with collectible AssemblyLoadContext #110987
Labels
area-AssemblyLoader-coreclr
in-pr
There is an active PR which will close this issue when it is merged
Comments
dotnet-policy-service
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Dec 29, 2024
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
steveharter
changed the title
Assert failure in SetLoaderAllocator() when calling a DynamicMethod in separate module and custom AssemblyLoadContext
Assert failure in SetLoaderAllocator() when calling a DynamicMethod with collectible AssemblyLoadContext
Dec 30, 2024
janvorli
added a commit
to janvorli/runtime
that referenced
this issue
Jan 2, 2025
There is one `DynamicMethodTable` allocated per `Module` if needed. When its instance is being created, an incorrect `LoaderAllocator` is passed to the `CreateMinimalMethodTable` function. Instead of the `Module`'s `LoaderAllocator`, it passes in the default one. That fires an assert in non-release builds of the runtime and it results in incorrect marking of the `MethodTable` as not collectible in case the `Module`'s LoaderAllocator is collectible. This change fixes it by passing in the `LoaderAllocator` of the module instead. Close dotnet#110987
dotnet-policy-service
bot
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Jan 2, 2025
janvorli
added a commit
to janvorli/runtime
that referenced
this issue
Jan 3, 2025
There is one `DynamicMethodTable` allocated per `Module` if needed. When its instance is being created, an incorrect `LoaderAllocator` is passed to the `CreateMinimalMethodTable` function. Instead of the `Module`'s `LoaderAllocator`, it passes in the default one. That fires an assert in non-release builds of the runtime and it results in incorrect marking of the `MethodTable` as not collectible in case the `Module`'s LoaderAllocator is collectible. This change fixes it by passing in the `LoaderAllocator` of the module instead. Close dotnet#110987
janvorli
added a commit
that referenced
this issue
Jan 3, 2025
* Fix LoaderAllocator of DynamicMethodTable There is one `DynamicMethodTable` allocated per `Module` if needed. When its instance is being created, an incorrect `LoaderAllocator` is passed to the `CreateMinimalMethodTable` function. Instead of the `Module`'s `LoaderAllocator`, it passes in the default one. That fires an assert in non-release builds of the runtime and it results in incorrect marking of the `MethodTable` as not collectible in case the `Module`'s LoaderAllocator is collectible. This change fixes it by passing in the `LoaderAllocator` of the module instead. Close #110987 * Add regression test * Change the test to use MemoryStream
dotnet-policy-service
bot
removed
the
untriaged
New issue has not been triaged by the area owner
label
Jan 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area-AssemblyLoader-coreclr
in-pr
There is an active PR which will close this issue when it is merged
Using a checked runtime, the sample below fails with Assert in "_ASSERTE(pAllocator == GetLoaderAllocator())" in MethodTable::SetLoaderAllocator.
The text was updated successfully, but these errors were encountered: