Skip to content

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented Aug 25, 2021

@ghost
Copy link

ghost commented Aug 25, 2021

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

}
finally
{
Marshal.FreeHGlobal((IntPtr)pBuffer);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is fixing the double-free.

}
finally
{
NativeMemory.Free(processInfo);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is fixing a related memory leak.

finally
{
Marshal.FreeHGlobal((IntPtr)entries);
NativeMemory.Free(entries);
Copy link
Member Author

Choose a reason for hiding this comment

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

Took this as an opportunity to switch to NativeMemory API and avoid the casts in these files.

@ghost
Copy link

ghost commented Aug 25, 2021

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

Issue Details

Fixes #14537 (comment)

Author: jkotas
Assignees: -
Labels:

area-System.Diagnostics.Process

Milestone: -

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

LGTM

@wfurt wfurt added the os-freebsd FreeBSD OS label Aug 25, 2021
@Thefrank
Copy link
Contributor

ooooh! So, this fixes the segfault that started to crop up after some SDK changes around preview 3?

Also, will this get back ported to 6.0?

@jkotas jkotas merged commit 3633a7d into dotnet:main Aug 25, 2021
@jkotas jkotas deleted the freebsd-fix branch August 25, 2021 06:04
@jkotas
Copy link
Member Author

jkotas commented Aug 25, 2021

So, this fixes the segfault that started to crop up after some SDK changes around preview 3?

Probably. That something you can verify. I have not verified it.

Also, will this get back ported to 6.0?

@danmoseley Are you willing to take this for 6.0? This is a fix for double-free bug in FreeBSD specific code, not touching officially supported configs.

@adamsitnik adamsitnik added this to the 7.0.0 milestone Aug 25, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2021
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.

Support for FreeBSD

4 participants