You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NullReferenceException has been observed from StreamPipeReader. Likely caused by misuse (multiple concurrent calls to ReadAsync), however a more useful error should be thrown than NRE.
From investigation:
There is a nullref if the internal Stream.ReadAsync call returns and StreamPipeReader is adding a new BufferSegment while at the same time the reader is being completed and unsets BufferSegment state.
The specific lines are BufferSegment.cs where segment.NextSegment can be null if BufferSegment.cs sets _next to null right after the while check in SetNext.
Another bug in the same scenario is an ArgumentOutOfRange exception when incrementing the End value at StreamPipeReader.cs which calls Slice on the AvailableMemory which is now empty from the Complete call.
Reproduction Steps
Possibly caused by multiple concurrent ReadAsync calls.
Expected behavior
More informative error. Or no error. Should look at what other pipe readers do in this situation.
Actual behavior
NullReferenceException thrown.
Regression?
No
Known Workarounds
No response
Configuration
.NET 8
Other information
No response
The text was updated successfully, but these errors were encountered:
Description
NullReferenceException has been observed from StreamPipeReader. Likely caused by misuse (multiple concurrent calls to
ReadAsync
), however a more useful error should be thrown than NRE.From investigation:
There is a nullref if the internal Stream.ReadAsync call returns and StreamPipeReader is adding a new BufferSegment while at the same time the reader is being completed and unsets BufferSegment state.
The specific lines are BufferSegment.cs where segment.NextSegment can be null if BufferSegment.cs sets _next to null right after the while check in SetNext.
Another bug in the same scenario is an ArgumentOutOfRange exception when incrementing the End value at StreamPipeReader.cs which calls Slice on the AvailableMemory which is now empty from the Complete call.
Reproduction Steps
Possibly caused by multiple concurrent ReadAsync calls.
Expected behavior
More informative error. Or no error. Should look at what other pipe readers do in this situation.
Actual behavior
NullReferenceException thrown.
Regression?
No
Known Workarounds
No response
Configuration
.NET 8
Other information
No response
The text was updated successfully, but these errors were encountered: