Skip to content

Debugger launch has a race condition making breakpoints in startup code are unreliable #7128

@gregg-miskelly

Description

@gregg-miskelly
  1. Create a new process suspended
  2. Use RegisterForRuntimeStartup to find out about the new process
  3. When RegisterForRuntimeStartup fires the handler, call DebugActiveProcess and return

Expected:
Debugger should successfully finish the hookup before any managed code runs

Actual:
There is a race where sometimes managed code runs before the hookup finishes. CORDebuggerAttached gets set from coreclr!Debugger::MarkDebuggerAttachedInternal, which is being called from coreclr!Debugger::SuspendComplete.

We have seen this on various Linux distros. I can't tell for sure if this is an xplat-only problem (or maybe Linux only?) or if this applies to Windows also.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions