Repository navigation
Starting any URI test leads to a stack overflow in System.Private.CoreLib #40073
Copy link
Copy link
Closed
Closed
Copy link
Labels
area-Infrastructure-librariesuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Milestone
Description
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:
- Checkout master
- Pull the latest master
- Clear local repo
git clean -xfd - Build coreclr in release and libraries in debug
build clr+libs -c debug -rc release - Completely build System.Private.Uri solution
build -project src\libraries\System.Private.Uri\System.Private.Uri.sln -rc release - Go to FunctionalTests folder
cd src\libraries\System.Private.Uri\tests\FunctionalTests - 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)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area-Infrastructure-librariesuntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
Activity
john-h-k commentedon Jul 29, 2020
@JakenVeina I believe this is the same recurring exception you were having with your stack overflow with GLFW?
jkotas commentedon Jul 29, 2020
Step 5. "Completely build System.Private.Uri solution" rebuilds CoreLib with a broken version.
Before step 5 (good CoreLib):
After Step 5 (broken CoreLib, notice that the size is different):
ViktorHofer commentedon Jul 29, 2020
@jkotas @ericstj any idea what a "broken corelib" means? Figuring out how rebuilding (via a P2P) CoreLib could result in a different output. Maybe default properties which are set from the coreclr's root build aren't set?
jkotas commentedon Jul 29, 2020
Yes, the broken CoreLib is built with wrong defines. For example,
TARGET_64BITdoes not seem to be defined for it.danmoseley commentedon Jul 29, 2020
Does this repro in P8 branch?
ViktorHofer commentedon Jul 29, 2020
Probably yes, but it's a developer innerloop issue only.
OK I will diff that with a binarylog later. Thanks
ViktorHofer commentedon Jul 29, 2020
Here's the diff when building from an sln which contains a project that P2Ps to CoreLib vs building CoreLib from the clr.corelib subset: https://www.diffchecker.com/mPYbuYIv.
Just wanna share some findings, will take a closer look later.