Skip to content

.NET 9: Unhandled exceptions in background threads reported with empty managed frames #101729

@gregg-miskelly

Description

@gregg-miskelly

Description

In .NET 9 preview 3, there is a regression where the target process stops at a point where the ICorDebug stack walk interfaces report a single native chain with reason CHAIN_THREAD_START (0x00000040). Previously these exceptions would go unhandled with the managed code still on the stack.

Reproduction Steps

  1. dotnet new console
  2. Replace program.cs with the following code
  3. Run it under a managed debugger that is NOT configured to stop when NotImplementedException is thrown
  4. The debugger will stop when the exception goes unhandled

Program.cs:

Thread thread = new Thread(() => {
    throw new NotImplementedException(); // should crash here
});
thread.Start();
thread.Join();

Expected behavior

Call stack should have a managed frame

Actual behavior

No managed frames

Regression?

Definitely a regression from .NET 8. I believe it first appeared in preview 3.

Known Workarounds

None

Configuration

Problem appears on Windows, Mac and Linux

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