Skip to content
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

Merged
merged 2 commits into from
Jan 5, 2023
Merged

Fix pGeneratedNewStub determination #80128

merged 2 commits into from
Jan 5, 2023

Conversation

ChrisAhna
Copy link
Member

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.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Jan 3, 2023
@LakshanF LakshanF removed the community-contribution Indicates that the PR has been added by a community member label Jan 3, 2023
@AaronRobinsonMSFT
Copy link
Member

But I'd be happy to get rid of ILStubCreatorHelperHolder as well if there is interest in making a larger change here.

@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 AaronRobinsonMSFT added this to the 8.0.0 milestone Jan 3, 2023
@ChrisAhna
Copy link
Member Author

@AaronRobinsonMSFT, thanks for taking a look! I'll update the PR.

Copy link
Member

@AaronRobinsonMSFT AaronRobinsonMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@AaronRobinsonMSFT
Copy link
Member

@ChrisAhna Feel free to squash and merge when you are ready.

@LakshanF LakshanF merged commit b592364 into dotnet:main Jan 5, 2023
@AaronRobinsonMSFT
Copy link
Member

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3850655141

@ghost ghost locked as resolved and limited conversation to collaborators Feb 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants