-
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
Fix pGeneratedNewStub determination #80128
Conversation
@ChrisAhna Yes please. Your note regarding avoiding touching "old code" is correct, but in this case the unnecessary complexity is more of a cost than the risk of changing something that isolated and and simple to manually audit once applied. |
@AaronRobinsonMSFT, thanks for taking a look! I'll update the PR. |
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.
Thank you!
@ChrisAhna Feel free to squash and merge when you are ready. |
/backport to release/7.0 |
Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3850655141 |
Fixes #80127.
See the issue, the especially the "Other Information" section, for details on the problem that is being fixed.
With this change in place, launching the "TryStructMarshal.exe 40" repro app in a loop runs indefinitely without ever failing (on the same NUMBER_OF_PROCESSORS=8 VM where "TryStructMarshal.exe 40" fails 10+% of the time without the change).
Beyond the changes in the PR, one other note is that the ILStubCreatorHelperHolder concept seems to be unnecessary. The operation of HolderLeave is identical to the operation of the ILStubCreatorHelper dtor. I believe that every path which calls HolderLeave will also imminently call the ILStubCreatorHelper dtor, meaning it should be safe to remove HolderLeave along with the ILStubCreatorHelperHolder concept as a whole (with the ILStubCreatorHelperHolder ctor calls just being rewritten as explicit calls to GetStubMethodDesc).
I didn't include this removal in the PR on the grounds that CreateInteropILStub is "old code" where it's often better to keep churn to a minimum. But I'd be happy to get rid of ILStubCreatorHelperHolder as well if there is interest in making a larger change here.