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

SimpleCovariantReturnEndToEndTest is stack overflowing in CI #53361

Closed
jaredpar opened this issue May 12, 2021 · 2 comments · Fixed by #53378
Closed

SimpleCovariantReturnEndToEndTest is stack overflowing in CI #53361

jaredpar opened this issue May 12, 2021 · 2 comments · Fixed by #53378
Assignees
Labels
Area-Compilers Test Test failures in roslyn-CI
Milestone

Comments

@jaredpar
Copy link
Member

jaredpar commented May 12, 2021

We are seeing sporadic but significant failures that come down to a stack overflow in SimpleCovariantReturnEndToEndTests

Iniciando la ejecuci¢n de pruebas, espere...
1 archivos de prueba en total coincidieron con el patr¢n especificado.
[xUnit.net 00:00:49.28]     Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.CheckPreserveBaseOverride_01 [SKIP]
[xUnit.net 00:00:49.28]     Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.CovariantRuntimeHasRequiredMembers [SKIP]
[xUnit.net 00:00:49.28]     Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.SimpleCovariantReturnEndToEndTest [SKIP]
  Omitidas Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.CheckPreserveBaseOverride_01 [1 ms]
  Omitidas Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.CovariantRuntimeHasRequiredMembers [1 ms]
  Omitidas Microsoft.CodeAnalysis.CSharp.UnitTests.Emit.CovariantReturnTests.SimpleCovariantReturnEndToEndTest [1 ms]
Se ha anulado la serie de pruebas activa. Motivo: Proceso de host de pruebas bloqueado : Process is terminated due to StackOverflowException.

The stack frames that are looping here

 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitCore(Microsoft.CodeAnalysis.SyntaxNode node) Line 96	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitTypeDeclarationCore(Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax parent, Microsoft.CodeAnalysis.CSharp.BinderFactory.NodeUsage extraInfo) Line 712	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitTypeDeclarationCore(Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax parent) Line 696	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitStructDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax node) Line 750	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax.Accept<System.__Canon>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<System.__Canon> visitor) Line 9947	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitCore(Microsoft.CodeAnalysis.SyntaxNode node) Line 96	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitTypeDeclarationCore(Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax parent, Microsoft.CodeAnalysis.CSharp.BinderFactory.NodeUsage extraInfo) Line 712	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitTypeDeclarationCore(Microsoft.CodeAnalysis.CSharp.Syntax.TypeDeclarationSyntax parent) Line 696	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.BinderFactory.BinderFactoryVisitor.VisitStructDeclaration(Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax node) Line 750	C#
 	Microsoft.CodeAnalysis.CSharp.dll!Microsoft.CodeAnalysis.CSharp.Syntax.StructDeclarationSyntax.Accept<System.__Canon>(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<System.__Canon> visitor) Line 9947	C#

Crash dump of the failure is available here https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-roslyn-refs-heads-main-af6e9e6c69714fc4a2/Microsoft.CodeAnalysis.CSharp.Emit.UnitTests.dll.12/testhost.net472.x86.exe.6848.dmp?%3Fsv%3D2019-07-07%26se%3D2021-05-31T21%253A37%253A05Z%26sr%3Dc%26sp%3Drl%26sig%3Do42%252FHeF%252BlVcH6kcsyvtjd8YFOmtvtlD%252B9b4xhNOpuVo%253D

Runfo Tracking Issue: Stackoverflow in SimpleCovariantReturnsEndToEnd tests

