You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have run into a small piece of code which compiles fine when using .NET8, but fails to do so in .NET9.
Steps to Reproduce:
Clone the included project, build with .NET8. Observe the build works.
Try the same but with .NET9, observe a compiler failure with the message Roslyn\Microsoft.CSharp.Core.targets(89,5): error : Process terminated. System.NullReferenceException: Object reference not set to an instance of an object.
I have a CI job showcasing a successful .NET8 compilation, and a failing .NET9 compilation in the same repository, which can be found here: https://github.com/Lerke/dotnet-9-csc-crash/actions/runs/12515544263 . The included MSBuild output uses the diagnostic verbosity level.
The code in question is quite small:
usingSystem.Linq.Expressions;IList<string>dataSource=["1","2"];Filter(dataSource.AsQueryable(),new(){{"testColumn",(q,str)=>q.Where(x =>x==$"{str}")}});voidFilter<T>(IQueryable<T>queryable,Dictionary<string,Expression<Func<IQueryable<T>,string[],IQueryable<T>>>>filterMembers){// Implementation not important}
The error can be resolved by forcing .ToString() on str. i.e. Changing line 8 to (q, str) => q.Where(x => x == $"{str.ToString()}") makes the code compile without issues.
Creating a full dotnet.exe minidump and analyzing the call [0x15] Microsoft_CodeAnalysis_CSharp!Microsoft.CodeAnalysis.CSharp.Binder.GetCommonTypeOrReturnType<System.__Canon>+0x62 0x1d9e37b3c0 0x7ffdad371c75 reveals under type > _flags the value: 0x30200100101 : Unexpected failure to dereference object
There seems to be no diagnostic ID being generated. The CompilerServer quits with the message: CompilerServer: server failed - server rejected the request 'Error reading response: Reached end of stream before end of read.' - Net9CompilerCrash (net9.0)
Expected Behavior:
The program to build like when using .NET 8.
Actual Behavior:
The build does not finish, but instead throws an error.
The text was updated successfully, but these errors were encountered:
Version Used: .NET9.0.101
I have run into a small piece of code which compiles fine when using .NET8, but fails to do so in .NET9.
Steps to Reproduce:
Roslyn\Microsoft.CSharp.Core.targets(89,5): error : Process terminated. System.NullReferenceException: Object reference not set to an instance of an object.
I have a minimal example showcasing this behavior in the following repository: https://github.com/Lerke/dotnet-9-csc-crash
I have a CI job showcasing a successful .NET8 compilation, and a failing .NET9 compilation in the same repository, which can be found here: https://github.com/Lerke/dotnet-9-csc-crash/actions/runs/12515544263 . The included MSBuild output uses the diagnostic verbosity level.
The code in question is quite small:
The error can be resolved by forcing .ToString() on
str
. i.e. Changing line 8 to(q, str) => q.Where(x => x == $"{str.ToString()}")
makes the code compile without issues.Creating a full
dotnet.exe
minidump and analyzing the call[0x15] Microsoft_CodeAnalysis_CSharp!Microsoft.CodeAnalysis.CSharp.Binder.GetCommonTypeOrReturnType<System.__Canon>+0x62 0x1d9e37b3c0 0x7ffdad371c75
reveals undertype > _flags
the value:0x30200100101 : Unexpected failure to dereference object
The exception analysis is as follows:
Diagnostic Id:
There seems to be no diagnostic ID being generated. The CompilerServer quits with the message:
CompilerServer: server failed - server rejected the request 'Error reading response: Reached end of stream before end of read.' - Net9CompilerCrash (net9.0)
Expected Behavior:
The program to build like when using .NET 8.
Actual Behavior:
The build does not finish, but instead throws an error.
The text was updated successfully, but these errors were encountered: