-
Notifications
You must be signed in to change notification settings - Fork 2
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
NRE in realtime-session-with-stacks line 123 #4
Comments
Thanks for reporting this @desdesdes. I'm not able to repro this. How commonly do you see this, and are you still running against .NET 6 as the current repro does? Your change seems reasonable, but I would have expected |
Hi Brian, It was indeed the case that i was running against .net8! I tested it and the problem is reproducible in this repo if i change the targetframework from net6.0 to net8.0 in realtime-session-with-stacks.csproj, but not in the net6 version. Best regards, |
Thanks @desdesdes. I just tried running this against .NET 8, but I can't seem to repro the failure. How often were you seeing the failure? I'm wondering if you might be able to share a process dump of the failure. I am happy to take your change assuming it's the right thing, but I want to make sure there isn't a hidden GC hole or something like that here. |
Hi Brain, The main issue is that the NRE is thrown on a async background task and because of the behavior in .net core the exception on async background task swallowed by default. This behavior is documented here and here under remarks. So you will only see the exception when you use a debugger or when you handle TaskScheduler.UnobservedTaskException. I have build a quick repro to run with a debugger attached here. If you like I can create a dump, but because the exception is swallowed it will be a first chance exception dump. Best regards, |
Hi Brian,
Thanks for this great example. I sometimes got an NullReferenceException then running the code on program.cs line 123. After I replaced line 122 to 124 with the code below and the exception was fixed.
Best regards,
Bart Vries
The text was updated successfully, but these errors were encountered: