roslyn: NRE in GetExplicitInterfaceImplementations when building dotnet/runtime
Version Used: 81c5d71
Steps to Reproduce:
.\Build.cmd -pack -configuration Release
in Roslyn, then set up a dotnet/runtime enlistment to use your locally build compiler. You may use branch https://github.com/RikkiGibson/runtime/tree/use-local-roslyn as a starting point. NOTE: you must build a release package to repro this bug and change the RestoreAdditionalProjectSources
path from Debug to Release.
Once that is complete, run .\Build.cmd -subset libs
to repro the bug.
Expected Behavior: Builds without errors
Actual Behavior:
Process terminated. System.NullReferenceException: Object reference not set to an instance of an object. [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEMethodSymbol.get_ExplicitInterfaceImplementations() in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Metadata\PE\PEMethodSymbol.cs:line 1232 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions.GetExplicitInterfaceImplementations(Symbol member) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\MemberSymbolExtensions.cs:line 516 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.MakeExplicitInterfaceImplementationMap() in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 2091 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.GetExplicitImplementationForInterfaceMember(Symbol interfaceMember) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 2082 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationForInterfaceMember(Symbol interfaceMember, TypeSymbol implementingType, DiagnosticBag diagnostics, Boolean ignoreImplementationInInterfaces, Boolean& implementationInInterfacesMightChangeResult) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 839 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationAndDiagnosticsForInterfaceMember(Symbol interfaceMember, Boolean ignoreImplementationInInterfaces, Boolean& implementationInInterfacesMightChangeResult) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 781 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.FindImplementationForInterfaceMemberInNonInterfaceWithDiagnostics(Symbol interfaceMember, Boolean ignoreImplementationInInterfacesIfResultIsNotReady) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 757 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ComputeInterfaceImplementations(DiagnosticBag diagnostics, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs:line 157 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetSynthesizedExplicitImplementations(CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs:line 50 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol.cs:line 507 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Symbol.cs:line 800 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceNamespaceSymbol_Completion.cs:line 61 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Environment.FailFast(System.String, System.Exception) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.FailFast.OnFatalException(System.Exception) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.FatalError.Report(System.Exception, System.Action`1<System.Exception>) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.FatalError.Report(System.Exception) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.FatalError.ReportUnlessCanceled(System.Exception) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol+<>c__DisplayClass49_1.<ForceComplete>b__0(Int32) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEMethodSymbol.get_ExplicitInterfaceImplementations() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions.GetExplicitInterfaceImplementations(Microsoft.CodeAnalysis.CSharp.Symbol) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.MakeExplicitInterfaceImplementationMap() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.GetExplicitImplementationForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol, Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol, Microsoft.CodeAnalysis.DiagnosticBag, Boolean, Boolean ByRef) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationAndDiagnosticsForInterfaceMember(Microsoft.CodeAnalysis.CSharp.Symbol, Boolean, Boolean ByRef) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.FindImplementationForInterfaceMemberInNonInterfaceWithDiagnostics(Microsoft.CodeAnalysis.CSharp.Symbol, Boolean) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ComputeInterfaceImplementations(Microsoft.CodeAnalysis.DiagnosticBag, System.Threading.CancellationToken) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetSynthesizedExplicitImplementations(System.Threading.CancellationToken) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(Microsoft.CodeAnalysis.SourceLocation, System.Threading.CancellationToken) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(Microsoft.CodeAnalysis.SourceLocation, Microsoft.CodeAnalysis.CSharp.Symbol, System.Threading.CancellationToken) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol+<>c__DisplayClass49_1.<ForceComplete>b__0(Int32) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Roslyn.Utilities.UICultureUtilities+<>c__DisplayClass6_0`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<WithCurrentUICulture>b__0(Int32) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Parallel+<>c__DisplayClass19_0`1[[System.__Canon, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].<ForWorker>b__1(System.Threading.Tasks.RangeWorker ByRef, Int32, Boolean ByRef) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.TaskReplicator+Replica`1[[System.Threading.Tasks.RangeWorker, System.Threading.Tasks.Parallel, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a]].ExecuteAction(Boolean ByRef) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.TaskReplicator+Replica.Execute() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.TaskReplicator+Replica+<>c.<.ctor>b__4_0(System.Object) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Task.InnerInvoke() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Task+<>c.<.cctor>b__277_0(System.Object) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Task.ExecuteEntryUnsafe(System.Threading.Thread) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.Tasks.Task.ExecuteFromThreadPool(System.Threading.Thread) [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading.ThreadPoolWorkQueue.Dispatch() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
System.NullReferenceException: Object reference not set to an instance of an object. [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.Metadata.PE.PEMethodSymbol.get_ExplicitInterfaceImplementations() in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Metadata\PE\PEMethodSymbol.cs:line 1232 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SymbolExtensions.GetExplicitInterfaceImplementations(Symbol member) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\MemberSymbolExtensions.cs:line 516 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.MakeExplicitInterfaceImplementationMap() in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 2091 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.GetExplicitImplementationForInterfaceMember(Symbol interfaceMember) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 2082 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationForInterfaceMember(Symbol interfaceMember, TypeSymbol implementingType, DiagnosticBag diagnostics, Boolean ignoreImplementationInInterfaces, Boolean& implementationInInterfacesMightChangeResult) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 839 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.ComputeImplementationAndDiagnosticsForInterfaceMember(Symbol interfaceMember, Boolean ignoreImplementationInInterfaces, Boolean& implementationInInterfacesMightChangeResult) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 781 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.TypeSymbol.FindImplementationForInterfaceMemberInNonInterfaceWithDiagnostics(Symbol interfaceMember, Boolean ignoreImplementationInInterfacesIfResultIsNotReady) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\TypeSymbol.cs:line 757 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ComputeInterfaceImplementations(DiagnosticBag diagnostics, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs:line 157 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.GetSynthesizedExplicitImplementations(CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs:line 50 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceMemberContainerTypeSymbol.ForceComplete(SourceLocation locationOpt, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceMemberContainerSymbol.cs:line 507 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbol.ForceCompleteMemberByLocation(SourceLocation locationOpt, Symbol member, CancellationToken cancellationToken) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Symbol.cs:line 800 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
at Microsoft.CodeAnalysis.CSharp.Symbols.SourceNamespaceSymbol.<>c__DisplayClass49_1.<ForceComplete>b__0(Int32 i) in C:\Users\rikki\src\roslyn\src\Compilers\CSharp\Portable\Symbols\Source\SourceNamespaceSymbol_Completion.cs:line 61 [C:\Users\rikki\src\runtime\src\libraries\System.Diagnostics.Process\ref\System.Diagnostics.Process.csproj]
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 15 (14 by maintainers)
That is surprising and unfortunate. We didn’t think that the bug would reproduce for compilers that do not contain #44447. It might be necessary, unfortunately, to take a later compiler which includes #47007, the earliest of which is 3.8.0-3.20421.3
FYI @safern