-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[WinHttpHandler] Move _cachedSendPinnedBuffer
ownership to WinHttpRequestState
#101725
[WinHttpHandler] Move _cachedSendPinnedBuffer
ownership to WinHttpRequestState
#101725
Conversation
Tagging subscribers to this area: @dotnet/ncl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
To answer https://github.com/dotnet/corefx/pull/6500/files#diff-8db7e154523836be1aa177c05ae0decb22c602791eabf11d01823c80ac9927d8R131
It seems like the WriteAsync has also similar logic to ReadAsync, right?
Yes: runtime/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs Lines 131 to 135 in 017593d
Note that the logic is prone to races in both streams, but that's beyond this PR. |
This comment was marked as outdated.
This comment was marked as outdated.
There are possibly related outerloop failures, this needs investigation. |
…tonfirsov/runtime into fix-WinHttpRequestStream-race
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
After a second look and more testing, the failures look unrelated:
I will do a couple of further outerloop reruns before merging this. |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
All test failures are unrelated, merging. |
…#101725) Fixes a race between `WinHttpRequestStream.WriteAsync` and `WinHttpRequestStream.Dispose` that can lead to AV.
/backport to release/8.0-staging |
Started backporting to release/8.0-staging: https://github.com/dotnet/runtime/actions/runs/9034004390 |
…#101725) Fixes a race between `WinHttpRequestStream.WriteAsync` and `WinHttpRequestStream.Dispose` that can lead to AV.
A race between
WinHttpRequestStream.WriteAsync
andWinHttpRequestStream.Dispose
can lead toDispose
unpinning the buffer forwarded toWinHttp
, which can potentially lead toAccessViolationException
:runtime/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestStream.cs
Line 254 in 9fa1235
This has been fixed in dotnet/corefx#6500 for
WinHttpResponseStream
, this PR is applying the same fix forWinHttpRequestStream
.