-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Environment variable DOTNET_DbgEnableMiniDump=1 doens't work when unhandled exception occurs in worker thread #103000
Comments
Tagging subscribers to this area: @tommcdon |
threadpool threads don't exhibit this behavior. this works: await Task.Run(async () =>
{
await Task.Yield();
throw new Exception();
}); |
@hoyosjs I tried threadpool. it also doesn't work: ThreadPool.QueueUserWorkItem(state =>
{
throw new Exception();
}); Task works because unhandled exceptions that are thrown by user code that is running inside a task are propagated back to the calling thread(main thread) |
It works in .NET 9. I did get it to repro on .NET 8. I'm not sure what change went into 9.0 that fixes this yet.
|
It looks like this was fixed as part of the new exception handling support. Not sure what part or where, but on .NET 9 if I disable the new exception handling with @janvorli any thoughts? |
I think that we need to call CreateCrashDumpIfEnabled by the end of the following function if we want to make it work with legacy EH: runtime/src/coreclr/vm/excep.cpp Line 4873 in b2b0db0
I've tried it and it worked. |
Thanks Jan. We need to decide if this fix should go into .NET 9 for the legacy EH and if it should go into .NET 8 servicing? |
For correctness I think we should try to fix the legacy exception scenario for .NET 9, and consider this |
Description
I run a .NET application with environment variable DOTNET_DbgEnableMiniDump=1. If an unhandled exception
occurs in main thread, the dump file is generated correctly. But if an unhandled exception occurs in worker thread, no dump file is generated.
Reproduction Steps
using powershell on windows:
dotnet new console
$env:DOTNET_DbgEnableMiniDump=1
dotnet run
Expected behavior
Dump is generated and placed in
%LocalAppData%/Temp
dir.Actual behavior
No dump is generated.
Console output:
Regression?
No response
Known Workarounds
No response
Configuration
Other information
No response
The text was updated successfully, but these errors were encountered: