Skip to content

cDAC: AccessViolation/FailFast releasing ICorDebug COM objects on Windows x64 #129558

@steveisok

Description

@steveisok

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions