Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

invalidGCHandleCookie MDA

The invalidGCHandleCookie managed debugging assistant (MDA) is activated when a conversion from an invalid IntPtr cookie to a GCHandle is attempted.

Undefined behavior such as access violations and memory corruption while attempting to use or retrieve a GCHandle from an IntPtr.

The cookie is probably invalid because it was not originally created from a GCHandle, represents a GCHandle that has already been freed, is a cookie to a GCHandle in a different application domain, or was marshaled to native code as a GCHandle but passed back into the CLR as an IntPtr, where a cast was attempted.

Specify a valid IntPtr cookie for the GCHandle.

When this MDA is enabled, the debugger is no longer able to trace the roots back to their objects because the cookie values passed back are different from the ones returned when the MDA is not enabled.

The invalid IntPtr cookie value is reported.

<mdaConfig>
  <assistants>
    <invalidGCHandleCookie />
  </assistants>
</mdaConfig>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.