Skip to content

Starting any URI test leads to a stack overflow in System.Private.CoreLib #40073

@alnikola

Description

@alnikola

Description

Any attempt to run System.Private.Uri/FunctionalTests leads to a stack overflow in CoreLib and finally fails with StackOverflowException. The exception gets thrown somewhere in the application startup logic before actual test code starts executing.

Configuration

It was reproduced using the latest master on 3 different local machines running Windows 10 (confirmed on ver. 1909).
Repro steps:

  1. Checkout master
  2. Pull the latest master
  3. Clear local repo
    git clean -xfd
  4. Build coreclr in release and libraries in debug
    build clr+libs -c debug -rc release
  5. Completely build System.Private.Uri solution
    build -project src\libraries\System.Private.Uri\System.Private.Uri.sln -rc release
  6. Go to FunctionalTests folder
    cd src\libraries\System.Private.Uri\tests\FunctionalTests
  7. Run all tests
    dotnet msbuild /t:Test /p:CoreCLRConfiguration=Release

Stack trace

  Stack overflow.
  Repeat 185 times:
  --------------------------------
     at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon)
     at System.SR.InternalGetResourceString(System.String)
     at System.SR.GetResourceString(System.String, System.String)
     at System.SR.GetResourceString(System.String)
     at System.SR.get_Arg_NullReferenceException()
     at System.NullReferenceException..ctor()
  --------------------------------
     at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon)
     at System.SR.InternalGetResourceString(System.String)
     at System.SR.GetResourceString(System.String, System.String)
     at System.SR.GetResourceString(System.String)
     at System.SR.get_Arg_AccessViolationException()
     at System.AccessViolationException..ctor()
     at System.Runtime.CompilerServices.CastHelpers.TryGet(UIntPtr, UIntPtr)
     at System.Runtime.CompilerServices.CastHelpers.StelemRef_Helper(System.Object ByRef, Void*, System.Object)
     at System.Collections.Generic.ComparerHelpers.CreateDefaultEqualityComparer(System.Type)
     at System.Collections.Generic.EqualityComparer`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..cctor()
     at System.Collections.Generic.EqualityComparer`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Default()
     at System.Array.LastIndexOf[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon[], System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon, Int32, Int32)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].LastIndexOf(System.__Canon)
     at System.SR.InternalGetResourceString(System.String)
     at System.SR.GetResourceString(System.String, System.String)
     at System.SR.GetResourceString(System.String)
     at System.SR.get_Arg_AccessViolationException()
     at System.AccessViolationException..ctor()
     at System.Runtime.CompilerServices.CastHelpers.TryGet(UIntPtr, UIntPtr)
     at System.Runtime.CompilerServices.CastHelpers.StelemRef_Helper(System.Object ByRef, Void*, System.Object)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].AddWithResize(System.__Canon)
     at System.Collections.Generic.List`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].Add(System.__Canon)
     at System.SR.InternalGetResourceString(System.String)
     at System.SR.GetResourceString(System.String, System.String)
     at System.SR.GetResourceString(System.String)
     at System.SR.get_Arg_AccessViolationException()
     at System.AccessViolationException..ctor()
     at System.Runtime.CompilerServices.CastHelpers.TryGet(UIntPtr, UIntPtr)
     at System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void*, System.Object)
     at System.Collections.Generic.Dictionary`2[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]..ctor(Int32, System.Collections.Generic.IEqualityComparer`1<System.__Canon>)
     at System.AppContext.Setup(Char**, Char**, Int32)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions