Skip to content

Conversation

@joperezr
Copy link
Member

@joperezr joperezr commented Aug 19, 2020

Porting #41053 to release/5.0
Fixes #40946

Description

During a recent refactoring of System.DirectoryServices.Protocols code that added Linux implementation for the library, one bug was introduced since we started calling the wrong PInvoke in order to free some native resources which lead to a memory leak that would hit both the Windows and Unix case. This PR will make sure we call the right free instead so that the native resources are freed up correctly.

Customer Impact

Customers will not get a memory leak regression.

Regression?

Yes

Risk

low. Extensive testing was performed using both Benchmark.NET and the VS profiler in order to validate that these changes are now correctly freeing up the resources.

Test changes in this PR

We don't have the ability to test against a real LDAP server yet which is what would have caught this issue, but we have had several test runs since the original change was introduced where we would have native memory corruption and test execution would come to a halt. This change will make it so that will stop happening as we now know who was freeing up memory incorrectly.

cc: @danmosemsft @tarekgh

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 19, 2020
@joperezr joperezr requested a review from danmoseley August 19, 2020 23:23
@joperezr joperezr added area-System.DirectoryServices and removed area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI labels Aug 19, 2020
@danmoseley
Copy link
Member

approved - significant memory leak, reliability issue, customer reported, regression.

@joperezr joperezr merged commit 5525a35 into dotnet:release/5.0 Aug 20, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 7, 2020
@joperezr joperezr deleted the FixMemoryLeak50 branch August 11, 2021 20:59
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.

4 participants