Compiler crashing issues reported through internal telemetry
mkArtakMSFT opened this issue · 6 comments
Internal Error - System.InvalidOperationException: Se produjo una excepción de tipo 'System.InvalidOperationException'. en System.Runtime.CompilerServices.ConditionalWeakTable2.VerifyIntegrity() en System.Runtime.CompilerServices.ConditionalWeakTable
2.Add(TKey key, TValue value) en Microsoft.AspNetCore.Razor.Language.Syntax.GreenNode..ctor(SyntaxKind kind, Int32 fullWidth, RazorDiagnostic[] diagnostics, SyntaxAnnotation[] annotations) en Microsoft.AspNetCore.Razor.Language.Syntax.InternalSyntax.MarkupTextLiteralSyntax.SetAnnotations(SyntaxAnnotation[] annotations) en Microsoft.AspNetCore.Razor.Language.Legacy.TokenizerBackedParser`1.GetNodeWithSpanContext[TNode](TNode node) en @Artak this is another compiler error which also would have killed VS but in the new editor scenario will give funky colors, lacking IntelliSense etc. (experience will fall over). Could you file a separate issue to track please.
More context can be found from: https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1435565
Thanks for contacting us.
We're moving this issue to the .NET 7 Planning
milestone for future evaluation / consideration. We would like to keep this around to collect more feedback, which can help us with prioritizing this work. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact issues.
To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.
It's not clear that this is a bug in our code.
The source of the exception seems to be in the runtime https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs#L747-L752
The issue seems to be originated in our code here
However, I don't see how we can be misusing the APIs offered by the runtime, so I believe this might be a bug in the runtime.
It's also important to note, that these nodes are generated based on some tool from Roslyn adapted for Blazor.
I suspect this might be a bug in .NET Framework (which is used only when the compiler is running inside VS) as noted by the call here
@mkArtakMSFT can you get more details on how common this issue is? I also suspect that the roslyn folks will have observed the same issue. This was literally removed on Core CLR like 5 years ago (https://github.com/dotnet/runtime/blame/34a4cdb72c5da9c163167618799b37549b4d80ee/src/coreclr/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs#L136) so I don't believe there's any action we can take here.
@javiercn you seem to be right here. I glanced through the links you've shared as well as the exception stack trace.
Also, I've tried to go back to Watson logs to get details about this particular exception and found no reports of it in the original internal ticket.
@NTaylorMullen if you disagree with the assessment here, please let us know and also share a link to Watson reports so that we can confirm the above theory. Otherwise no further action is pending here.
One thing to keep in mind. Visual Studio is a .NET Framework application. Meaning, any change to the .NET Core side of the world doesn't necessarily mean it's fixed in the .NET Framework side.