-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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] Fix crash in AssemblyBuilder::GetModules #55202
Conversation
* The "modules" field may be null if called before the end of the AssemblyBuilder ctor (which may happen in an OnAssemblyLoad event handler invoked during the basic_init VM call).
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
May be related to the null GetModules that we saw in dotnet/aspnetcore#33152 (comment) that I wasn't able to reproduce with a straightforward test. |
Yes, this is exactly the code path in aspnetcore where I saw the crash. (I'm still using the preview5 level of aspnetcore which doesn't have dotnet/aspnetcore#33263 applied yet.) |
Tagging subscribers to this area: Issue Details
This happens during some aspnetcore test cases. I'm not completely sure if the In any case, this patch at least removes the crash by special-casing a null
|
Hello @lambdageek! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
AssemblyBuilder ctor (which may happen in an OnAssemblyLoad event
handler invoked during the basic_init VM call).
This happens during some aspnetcore test cases. I'm not completely sure if the
OnAssemblyLoad
event handler is supposed to see that singleton module or not (looking at the CoreCLR sources I believe it may there), but that seems difficult to implement in Mono due to interactions between thebasic_init
calls inAssemblyBuilder
vs.ModuleBuilder
.In any case, this patch at least removes the crash by special-casing a null
modules
fields (like several otherAssemblyBuilder
accessor functions already do!), and the aspnetcore tests now pass.