-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Mono] AssemblyLoadContext.Default must be instantiated in the runtime for embedding scenarios #48610
Comments
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. |
Tagging subscribers to this area: @CoffeeFlux Issue DetailsIn
Therefore, we would need the runtime to create the default ALC handle before it calls the preload hook for the first time.
|
In
Xamarin.Android
we are loading managed assemblies directly from the APK archive on the runtime, without unpacking them to the filesystem. This is done inside a preload hook we install with the Mono runtime.For .NET6 we want/need to switch to the ALC-enabled native assembly/image loading APIs, however all attempts to load an assembly image using the ALC APIs ends up in a segfault because the default ACL handle
doesn't exist yet.
The default ALC handle is not created until the managed code touches
AssemblyLoadContext.Default
, however we cannot hand control over to the managed runtime because the first assembly requested by Monoon initialization is
System.Private.CoreLib.dll
and the attempt to usemono_image_open_from_data_alc
(via a preload callback registered withmono_install_assembly_preload_hook_v3
) ends up with the followingsigsegv:
Therefore, we would need the runtime to create the default ALC handle before it calls the preload hook for the first time.
The text was updated successfully, but these errors were encountered: