dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.95k stars 4.02k forks source link

Stack overflow on struct type with array of pointers to self #24978

Open tomrus88 opened 6 years ago

tomrus88 commented 6 years ago

Version Used: VS 2017 15.5.7 Steps to Reproduce:

  1. Create new C# project
  2. Paste following code into one of .cs source files ` unsafe struct X { public X[] Y; } `
  3. See VS freeze and crash from stack overflow in Microsoft.CodeAnalysis.CSharp.ni.dll

Expected Behavior: VS should not crash. Actual Behavior: VS freezes and crashes.

jcouv commented 6 years ago

Confirmed to repro in 15.6 preview 1.1. I captured a stack trace from the crash and the repeating portion of the stack (copied below) matches an issue that I coincidentally just fixed for 15.7.

I'll verify this scenario was indeed fixed. Update: deleted the stack trace, as I accidentally looked at the wrong dump file... :-S

jcouv commented 6 years ago

Never mind, I accidentally debugged the wrong dump file. Here's the repeating portion of stack trace for this overflow:

Note to self: private verify-overflow branch

jcouv commented 6 years ago

I'm taking this issue back because I have a fix in progress (verify-overflow private branch).

vcsjones commented 6 years ago

Another "report" of that here. https://stackoverflow.com/q/51732647/492405

tomrus88 commented 5 years ago

Still not fixed in VS 16.0.0 Preview 4

tomrus88 commented 3 years ago

Doesn't seems to crash on VS 16.8.0 Preview 3.2. Was it fixed?