Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Test failure: System.Text.Json.Tests.Utf8JsonWriterTests.WriteLargeJsonToStreamWithoutFlushing #34887

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

Closed
v-haren opened this issue Apr 13, 2020 · 2 comments

Comments

@v-haren
Copy link

v-haren commented Apr 13, 2020

failed in job: runtime-libraries outerloop 20200412.1

Error message

Assert.Throws() Failure
Expected: typeof(System.OverflowException)
Actual: typeof(System.OutOfMemoryException): Cannot allocate a buffer of size 2291549962.
---- System.OutOfMemoryException : Cannot allocate a buffer of size 2291549962.


Stack trace
   at System.Buffers.ArrayBufferWriter`1.ThrowOutOfMemoryException(UInt32 capacity) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 202
   at System.Buffers.ArrayBufferWriter`1.CheckAndResizeBuffer(Int32 sizeHint) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 185
   at System.Buffers.ArrayBufferWriter`1.GetMemory(Int32 sizeHint) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 130
   at System.Text.Json.Utf8JsonWriter.Grow(Int32 requiredSize) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs:line 1043
   at System.Text.Json.Utf8JsonWriter.WriteStringMinimized(ReadOnlySpan`1 escapedValue) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 267
   at System.Text.Json.Utf8JsonWriter.WriteStringByOptions(ReadOnlySpan`1 utf8Value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 253
   at System.Text.Json.Utf8JsonWriter.WriteStringValueHelper(ReadOnlySpan`1 utf8Value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 26
   at System.Text.Json.Utf8JsonWriter.WriteStringValue(JsonEncodedText value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 20
   at System.Text.Json.Tests.Utf8JsonWriterTests.<>c__DisplayClass34_0.<WriteLargeJsonToStreamWithoutFlushing>b__0() in /_/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs:line 755
----- Inner Stack Trace -----
   at System.Buffers.ArrayBufferWriter`1.ThrowOutOfMemoryException(UInt32 capacity) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 202
   at System.Buffers.ArrayBufferWriter`1.CheckAndResizeBuffer(Int32 sizeHint) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 185
   at System.Buffers.ArrayBufferWriter`1.GetMemory(Int32 sizeHint) in /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs:line 130
   at System.Text.Json.Utf8JsonWriter.Grow(Int32 requiredSize) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs:line 1043
   at System.Text.Json.Utf8JsonWriter.WriteStringMinimized(ReadOnlySpan`1 escapedValue) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 267
   at System.Text.Json.Utf8JsonWriter.WriteStringByOptions(ReadOnlySpan`1 utf8Value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 253
   at System.Text.Json.Utf8JsonWriter.WriteStringValueHelper(ReadOnlySpan`1 utf8Value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 26
   at System.Text.Json.Utf8JsonWriter.WriteStringValue(JsonEncodedText value) in /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.String.cs:line 20
   at System.Text.Json.Tests.Utf8JsonWriterTests.<>c__DisplayClass34_0.<WriteLargeJsonToStreamWithoutFlushing>b__0() in /_/src/libraries/System.Text.Json/tests/Utf8JsonWriterTests.cs:line 755
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-System.Text.Json untriaged New issue has not been triaged by the area owner labels Apr 13, 2020
@layomia
Copy link
Contributor

layomia commented Apr 13, 2020

Dup of #34481.

This was fixed for preview 4/master in #34489. Looks like we need to port the fix to preview 3: https://dev.azure.com/dnceng/public/_build/results?buildId=583321&view=results.

cc @jaredpar

@layomia
Copy link
Contributor

layomia commented Apr 14, 2020

Fixed in #34914.

@layomia layomia closed this as completed Apr 14, 2020
@layomia layomia removed the untriaged New issue has not been triaged by the area owner label Apr 29, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants