-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Application crashes in release mode throwing System.ArgumentOutOfRangeException #100758
Comments
@daiger14 we will probably need more information from you to figure out what is going wrong. Which method is getting an error? If you add If so, can you share the (unmodified) assembly with us? cc @dotnet/jit-contrib in case this seems familiar to anyone. |
@daiger14 please help us understand more about this so we can figure out what is going wrong. |
Hi, we are trying to figure out where the method is. |
If the issue can't be pinned down to a specific method, it could mean there is similar code in some number of methods, or there is perhaps some kind of memory corruption happening. Since you are able to reproduce the problem, can you try running under windbg, and once the exception happens, use the |
I'm not familiar with windbg, but will try tomorrow. |
Hi, here is the result of !VerifyHeap command (no heap corruption detected):
|
@daiger14 thanks for checking with windbg. Since this seems to happen almost every run, is there any chance we could set up some kind of collaborative debugging session? @dotnet/jit-contrib any other thoughts on how we could figure out what is going wrong? |
Thanks @EgorBo -- I thought this issue sounded familiar but couldn't find those issues. Do you know if both of those fixes will be in 8.0.5? |
Sadly, only in 8.0.6. I think it should be available in the next (if not in current) preview of 9.0 too if that is an option to try |
Hi @AndyAyersMS, about set up a collaborative session, sure we can, just to agree about the time ;) |
@EgorBo do you know for sure if the fixes will be in 9.0 Preview 4? Seems likely. It should be available later this month. @daiger14 simplest thing might be for you to download this once it's available and try... you don't need to rebuild anything, just run it. Alternatively, you can build a version of the 8.0.6 JIT yourself, or I can build one and make it available to you, and I can tell you how to patch it into an existing 8.0 installation for testing, but I understand if you'd rather not. |
I've just checked - yes, it will be in Preview4 |
@AndyAyersMS, @EgorBo Thank you guys, I will wait for preview 4 and will write the results of the tests. |
Hi @AndyAyersMS @EgorBo, I checked with version 9.0 preview 4, and the issue is still present and replicable with our project :( |
That is sad to hear. Unfortunately, it's unlikely we can diagnose this issue without a repro (and presumably a memory dump won't help much here since it sounds like a silent codegen bug). Can you check if disabling TieredCompilation (or/and TieredPGO) helps to reproduce it more reliably? (it's |
@EgorBo Nothing changed turning off TieredCompilation. |
Yes, you can use To share your code example privately, it is best to open a parallel issue on .NET Community site: https://developercommunity.microsoft.com/dotnet Once that is set up you can add private attachments. |
@daiger14 can we set up an interactive debug session for this? |
@daiger14 we're still very interested in trying to resolve this. |
Hi @AndyAyersMS, @EgorBo |
This issue has been marked |
Thank you for following up. |
Still not actionable, so moving to future. |
This issue has been automatically marked |
This issue will now be closed since it had been marked |
Description
Hello,

I'm trying to update our application to NET 8, but the application started to crash when deployed.
It crashes only in release mode and when we are calculating big projects.
If I Suppress JIT optimization on module load, it works without exception.
The project was working starting from NET Core 2.0
We are not able to understand how and where this exception happens.

Suppose I'm checking the index of the array and length, logging via System.Diagnostics.Trace.WriteLine, everything is fine before the exception.
In the screenshot, you can check the index of the array before the line of code throws an exception.
The index is 4, the number of elements in the array is 5.
Also, you can see the Trace.WriteLine('MATRIX1') before the exception in the Debug output, but the line is after.
Reproduction Steps
I'm not able to create a project which will reproduce this issue.
The previous versions of NET were working fine. Release, Debug build doesn't matter.
Now(NET 8) it works only in Debug mode or suppressing JIT optimization
Expected behavior
Should not crash the application.
There should be a valid stack trace of the exception.
Actual behavior
Crash with "unreal" System.ArgumentOutOfRangeException
Application crashes throwing System.ArgumentOutOfRangeException.
The exception should show a real call stack.
Regression?
No response
Known Workarounds
Build in debug mode or Suppress JIT optimization on module load
Configuration
NET 8.0.203
Other information
No response
The text was updated successfully, but these errors were encountered: