-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.NET9 Regression in Microsoft.CodeAnalysis.CSharp: NullReferenceException #76571
Comments
dotnet-issue-labeler
bot
added
Area-Compilers
untriaged
Issues and PRs which have not yet been triaged by a lead
labels
Dec 27, 2024
Can confirm this is broken in 9.0.101 but fixed in latest roslyn builds Stack trace:
|
jaredpar
removed
the
untriaged
Issues and PRs which have not yet been triaged by a lead
label
Jan 6, 2025
Looks like this was fixed by d74dc650e1e. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: