-
Notifications
You must be signed in to change notification settings - Fork 4.9k
[release/2.1] Fix ReadOnlySequence created out of sliced Memory owned by MemoryManager #43141
Conversation
Co-authored-by: Adam Sitnik <[email protected]>
|
@dotnet/area-system-memory can someone please review this and be assigned as owner to take to tactics? |
jozkee
left a comment
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.
No backporting conflicts and test classes in 2.1 seem similar as the ones in 3.1, which already contains the fix.
|
cc @Pilchie - for ASP.NET.. |
|
@dotnet/area-infrastructure-libraries all Linux legs are being cancelled with this message: Is that concerning? |
|
@danmoseley @ericstj looks like the release/2.1 branch isn't buildable and testable anymore based on Helix and docker EOL changes. Personally I didn't know that we still do servicing updates for 2.1 in the open. |
|
Ping @ericstj @danmoseley |
|
Chatted offline -- we believe we can merge this once it's ready. I think this still needs package authoring. Here's a recent example of a 2.1 fix that shipped a package: 24e09fe |
|
Done @ericstj. |
|
@teo-tsirpanis @dotnet/area-infrastructure-libraries don't we need to include System.Memory in src/packages.builds? @ericstj does this still require local validation i.e: building 2.1 locally on Linux? |
|
Oops I forgot it, will fix it soon. |
|
Done @jozkee. |
|
Talked to @mmitche about this. We can take the change in the public repo, we will manually take care of any internal flows. |
ViktorHofer
left a comment
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.
Infra changes LGTM
Fixes issue dotnet/runtime#57472
Main pr dotnet/runtime#57479
Also backported to 5.0 in dotnet/runtime#57562 and 3.1 in #43102. This PR will pave the way for backporting it to the
System.MemoryOOB package for .NET Framework.Customer Impact
A customer has encountered dotnet/runtime#57472 while on .NET Framework and reported it in dotnet/runtime#67295, necessiating backporting it once again. As an example provided in that issue, this memory manager:
will fail two of the following tests:
Testing
Failing test has been added in this PR.
Risk
Low, as the change is very simple and obvious when you look at
ReadOnlySequence<T>ctor that acceptsReadOnlyMemory<T>(notice line 133 versus lines 140 and 148):corefx/src/System.Memory/src/System/Buffers/ReadOnlySequence.cs
Lines 130 to 149 in 0d40b48
Moreover, the changed code gets triggered only when creating a
ReadOnlySequencefrom aReadOnlyMemorybacked by aMemoryManager. All other use cases (including creating from an array or from aReadOnlyMemorybacked by an array or a string) are unaffected. And the changes are identical to those in the other backports.Regression
This is not a regression.