Summary
On Windows WinForms debugging, stackTrace can fail with 0x80004002 (E_NOINTERFACE) after a valid stopped event at a user breakpoint in the form load path.
This is reproducible against current master (8b8b22200fecdb1aec5f47af63215462d8c79a4b) and does not appear editor-specific.
Environment
- OS: Windows 11
- netcoredbg:
master at 8b8b22200fecdb1aec5f47af63215462d8c79a4b
- Runtime: .NET 10 WinForms
- Protocol: DAP (
--interpreter=vscode)
Repro pattern
A minimal C# WinForms app with:
- breakpoint in
Form1 constructor path (first stop)
- breakpoint in
Form1_Load path (second stop)
Observed behavior:
- First breakpoint:
stopped + stackTrace succeeds.
- Second breakpoint:
stopped arrives, then stackTrace fails.
Representative DAP sequence:
<- (E) {"body":{"allThreadsStopped":true,"reason":"breakpoint","threadId":14000},"event":"stopped",...}
-> (C) {"command":"stackTrace","arguments":{"threadId":14000,"startFrame":0,"levels":20},...}
<- (R) {"command":"stackTrace","message":"Failed command 'stackTrace' : 0x80004002",...,"success":false}
Suspected root cause
In WalkFrames() there is an unconditional IID_ICorDebugILFrame QI for managed frames:
src/debugger/frames.cpp (around line 345 in current master)
When ICorDebugILFrame is unavailable for a frame in this WinForms path, the error propagates and aborts stack walking instead of degrading to a non-IL frame kind.
Notes
I have a local fix plus a regression test in test-suite and will open a PR linking this issue.
Posted by Codex on behalf of @govert.
Summary
On Windows WinForms debugging,
stackTracecan fail with0x80004002 (E_NOINTERFACE)after a validstoppedevent at a user breakpoint in the form load path.This is reproducible against current
master(8b8b22200fecdb1aec5f47af63215462d8c79a4b) and does not appear editor-specific.Environment
masterat8b8b22200fecdb1aec5f47af63215462d8c79a4b--interpreter=vscode)Repro pattern
A minimal C# WinForms app with:
Form1constructor path (first stop)Form1_Loadpath (second stop)Observed behavior:
stopped+stackTracesucceeds.stoppedarrives, thenstackTracefails.Representative DAP sequence:
Suspected root cause
In
WalkFrames()there is an unconditionalIID_ICorDebugILFrameQI for managed frames:src/debugger/frames.cpp(around line 345 in current master)When
ICorDebugILFrameis unavailable for a frame in this WinForms path, the error propagates and aborts stack walking instead of degrading to a non-IL frame kind.Notes
I have a local fix plus a regression test in
test-suiteand will open a PR linking this issue.Posted by Codex on behalf of @govert.