-
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
[metadata-update] Make a copy of the DIL when applying updates #52344
Conversation
Tagging subscribers to this area: @CoffeeFlux Issue DetailsOtherwise we may point into memory that is cleaned up by the GC
|
1b187fb
to
2020c07
Compare
Would like to backport this to 6.0-preview4 |
/cc @marek-safar |
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
Otherwise we may point into memory that is cleaned up by the GC
2020c07
to
a4d2966
Compare
/* TODO: find a better memory manager. But this way we at least won't lose the IL data. */ | ||
MonoMemoryManager *mem_manager = (MonoMemoryManager *)mono_alc_get_default ()->memory_manager; |
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.
I know I could use m_image_get_memory_manager (base_image)
here, but that function looks different in 6.0-preview4, so for the sake of the backport, I'd rather dump the delta IL into the default memory manager for now.
Verified via manual testing that we no longer crash if dil_data is corrupted (or ends up pointing at reclaimed memory) by changing
to LoadMetadataUpdate (assm, dmeta_data, dil_data, dpdb_data);
for (int i = 0; i < dil_data.Length; ++i)
dil_data[i] = (byte)255; |
/backport to release/6.0-preview4 |
Started backporting to release/6.0-preview4: https://github.com/dotnet/runtime/actions/runs/815283039 |
Otherwise we may point into memory that is cleaned up by the GC