Skip to content

Conversation

@janvorli
Copy link
Member

The AssemblyLoadContext.InitiateUnload method was not handling multiple calls correctly. Instead of making the extra calls dummy, it was calling the native runtime helper PrepareForAssemblyLoadContextRelease again.

This change fixes it by simply ensuring that the runtime helper is called just once.

Close #91087

The AssemblyLoadContext.InitiateUnload method was not handling multiple
calls correctly. Instead of making the extra calls dummy, it was
calling the native runtime helper again.

This change fixes it by simply ensuring that the runtime helper is
called just once.
@jkotas
Copy link
Member

jkotas commented Aug 29, 2023

Can we add a test for this?

@ghost
Copy link

ghost commented Aug 29, 2023

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

The AssemblyLoadContext.InitiateUnload method was not handling multiple calls correctly. Instead of making the extra calls dummy, it was calling the native runtime helper PrepareForAssemblyLoadContextRelease again.

This change fixes it by simply ensuring that the runtime helper is called just once.

Close #91087

Author: janvorli
Assignees: janvorli
Labels:

area-AssemblyLoader-coreclr, area-VM-coreclr

Milestone: 8.0.0

Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@janvorli janvorli merged commit e205d4b into dotnet:main Aug 30, 2023
@janvorli
Copy link
Member Author

/backport to release/8.0

@github-actions
Copy link
Contributor

Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6027997234

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calling AssemblyLoadContext.Unload multiple times causes fatal crash

2 participants