Build Definition Kind Run Name Console Core Dump Test Results Run Client
1296880 roslyn-CI Rolling Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1296697 roslyn-CI PR 55643 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1296545 roslyn-CI PR 53935 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1291447 roslyn-CI Rolling Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1290979 roslyn-CI Rolling Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1286739 roslyn-CI Rolling Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1283259 roslyn-CI PR 55506 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1281819 roslyn-CI PR 55427 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1278005 roslyn-CI PR 55397 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1276370 roslyn-CI PR 55407 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1276370 roslyn-CI PR 55407 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272589 roslyn-CI PR 55368 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_Desktop_Spanish_Release_32_Windows.10.Amd64.Server19H1.ES.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_Desktop_Release_64_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1272362 roslyn-CI PR 55357 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1269576 roslyn-CI PR 55301 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1269486 roslyn-CI PR 55265 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1269286 roslyn-CI PR 53553 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1269018 roslyn-CI PR 55262 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1267244 roslyn-CI Rolling Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1266559 roslyn-CI PR 55236 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1265424 roslyn-CI Rolling Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1265150 roslyn-CI PR 55202 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1265150 roslyn-CI PR 55202 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1265150 roslyn-CI PR 55202 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log runclient.py
1265150 roslyn-CI PR 55202 Test_Windows_Desktop_Spanish_Release_32_Windows.10.Amd64.Server19H1.ES.Open console.log runclient.py
1265150 roslyn-CI PR 55202 Test_Windows_Desktop_Release_64_Windows.10.Amd64.Open console.log runclient.py
1265060 roslyn-CI Rolling Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1265013 roslyn-CI PR 55202 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1265013 roslyn-CI PR 55202 Test_Windows_Desktop_Spanish_Release_32_Windows.10.Amd64.Server19H1.ES.Open console.log runclient.py
1265013 roslyn-CI PR 55202 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1265013 roslyn-CI PR 55202 Test_Windows_Desktop_Release_64_Windows.10.Amd64.Open console.log runclient.py
1265013 roslyn-CI PR 55202 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log runclient.py
1263655 roslyn-CI Rolling Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1262621 roslyn-CI PR 55161 Test_macOS_Debug_OSX.1014.Amd64.Open console.log runclient.py
1262404 roslyn-CI PR 55154 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log runclient.py
1261882 roslyn-CI PR 53304 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log runclient.py
1260380 roslyn-CI PR 55026 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1256018 roslyn-CI Rolling Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log runclient.py
1255833 roslyn-CI PR 55081 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log runclient.py
1255601 roslyn-CI Rolling Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1255390 roslyn-CI PR 55073 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Spanish_Release_32_Windows.10.Amd64.Server19H1.ES.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_Release_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Debug_32_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Release_64_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Release_64_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_CoreClr_IOperation_Debug_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Debug_64_Windows.10.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_macOS_Debug_OSX.1014.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_macOS_Debug_OSX.1014.Amd64.Open console.log core dump runclient.py
1253043 roslyn-CI PR 55039 Test_Windows_Desktop_Spanish_Release_32_Windows.10.Amd64.Server19H1.ES.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_macOS_Debug_OSX.1014.Amd64.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_macOS_Debug_OSX.1014.Amd64.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_Linux_Debug_Ubuntu.1804.Amd64.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log core dump runclient.py
1252313 roslyn-CI PR 55039 Test_Windows_Desktop_Release_32_Windows.10.Amd64.Open console.log core dump runclient.py

Displaying 100 of 205 results

Build Result Summary

Day Hit Count Week Hit Count Month Hit Count
3 6 38
@jaredpar jaredpar added Area-Compilers Test Test failures in roslyn-CI labels May 12, 2021
@jaredpar jaredpar added this to the 16.11 milestone May 12, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label May 12, 2021
@jaredpar jaredpar removed the untriaged Issues and PRs which have not yet been triaged by a lead label May 12, 2021
@cston
Copy link
Member

cston commented May 13, 2021

The StackOverflowException is in EndToEndTests.DeeplyNestedGeneric(). That test contains deeply nested types: MyStruct0<T0> { MyStruct1<T1> { ... MyStructN<TN> { } ... } } and the StackOverflowException occurs when getting the Binder for a nested struct.

The reason the failure happens only sporadically is that BinderFactoryVisitor caches a Binder for each declaration SyntaxNode in BinderFactory._binderCache. The cache is small (50 items) and SyntaxNode relies on Object.GetHashCode() which calculates the hash code from the object reference, so each ParsedSyntaxTree is likely to have a different set of 50 items in the cache when visiting the same syntax.

In the worst case, getting the Binder for the inner most MyStructN<TN> { } might recurse through all containing types to get the containing Binder instances without any cache hits.

@cston
Copy link
Member

cston commented May 13, 2021

Fixed in #53378.

@cston cston closed this as completed May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Test Test failures in roslyn-CI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants