Skip to content
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

System.Text.Json.SourceGeneration.UnitTests.GeneratorTests failing with OutOfMemoryException on net7.0-windows-Release-x86-CoreCLR_checked-Windows.10.Amd64.Open #71962

Closed
jtschuster opened this issue Jul 11, 2022 · 16 comments · Fixed by #99078

Comments

@jtschuster
Copy link
Member

jtschuster commented Jul 11, 2022

Affects:

  • System.Text.Json.SourceGeneration.UnitTests.GeneratorTests
  • System.Text.Json.SourceGeneration.UnitTests.JsonSourceGeneratorDiagnosticsTests

Official run failures are typically on net7.0-windows-Release-x86-CoreCLR_checked-Windows.10.Amd64.Open

Frequency 4/20-8/5 (incl. PRs from Kusto):

Day Run Notes
7/31 JIT stress 28x failures
7/30 Rolling run 2x failures
7/30 JIT stress 96x failures
7/28 JIT stress 1x failure
7/28 JIT stress 42x failures
7/27 Rolling run 20x failures
7/12 JIT stress 12x failures
7/11 Rolling run 18x failures -- (12x at 9:08am + 6x at 3:48am)
7/11 JIT stress 18x failures
7/10 JIT stress 36x failures
7/9 JIT stress 12x failures
7/8 Rolling run 12x failures
7/8 JIT stress 24x failures
7/8 JIT stress - PR #71707 36x failures
7/7 JIT stress 24x failures
7/7 JIT stress - PR #71455 24x failures
let failedTests = (testNameSubstring : string, methodName : string, includePR : bool, messageSubstr: string, includePassedOnRerun : bool) {
cluster('engsrvprod.kusto.windows.net').database('engineeringdata').AzureDevOpsTests
    | where TestName contains testNameSubstring
    | where includePassedOnRerun or (Outcome == 'Failed')
    | extend startOfTestName = indexof_regex(TestName, @"[^.]+$")
    | extend Method = substring(TestName, startOfTestName)
    | extend Type = substring(TestName, 0, startOfTestName - 1)
    | project-away startOfTestName
    | where (methodName == '') or (Method == methodName)
    | where Message contains messageSubstr
    | distinct JobId, WorkItemId, Message, StackTrace, Method, Type, Arguments, Outcome
    | join kind=inner (cluster('engsrvprod.kusto.windows.net').database('engineeringdata').Jobs
        | where ((Branch == 'refs/heads/main') or (Branch == 'refs/heads/master') or (includePR and (Source startswith "pr/")))
        | where Type startswith "test/functional/cli/"
            and not(Properties contains "runtime-staging")
        | summarize arg_max(Finished, Properties, Type, Branch, Source, Started, QueueName) by JobId
        | project-rename JobType = Type) on JobId
    | extend PropertiesJson = parse_json(Properties)
    | extend OS = replace_regex(tostring(PropertiesJson.operatingSystem), @'\((.*)\).*|([^\(].*)', @'\1\2')
    | extend Runtime = iif(PropertiesJson.runtimeFlavor == "mono", "Mono", iif(PropertiesJson.DefinitionName contains "coreclr", "CoreCLR", ""))
    | extend TargetBranch = extractjson("$.['System.PullRequest.TargetBranch']", Properties)
    | extend Architecture = PropertiesJson.architecture
    | extend Scenario = iif(isempty(PropertiesJson.scenario), "--", PropertiesJson.scenario)
    //| extend DefinitionName = PropertiesJson.DefinitionName
    | project-away PropertiesJson
};
failedTests('System.Text.Json.SourceGeneration.UnitTests', '', true, 'OutOfMemoryException', true);
  • 7/22 Runfo report - only 3 builds affected in last 60 days (incl. PRs), with total of 30 test failures (2 failures are dupes):

Query, Log

