dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.36k stars 4.75k forks source link

OOM on System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing #88272

Open steveharter opened 1 year ago

steveharter commented 1 year ago

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=326554 Build error leg or test failing: System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing Pull request: https://github.com/dotnet/runtime/pull/87335

System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing [FAIL]
  System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown.
  Stack Trace:
    /_/src/libraries/System.Private.CoreLib/src/System/Array.cs(63,0): at System.Array.Resize[T](T[]& array, Int32 newSize)
    /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs(200,0): at System.Buffers.ArrayBufferWriter`1.CheckAndResizeBuffer(Int32 sizeHint)
    /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs(134,0): at System.Buffers.ArrayBufferWriter`1.GetMemory(Int32 sizeHint)
    /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs(1069,0): at System.Text.Json.Utf8JsonWriter.Grow(Int32 requiredSize)
    /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Raw.cs(266,0): at System.Text.Json.Utf8JsonWriter.WriteRawValueCore(ReadOnlySpan`1 utf8Json, Boolean skipInputValidation)
    /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Raw.cs(113,0): at System.Text.Json.Utf8JsonWriter.WriteRawValue(ReadOnlySpan`1 utf8Json, Boolean skipInputValidation)
    /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.WriteRaw.cs(373,0): at System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing()
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(59,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

System.Text.Json.Tests: [Long Running Test] 'System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawMaxUtf16InputLength', Elapsed: 00:02:03

{
  "ErrorMessage": "",
  "ErrorPattern": "System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing.*System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: :mag_right: https://dev.azure.com/dnceng-public/public/_build/results?buildId=326554 Error message validated: System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing.*System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown Result validation: :x: Known issue did not match with the provided build. Validation performed at: 6/30/2023 9:23:10 PM UTC

Report

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
0 0 0
ghost commented 1 year ago

Tagging subscribers to this area: @dotnet/area-system-text-json, @gregsdennis See info in area-owners.md if you want to be subscribed.

Issue Details
## Build Information Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=326554 Build error leg or test failing: System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing Pull request: https://github.com/dotnet/runtime/pull/87335 System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing [FAIL] System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown. Stack Trace: /_/src/libraries/System.Private.CoreLib/src/System/Array.cs(63,0): at System.Array.Resize[T](T[]& array, Int32 newSize) /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs(200,0): at System.Buffers.ArrayBufferWriter`1.CheckAndResizeBuffer(Int32 sizeHint) /_/src/libraries/Common/src/System/Buffers/ArrayBufferWriter.cs(134,0): at System.Buffers.ArrayBufferWriter`1.GetMemory(Int32 sizeHint) /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.cs(1069,0): at System.Text.Json.Utf8JsonWriter.Grow(Int32 requiredSize) /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Raw.cs(266,0): at System.Text.Json.Utf8JsonWriter.WriteRawValueCore(ReadOnlySpan`1 utf8Json, Boolean skipInputValidation) /_/src/libraries/System.Text.Json/src/System/Text/Json/Writer/Utf8JsonWriter.WriteValues.Raw.cs(113,0): at System.Text.Json.Utf8JsonWriter.WriteRawValue(ReadOnlySpan`1 utf8Json, Boolean skipInputValidation) /_/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Utf8JsonWriterTests.WriteRaw.cs(373,0): at System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing() at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(59,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) System.Text.Json.Tests: [Long Running Test] 'System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawMaxUtf16InputLength', Elapsed: 00:02:03 ```json { "ErrorMessage": "", "ErrorPattern": "System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawLargeJsonToStreamWithoutFlushing.*System.OutOfMemoryException : Exception of type 'System.OutOfMemoryException' was thrown", "BuildRetry": false, "ExcludeConsoleLog": false } ```
Author: steveharter
Assignees: -
Labels: `area-System.Text.Json`, `blocking-clean-ci`, `Known Build Error`
Milestone: -
eiriktsarpalis commented 1 year ago

I'm also seeing System.Text.Json.Tests.Utf8JsonWriterTests.WriteRawMaxUtf16InputLength fail a couple of times with OOM in the same build. It all impacts Debug builds on Windows.

eiriktsarpalis commented 1 year ago

The test was disabled on Linux for similar reasons. I've posted https://github.com/dotnet/runtime/pull/89442 which disables it altogether.