Skip to content

Environment variable DOTNET_DbgEnableMiniDump=1 doens't work when unhandled exception occurs in worker thread #103000

@KurokiYukari

Description

@KurokiYukari

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:

  1. dotnet new console
  2. Change Program.cs to
var thread = new Thread(() =>
{
    throw new Exception();
});
thread.Start();
thread.Join();
  1. run $env:DOTNET_DbgEnableMiniDump=1
  2. run dotnet run

Expected behavior

Dump is generated and placed in %LocalAppData%/Temp dir.

Actual behavior

No dump is generated.
Console output:

Unhandled exception. System.Exception: Exception of type 'System.Exception' was thrown.
   at Program.<>c.<<Main>$>b__0_0() in C:\dumptest\Program.cs:line 3

Regression?

No response

Known Workarounds

No response

Configuration

  1. Which version of .NET is the code running on? - 8.0.300
  2. What OS and version, and what distro if applicable? - windows11 23H2
  3. What is the architecture (x64, x86, ARM, ARM64)? - x64
  4. Do you know whether it is specific to that configuration? -no. I have tried .NET 6, but also no dump file is generated.

Other information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions