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

Stack overflow in ServiceHub.RoslynCodeAnalysisService.exe #7441

Open
Infini-PLEX opened this issue Sep 18, 2024 · 7 comments
Open

Stack overflow in ServiceHub.RoslynCodeAnalysisService.exe #7441

Infini-PLEX opened this issue Sep 18, 2024 · 7 comments
Assignees
Labels
Bug The product is not behaving according to its current intended design DataFlow help wanted The issue is up-for-grabs, and can be claimed by commenting
Milestone

Comments

@Infini-PLEX
Copy link

Version Used:

Steps to Reproduce:

  1. Open the solution in VS 2022 Enterprise
  2. Open Program.cs
  3. Wait for a few seconds
  4. If you have just in time debugging, it will pop up
  5. Intellisense shuts down completely and a bunch of crash messages are shown on the toolbar

A minimal repro, with source-code provided, is ideal. Using sharplab is preferred for compiler/language issues whenever possible.

Open Program.cs:
ConsoleApp12.zip

It seems that SharpLab is even stricter as code that will compile on my system will not compile there.
Sharplab in gist: https://gist.github.com/Infini-PLEX/7facd1abc053f7c62357d89cc1597a94

Diagnostic Id:

Not applicable

Expected Behavior:

Intellisense to work properly.

Actual Behavior:

Stack overflow exception in the program.

Commenting out lines that add strings to messages sometimes gets the code to compile, but it is very unreliable.

Stacktrace: https://gist.github.com/Infini-PLEX/7facd1abc053f7c62357d89cc1597a94
Parallel stacktrace: https://github.com/user-attachments/assets/568961f5-4504-4e87-92d3-f96c89c6dc70

Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

1 similar comment
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@jcouv
Copy link
Member

jcouv commented Oct 3, 2024

FWIW, the code in project can be shrunk. Here's the smallest repro I got so far:

using System.Diagnostics;

public class TesseractException : Exception
{
    public override string Message
    {
        get
        {
            string message = "";
            bool b = true;
            message += b ? "" : "";
            message += Process.ProcessorAffinity.ToString();
            for (int i = 0; i < 42; ++i)
            {
                message += Process.Modules[42]?.ToString();
            }

            return message;
        }
    }

    Process Process { get; set; }
}

The stack overflow has thousands of repeating frames on this method: Microsoft.CodeAnalysis.FlowAnalysis.DataFlow.PointsToAnalysis.PointsToAnalysis+PointsToDataFlowOperationVisitor.HandleEscapingOperation(Microsoft.CodeAnalysis.IOperation, Microsoft.CodeAnalysis.IOperation, Analyzer.Utilities.PooledObjects.PooledDictionary2<Microsoft.CodeAnalysis.IOperation,Builder<Microsoft.CodeAnalysis.FlowAnalysis.DataFlow.AbstractLocation>>)`

@jaredpar jaredpar added Bug The product is not behaving according to its current intended design and removed untriaged labels Oct 7, 2024
@AlekseyTs
Copy link

AlekseyTs commented Oct 8, 2024

PointsToAnalysis is not a part of compiler, it is one of the roslyn-analyzers. Going to move the issue there.

@AlekseyTs AlekseyTs transferred this issue from dotnet/roslyn Oct 8, 2024
@AlekseyTs AlekseyTs removed their assignment Oct 8, 2024
@AlekseyTs
Copy link

@dotnet/roslyn-analysis FYI

@buyaa-n buyaa-n added DataFlow help wanted The issue is up-for-grabs, and can be claimed by commenting and removed untriaged labels Oct 9, 2024
@buyaa-n
Copy link
Contributor

buyaa-n commented Oct 9, 2024

CC @mavasani

@jaredpar
Copy link
Member

@arkalyanms, @JoeRobich, @sharwell this is a VS crash that seems to be mostly coming from analyzers.

@arunchndr arunchndr added this to the VS vNext milestone Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The product is not behaving according to its current intended design DataFlow help wanted The issue is up-for-grabs, and can be claimed by commenting
Projects
None yet
Development

No branches or pull requests

7 participants