With DOTNET_ENABLE_CDAC=1 on Windows x64, releasing ICorDebug COM objects can crash the process with an access violation, escalating to a fail-fast (exit -1073740791 / 0xC0000409). In an observed case the debugging operation itself completed correctly (frames were retrieved and validated), but the process then crashed while finalizing/releasing the underlying COM objects:
Process terminated. Access Violation: Attempted to read or write protected memory...
at IIUnknownCacheStrategy.Clear(IIUnknownStrategy)
at ComObject.Finalize()
at __Finalizer.DrainQueue() / ProcessFinalizers()
-> RuntimeExceptionHelpers.FailFast(...)
The AV during Release on the cached IUnknown pointers suggests a lifetime/ownership problem in the cDAC-backed ICorDebug objects (a stale or already-freed native pointer being released).
Repro / signal
- Runtime:
11.0.0-preview.6.26311.113, Windows x64, DOTNET_ENABLE_CDAC=1
- Stackwalk scenario; the crash occurs on the finalizer thread during COM release, after the debugging operation succeeds. Does not reproduce with cDAC disabled.
Expected
Releasing/finalizing cDAC-backed ICorDebug objects does not access freed memory.
With
DOTNET_ENABLE_CDAC=1on Windows x64, releasingICorDebugCOM objects can crash the process with an access violation, escalating to a fail-fast (exit-1073740791/0xC0000409). In an observed case the debugging operation itself completed correctly (frames were retrieved and validated), but the process then crashed while finalizing/releasing the underlying COM objects:The AV during
Releaseon the cachedIUnknownpointers suggests a lifetime/ownership problem in the cDAC-backedICorDebugobjects (a stale or already-freed native pointer being released).Repro / signal
11.0.0-preview.6.26311.113, Windows x64,DOTNET_ENABLE_CDAC=1Expected
Releasing/finalizing cDAC-backed
ICorDebugobjects does not access freed memory.