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

[release/7.0] Ensure we cleanup the marshalling for elements of collections (stateful and stateless) #76693

Merged
merged 7 commits into from
Oct 7, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Oct 5, 2022

Backport of #76629 to release/7.0

/cc @AaronRobinsonMSFT @jkoritzinsky

Customer Impact

We accidentally lost the element marshalling when moving to the released marshaller design. This PR adds it back with matching logic to the previous marshaller design. During the late revision of the new marshaller design, this was missed due to the limited impact on broader BCL usage. This is a part of the new LibraryImport marshaller for .NET 7 so doesn't represent any previous release regression. Without this change we will be shipping a set of scenarios where unmanaged memory is leaked. This was limited to a narrow set of types in the BCL since most types are blittable and don't need the clean-up pass, but those types that are impacted tend to be used in scenarios where leaks would very impactful - System.Drawing.

This was discovered through manual inspection - see #76584.

Testing

Testing was added for this clean-up. We had already added verification testing for many of the other clean-up paths.

Risk

Low. This is adding back some missing logic from the new APIs for people to request element marshalling.

@ghost
Copy link

ghost commented Oct 5, 2022

Tagging subscribers to this area: @dotnet/interop-contrib
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #76629 to release/7.0

/cc @AaronRobinsonMSFT @jkoritzinsky

Customer Impact

Testing

Risk

IMPORTANT: Is this backport for a servicing release? If so and this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

Author: github-actions[bot]
Assignees: -
Labels:

area-System.Runtime.InteropServices

Milestone: -

@AaronRobinsonMSFT AaronRobinsonMSFT added the Servicing-consider Issue for next servicing release review label Oct 6, 2022
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 7.0.x milestone Oct 6, 2022
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

approved. please get a code review and we will take for consideration in 7 ga.

@jeffschwMSFT jeffschwMSFT added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Oct 6, 2022
@jeffschwMSFT jeffschwMSFT modified the milestones: 7.0.x, 6.0.x, 7.0.0 Oct 6, 2022
@jeffschwMSFT
Copy link
Member

@AaronRobinsonMSFT can you take a look at the ci failures?

@AaronRobinsonMSFT
Copy link
Member

@jeffschwMSFT Yep, I will be updating this PR today.

…erop.SourceGeneration/MarshallingAttributeInfo.cs

Co-authored-by: Elinor Fung <elfung@microsoft.com>
@carlossanlop
Copy link
Member

CI failure was a timeout cancellation during the execution of the Build Browser wasm windows Release LibraryTests_AOT queue. Which I assume is unrelated to this change. Everything else is green.

Approved by Tactics. Signed off. Ready to merge. :shipit:

@carlossanlop carlossanlop merged commit 0d944ae into release/7.0 Oct 7, 2022
@carlossanlop carlossanlop deleted the backport/pr-76629-to-release/7.0 branch October 7, 2022 20:08
@ghost ghost locked as resolved and limited conversation to collaborators Nov 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants