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

Fixed heap corruption in HttpListener #33110

Merged
merged 1 commit into from
Mar 3, 2020

Conversation

ManickaP
Copy link
Member

@ManickaP ManickaP commented Mar 3, 2020

Fixes #31997

In non-blocking HttpListenerResponse.Close, RequestContextBase was being disposed multiple times from different threads. This fix ensures that the underlying IntPtr is freed only once, even in multi-threaded scenarios.

Full explanation here: #31997 (comment)

@ManickaP ManickaP requested a review from a team March 3, 2020 16:15
@ManickaP ManickaP self-assigned this Mar 3, 2020
@ManickaP
Copy link
Member Author

ManickaP commented Mar 3, 2020

/azp run runtime-libraries outerloop

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks.

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

…e even in multi-threaded and multiple Dispose calls.
@ManickaP ManickaP force-pushed the mapichov/31997_heap_corruption branch from b89c8fd to cfcb23d Compare March 3, 2020 20:05
@ManickaP
Copy link
Member Author

ManickaP commented Mar 3, 2020

Test failures seem unrelated, can be seen on other PRs as well. Might be fixed with #32827, so rebasing on current master and we'll see.
I'll merge either way, but I might file some issues if the mono tests fail again.

@ManickaP ManickaP merged commit 2fa324b into dotnet:master Mar 3, 2020
@ManickaP ManickaP deleted the mapichov/31997_heap_corruption branch March 3, 2020 21:57
@davidsh davidsh added this to the 5.0 milestone Mar 10, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
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.

Heap corruption in System.Net.HttpListener tests
6 participants