With many large files: stops progressing, OOMs or InvalidOperation in Roslyn code
See original GitHub issueSteps to reproduce
- Convert a proprietary codebase (which I can’t share, my apologies).
- Wait a couple of hours
- In phase 2, simplification, it crashes.
Error message shown
The crash is
https://github.com/dotnet/roslyn threw an exception: System.InvalidOperationException: Exception of type 'System.InvalidOperationException' was thrown.
at System.Runtime.CompilerServices.ConditionalWeakTable`2.VerifyIntegrity()
at System.Runtime.CompilerServices.ConditionalWeakTable`2.Add(TKey key, TValue value)
at Microsoft.CodeAnalysis.GreenNode..ctor(ObjectReader reader)
Full log at https://gist.github.com/jnnnnn/2b7a739170467e125d0a05b0a263774a (with filenames hidden, sorry)
Details
VS extension version 8.5.0.0 (installed 2022-04-14)
- Did you see it working in a previous version, which? no
- I can follow reasonable requests to debug, but can’t share the code it is crashing on
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (5 by maintainers)
Top Results From Across the Web
https://raw.githubusercontent.com/dotnet/samples/m...
Text Stop compiling Interop.cs into Unix build of code pages The Interop.cs file was being compiled into the unix build of System.Text.Encoding.CodePages.
Read more >VS 2022: High RAM and CPU issue with Roslyn Code ...
We have a huge solution (ASP.NET MVC, C#) in Visual Studio 2022 (v.17.2.2 64bit). Roslyn Code Analysis is always using high CPU and...
Read more >Long Term Support
We're committed to supporting 2022 LTS releases with biweekly updates until mid-2024, after which updates will be monthly until mid-2025 (two years after...
Read more >How to work with large code files, with too many issues, if ...
Yes, work on those files, to change them to be really better in the code quality. But my job is not this one,...
Read more >Untitled
Fc echallens wiki, Farmer boy salad dressing recipe, Telpay biller code. #Herreshoff Puget sound business journal jobs, Deandre jordan face t shirt, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @EoflaOE this definitely seems to repro the issue even in total isolation. I’ve created a draft PR with an initial workaround which skips files that take longer than the configurable timeout. Hopefully I’ll find a way to improve the performance by calling roslyn in a different way (or possibly making a fix to roslyn)
Here’s a snippet of C# which takes more than a minute to simplify (though admittedly contains about 10K characters in a single expression.
@EoflaOE thanks, that example is likely going to be a massive help! I’ll try to repro with it as soon as I can find time and hopefully will finally be able to make progress on this issue 😊