Open kant2002 opened 1 year ago
Can you specify the git sha for the runtime you have cloned?
That's minimal repro which I come up with for now
/home/loongson/runtime/.dotnet/dotnet exec "/home/loongson/.nuget/packages/microsoft.net.compilers.toolset/4.5.0-1.22564.5/tasks/net6.0/bincore/csc.dll"
/nullable:enable
/reference:/home/loongson/.nuget/packages/microsoft.codeanalysis.csharp/4.4.0-2.22423.18/lib/netstandard2.0/Microsoft.CodeAnalysis.CSharp.dll
/reference:/home/loongson/.nuget/packages/microsoft.codeanalysis.common/4.4.0-2.22423.18/lib/netstandard2.0/Microsoft.CodeAnalysis.dll
/reference:/home/loongson/runtime/artifacts/bin/Microsoft.Interop.SourceGeneration/Debug/netstandard2.0/Microsoft.Interop.SourceGeneration.dll
/reference:/home/loongson/.nuget/packages/netstandard.library/2.0.3/build/netstandard2.0/ref/netstandard.dll
/out:/home/loongson/runtime/artifacts/obj/JSImportGenerator/Debug/netstandard2.0/Microsoft.Interop.JavaScript.JSImportGenerator.dll
/target:library
/langversion:preview
AttributeData.cs
Constants.cs
FallbackJSMarshallingInfoProvider.cs
JSGeneratorFactory.cs
JSGeneratorOptions.cs
JSManagedTypeInfo.cs
JSMarshallingInfo.cs
JSStubCodeContext.cs
JSTypeFlags.cs
KnownManagedType.cs
LanguageSupport.cs
Marshaling/BaseJSGenerator.cs
Marshaling/IJSMarshallingGenerator.cs
Marshaling/PrimitiveJSGenerator.cs
/home/loongson/runtime/src/libraries/System.Runtime.InteropServices.JavaScript/src/System/Runtime/InteropServices/JavaScript/MarshalerType.cs
After I replace content of microsoft.net.compilers.toolset/4.5.0-1.22564.5
with custom built Microsoft.CodeAnalysis.CSharp.dll
and Microsoft.CodeAnalysis.dll
I receive this happy stack trace.
Process terminated. Assertion failed.
Did not find Microsoft.CodeAnalysis.CSharp.BoundCall `fullTypeName.StartsWith(Constants.TaskGlobal, StringComparison.Ordinal)` in the map.
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.VerifyExpression(BoundExpression expression, Boolean overrideSkippedExpression) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 61
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.VisitExpressionWithoutStackGuard(BoundExpression node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 68
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.VisitExpressionWithStackGuard(Int32& recursionDepth, BoundExpression node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 212
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 83
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitSwitchLabel(BoundSwitchLabel node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 9859
at Microsoft.CodeAnalysis.CSharp.BoundSwitchLabel.Accept(BoundTreeVisitor visitor) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 5443
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 151
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 85
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitList[T](ImmutableArray`1 list) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeWalker.cs:line 22
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitSwitchSection(BoundSwitchSection node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 9852
at Microsoft.CodeAnalysis.CSharp.BoundSwitchSection.Accept(BoundTreeVisitor visitor) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 5410
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 151
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 85
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitList[T](ImmutableArray`1 list) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeWalker.cs:line 22
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitSwitchStatement(BoundSwitchStatement node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 9602
at Microsoft.CodeAnalysis.CSharp.BoundSwitchStatement.Accept(BoundTreeVisitor visitor) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 3537
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 151
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 85
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitList[T](ImmutableArray`1 list) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeWalker.cs:line 22
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitBlock(BoundBlock node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 9538
at Microsoft.CodeAnalysis.CSharp.BoundBlock.Accept(BoundTreeVisitor visitor) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 3062
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 151
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 85
at Microsoft.CodeAnalysis.CSharp.BoundTreeWalker.VisitNonConstructorMethodBody(BoundNonConstructorMethodBody node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 10213
at Microsoft.CodeAnalysis.CSharp.BoundNonConstructorMethodBody.Accept(BoundTreeVisitor visitor) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Generated\BoundNodes.xml.Generated.cs:line 8241
at Microsoft.CodeAnalysis.CSharp.BoundTreeVisitor.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\BoundTree\BoundTreeVisitors.cs:line 151
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Visit(BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 85
at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Verify(ImmutableDictionary`2 analyzedNullabilityMap, SnapshotManager snapshotManagerOpt, BoundNode node) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs:line 39
at Microsoft.CodeAnalysis.CSharp.NullableWalker.AnalyzeWithSemanticInfo(CSharpCompilation compilation, Symbol symbol, BoundNode node, Binder binder, VariableState initialState, DiagnosticBag diagnostics, Boolean createSnapshots, Boolean requiresAnalysis) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.cs:line 1458
at Microsoft.CodeAnalysis.CSharp.NullableWalker.AnalyzeAndRewrite(CSharpCompilation compilation, Symbol symbol, BoundNode node, Binder binder, VariableState initialState, DiagnosticBag diagnostics, Boolean createSnapshots, SnapshotManager& snapshotManager, ImmutableDictionary`2& remappedSymbols) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.cs:line 1411
at Microsoft.CodeAnalysis.CSharp.MethodCompiler.BindMethodBody(MethodSymbol method, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics, Boolean includeInitializersInBody, BoundNode initializersBody, Boolean reportNullableDiagnostics, ImportChain& importChain, Boolean& originalBodyNested, Boolean& prependedDefaultValueTypeConstructorInitializer, InitialState& forSemanticModel) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Compiler\MethodCompiler.cs:line 1809
at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileMethod(MethodSymbol methodSymbol, Int32 methodOrdinal, ProcessedFieldInitializers& processedInitializers, SynthesizedSubmissionFields previousSubmissionFields, TypeCompilationState compilationState) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Compiler\MethodCompiler.cs:line 1044
at Microsoft.CodeAnalysis.CSharp.MethodCompiler.CompileNamedType(NamedTypeSymbol containingType) in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Compiler\MethodCompiler.cs:line 530
at Microsoft.CodeAnalysis.CSharp.MethodCompiler.<>c__DisplayClass25_0.<CompileNamedTypeAsync>b__0() in C:\d\github\dotnet\roslyn\src\Compilers\CSharp\Portable\Compiler\MethodCompiler.cs:line 424
at Roslyn.Utilities.UICultureUtilities.<>c__DisplayClass5_0.<WithCurrentUICulture>b__0() in C:\d\github\dotnet\roslyn\src\Compilers\Core\Portable\InternalUtilities\UICultureUtilities.cs:line 139
Location of code which seems to be trigger that verification is https://github.com/dotnet/runtime/blob/4832236b4820ca83bbc9ce96003c2029b85c6ce2/src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSManagedTypeInfo.cs#L120-L125
Not yet sure if this repro on non-loongson architecture.
Right, the first thing to check is whether it repros on x64 or arm64. If you are only able to reproduce it on loongson, it is most likely a bug in the loongson port.
git clone dotnet/runtime ./build.sh clr+libs
This runs thousands of times each day in dotnet/runtime CI. It means that this repros on loongson only
Tagging subscribers to this area: @dotnet/interop-contrib See info in area-owners.md if you want to be subscribed.
Author: | kant2002 |
---|---|
Assignees: | - |
Labels: | `area-System.Runtime.InteropServices`, `untriaged` |
Milestone: | - |
I did not discount that possibility by any means, but I’m I denial phase yet. I build whole BCL on loongarch but issue appears only in very specific place independently if I execute via MSBUild or if I execute csc manually. And location in Roslyn where crash happens seems pretty regular compiler stuff. Tree traversal and nothing very specific.
What you have described is a very common manifestation of GC holes.
Version Used:
/home/loongson/.nuget/packages/microsoft.net.compilers.toolset/4.5.0-1.22553.5/tasks/net6.0/Microsoft.CSharp.Core.targets(80,5): error :
Steps to Reproduce:
Not yet sure if this repro on non-loongson architecture.
Diagnostic Id:
If this is a report about a bug in an analyzer, please include the diagnostic if possible (e.g.
"IDE0030"
).Expected Behavior: probably do not crash :)
Actual Behavior: