-
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
[release/9.0-staging] Fix few RandomAccess.Write edge case bugs #109646
base: release/9.0-staging
Are you sure you want to change the base?
[release/9.0-staging] Fix few RandomAccess.Write edge case bugs #109646
Conversation
* add test for Int32 overflow for WriteGather in RandomAccess * add failing test fore more than IOV_MAX buffers * fix both the native and managed parts --------- Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com> Co-authored-by: Stephen Toub <stoub@microsoft.com>
Tagging subscribers to this area: @dotnet/area-system-io |
/azp list |
/azp run runtime-libraries-coreclr outerloop |
Azure Pipelines successfully started running 1 pipeline(s). |
@adamsitnik did you want to port the same test fixes to this PR that you mentioned in #109648? |
|
Ok, please add back servicing-consider when it's ready. |
Backport of #108380 and #109340 to release/9.0-staging
Customer Impact
Customers using
RandomAccess.Write
overload that accepts multiple buffers have observedIOException
being thrown in two scenarios:Int32
) overflows and the method tries to perform a write with negative file offset. Reported by the user in RandomAccess.Write throws System.IO.IOException: The parameter is incorrect. #108322.IOV_MAX
(usually 1024). Reported by the user in RandomAccess.Write throws System.IO.IOException: Invalid argument when buffers count is greater than 1024 #108383.When I was fixing #108383 I've realized that the logic for handling incomplete writes has a bug.
For incomplete multi-buffer writes, the API was not reporting any exceptions. It returns void, so it should write everything or throw an exception.
Regression
We had all 3 bugs since the API was introduced (.NET 6).
Testing
New unit tests were added. They were failing before the fix were applied. They are passing now.
Risk
Low, the fix is simple and covered with tests.