Open
Description
Code to reproduce:
using System;
using System.Threading;
using System.Diagnostics;
var t = new Thread(() => {
Debugger.Break(); //or any statement with a breakpoint
});
t.Start();
for (int i = 0; i < 100; i++) {
Thread.Sleep(1000);
//Console.WriteLine(i);
if (!t.IsAlive) {
Thread.Sleep(500);
Debugger.Break(); //or any statement with a breakpoint
}
}
Steps to reproduce:
- Run this program with the debugger, in launch or attach mode.
- When stops at the first
Debugger.Break
, execute 'finish' (step out) or two 'next'. The thread ends. The main thread continues and runs until reaches the secondDebugger.Break
.
Result:
Sometimes netcoredbg process crashes at the second Debugger.Break
.
Not every time. About 1/5 times.
Tested and can be reproduced on Windows 11 with CLI and MI.
If can't reproduce, I can attach .dmp.
Activity