Starting:    System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests (parallel test collections = on, max threads = 4)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TestMultipleDefinitions [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(705,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TestMultipleDefinitions()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryWithRenamedAttribute [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(125,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedLocationCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(166,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryWithRenamedAttribute()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(451,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedLibRecordCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(519,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoWarningsDueToObsoleteMembers [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(741,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoWarningsDueToObsoleteMembers()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordDerivedFromRecordInExternalAssembly [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(478,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedSimpleLibRecordCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(565,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordDerivedFromRecordInExternalAssembly()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.CollectionDictionarySourceGeneration [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(181,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedHighLowTempsCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(348,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.CollectionDictionarySourceGeneration()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoErrorsWhenUsingIgnoredReservedCSharpKeywords [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(801,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoErrorsWhenUsingIgnoredReservedCSharpKeywords()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json", includeSTJ: True) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json.Not", includeSTJ: True) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json", includeSTJ: False) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json.Not", includeSTJ: False) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.ContextTypeNotInNamespace [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(428,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.ContextTypeNotInNamespace()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests
@jtschuster jtschuster added area-System.Text.Json blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' untriaged New issue has not been triaged by the area owner test-failure labels Jul 11, 2022
@ghost
Copy link

ghost commented Jul 11, 2022

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

Query, Log

Starting:    System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests (parallel test collections = on, max threads = 4)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TestMultipleDefinitions [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(705,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TestMultipleDefinitions()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryWithRenamedAttribute [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(125,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedLocationCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(166,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryWithRenamedAttribute()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(451,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedLibRecordCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(519,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoWarningsDueToObsoleteMembers [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(741,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoWarningsDueToObsoleteMembers()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordDerivedFromRecordInExternalAssembly [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(478,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedSimpleLibRecordCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(565,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordDerivedFromRecordInExternalAssembly()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.CollectionDictionarySourceGeneration [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(181,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateReferencedHighLowTempsCompilation()
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(348,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.CollectionDictionarySourceGeneration()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoErrorsWhenUsingIgnoredReservedCSharpKeywords [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(801,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoErrorsWhenUsingIgnoredReservedCSharpKeywords()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json", includeSTJ: True) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json.Not", includeSTJ: True) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json", includeSTJ: False) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: "System.Text.Json.Not", includeSTJ: False) [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(277,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(String assemblyName, Boolean includeSTJ)
           at InvokeStub_GeneratorTests.LocalJsonSerializableAttributeExpectedShape(Object, Object, IntPtr*)
           at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
    System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.ContextTypeNotInNamespace [FAIL]
      System.OutOfMemoryException : Insufficient memory to continue the execution of the program.
      Stack Trace:
        /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs(135,0): at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs(94,0): at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size)
        /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs(167,0): at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size)
           at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs(37,0): at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ)
        /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorTests.cs(428,0): at System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.ContextTypeNotInNamespace()
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs(74,0): at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
  Finished:    System.Text.Json.SourceGeneration.Roslyn4.0.Unit.Tests
Author: jtschuster
Assignees: -
Labels:

area-System.Text.Json, blocking-clean-ci, untriaged, test-failure

Milestone: -

@krwq
Copy link
Member

krwq commented Jul 12, 2022

is this consistent repro? this looks more like something wrong with machine rather than JSON

@krwq
Copy link
Member

krwq commented Jul 12, 2022

@jakobbotsch this seems like it happened in the same run 2min apart from each other (7/11/2022, 10:18:42 AM & 7/11/2022, 10:16:39 AM) but machines do in fact look like they're different: a000XKI & a000XJR. I'm curious if there was some external factor perhaps.

I'd be interested in seeing if we have more instances of this before investigating.

@jakobbotsch
Copy link
Member

libraries-jitstress runs many scenarios (different environment variables) and triggers multiple helix job runs simultaneously, so it is not surprising that the timestamps are close to each other since indeed the pipeline run that triggered them is the same.

@jakobbotsch
Copy link
Member

I do see pretty significant memory usage in this test when running it locally:
image

@krwq krwq added this to the 7.0.0 milestone Jul 12, 2022
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 12, 2022
@krwq
Copy link
Member

krwq commented Jul 12, 2022

we should either fix memory consumption or disable memory heavy test cases in 7.0

@eiriktsarpalis
Copy link
Member

Since this concerns unit testing for the source generator, wonder whether this could be related #71653

cc @CyrusNajmabadi

@danmoseley
Copy link
Member

danmoseley commented Jul 14, 2022

Is it important to run the generator tests on a checked runtime? If not why not just disable them [SkipOnCoreClr("Uses too much memory", ~RuntimeConfiguration.Release)] on each class. It looks like it might work on the whole assembly if you need it to.

@karelz
Copy link
Member

karelz commented Jul 22, 2022

Note: It has been problem only in 3 builds in last 60 days (see top post). Removing the blocking-clean-ci label for now.

@karelz karelz removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 22, 2022
@karelz
Copy link
Member

karelz commented Jul 22, 2022

Actually, Kusto shows more failures -- see updated top post. Adding the label back.
If it does not happen again for 1-2 weeks, we can remove it again.

@karelz karelz added the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Jul 22, 2022
@VincentBu
Copy link

Failed again in: runtime-coreclr libraries-jitstress 20220727.1

Failed test:

net7.0-windows-Release-x86-CoreCLR_checked-jitminopts-Windows.10.Amd64.Open
- System.Text.Json.SourceGeneration.UnitTests.JsonSourceGeneratorDiagnosticsTests.UnsuccessfulSourceGeneration

net7.0-windows-Release-x86-CoreCLR_checked-jitstress1_tiered-Windows.10.Amd64.Open
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeUnexpectedShape(assemblyName: \"System.Text.Json.Not\", includeSTJ: False)

net7.0-windows-Release-x86-CoreCLR_checked-jitstress1-Windows.10.Amd64.Open
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeUnexpectedShape(assemblyName: \"System.Text.Json.Not\", includeSTJ: False)
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryWithRenamedAttribute
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordDerivedFromRecordInExternalAssembly
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TestMultipleDefinitions
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: \"System.Text.Json.Not\", includeSTJ: False)
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: \"System.Text.Json\", includeSTJ: False)
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: \"System.Text.Json.Not\", includeSTJ: True)
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.LocalJsonSerializableAttributeExpectedShape(assemblyName: \"System.Text.Json\", includeSTJ: True)
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.CollectionDictionarySourceGeneration
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.ContextTypeNotInNamespace
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoWarningsDueToObsoleteMembers
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.NoErrorsWhenUsingIgnoredReservedCSharpKeywords

net7.0-windows-Release-x86-CoreCLR_checked-jitstress2-Windows.10.Amd64.Open
- System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.TypeDiscoveryPrimitiveExternalPOCO

Error message:

System.OutOfMemoryException : Insufficient memory to continue the execution of the program.


Stack trace
   at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Windows.cs:line 135
   at System.Runtime.InteropServices.Marshal.AllocHGlobal(Int32 cb) in /_/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs:line 31
   at System.Reflection.Internal.NativeHeapMemoryBlock.DisposableData..ctor(Int32 size) in /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs:line 32
   at System.Reflection.Internal.NativeHeapMemoryBlock..ctor(Int32 size) in /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/NativeHeapMemoryBlock.cs:line 62
   at System.Reflection.Internal.StreamMemoryBlockProvider.ReadMemoryBlockNoLock(Stream stream, Int64 start, Int32 size) in /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/Internal/MemoryBlocks/StreamMemoryBlockProvider.cs:line 71
   at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options, Int32 size) in /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs:line 188
   at System.Reflection.PortableExecutable.PEReader..ctor(Stream peStream, PEStreamOptions options) in /_/src/libraries/System.Reflection.Metadata/src/System/Reflection/PortableExecutable/PEReader.cs:line 126
   at Microsoft.CodeAnalysis.ModuleMetadata.CreateFromStream(Stream peStream, PEStreamOptions options)
   at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(Stream peStream, String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
   at Microsoft.CodeAnalysis.MetadataReference.CreateFromFile(String path, MetadataReferenceProperties properties, DocumentationProvider documentation)
   at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateCompilation(String source, MetadataReference[] additionalReferences, String assemblyName, Boolean includeSTJ, Func`2 configureParseOptions) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs:line 38
   at System.Text.Json.SourceGeneration.UnitTests.CompilationHelper.CreateActiveOrUpcomingEventCompilation() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/CompilationHelper.cs:line 169
   at System.Text.Json.SourceGeneration.UnitTests.JsonSourceGeneratorDiagnosticsTests.<UnsuccessfulSourceGeneration>g__RunTest|2_0(Boolean explicitRef) in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs:line 149
   at System.Text.Json.SourceGeneration.UnitTests.JsonSourceGeneratorDiagnosticsTests.UnsuccessfulSourceGeneration() in /_/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs:line 216
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodInvoker.cs:line 64

@danmoseley
Copy link
Member

We need to disable for chk CLR as suggested above

@jakobbotsch
Copy link
Member

jakobbotsch commented Jul 31, 2022

We are still hitting this on jit pipelines that run libraries tests frequently.
For example, our latest weekend libraries-pgo run hit this 9 8 times in separate runs: https://dev.azure.com/dnceng/public/_build/results?buildId=1913659&view=ms.vss-test-web.build-test-results-tab

Note that I believe the x86 host is not large address aware, so the 1.8 GB memory usage in my screenshot above is quite close to the 2.1 GB limit on x86.

@danmoseley
Copy link
Member

@krwq what do you propose here?

@karelz karelz removed the blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' label Aug 5, 2022
@karelz
Copy link
Member

karelz commented Aug 5, 2022

Removing 'blocking-clean-ci' - the tests were disabled on non-Release runs in PR #73181

@jeffhandley jeffhandley removed this from the 7.0.0 milestone Aug 9, 2022
@jeffhandley jeffhandley added this to the Future milestone Aug 9, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 28, 2024
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Feb 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants