Skip to content

netcoredbg process crashes when pausing after the last debugged thread ended #151

Open
@qgindi

Description

@qgindi

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:

  1. Run this program with the debugger, in launch or attach mode.
  2. 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 second Debugger.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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions