-
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
[Mono] Fix uninitialized vtable bug #67746
[Mono] Fix uninitialized vtable bug #67746
Conversation
Tagging subscribers to this area: @dotnet/ncl Issue DetailsFixes #67402
|
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Looks good to me. We may want to consider a write test, but given the code quickly calls into a common method I don't think it is crucial.
/backport to release/6.0 |
Started backporting to release/6.0: https://github.com/dotnet/runtime/actions/runs/2115720964 |
…tem-io-stream-vtable-crash
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks so much for fixing this. Is there a workaround that doesn't include disabling AOT? |
The |
@jahmai-ca right now I don't know any other workaround |
This reverts commit daf631e.
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
…ozsival/runtime into fix-system-io-stream-vtable-crash
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run runtime-extra-platforms |
Azure Pipelines successfully started running 1 pipeline(s). |
Fixes #67402
The code which checks whether a class derived from
System.IO.Stream
has overridden certain methods didn't explicitly setup the vtable before it tried to dereference the vtable pointer. When AOT was enabled the vtable pointer was null and dereferencing it caused a crash.I also checked the other places where we access vtable and in most cases, we call themono_class_setup_vtable
method before we access the vtable except in two cases where it isn't obvious that the vtable is setup:cominterop.c:502
mini-trampolines.c:593
I don't want to add any modifications to those pieces of code in this PR but I'll check those two instances in more detail and I might follow-up with another PR later.EDIT: I analzyed the two pieces of code I mentioned previously and I came to the conclusion that accessing the vtable won't be a problem in those cases.