What tools are available to detect heap corruption in .NET/C# program?
Asked Answered
R

1

0

I know that I can use WinDbg+PageHeap+ApplicationVerifier - Microsoft tools.

I read there are many tools available for C++ and wonder if there is something similar exists for C#?

Rossi answered 19/9, 2011 at 12:56 Comment(0)
N
3

These are the kind of tools you use to troubleshoot mis-behaving native code. Access violations, heap corruption, resource leaks, that sort of thing. That just doesn't happen in pure managed code by virtue of the concept of safe code and the garbage collector. If you have a dependency on native code in your managed project that misbehaves that way (Fatal Execution Engine Error for example) then you still use the same tools. Diagnosing it is never easy.

Nowhither answered 19/9, 2011 at 13:9 Comment(3)
Alone? No. Threading races don't cause heap corruption in .NET.Nowhither
here people say that the managed code can corrupt the heap.Rossi
Yeah, sure, the Marshal class lets you break the rules. That's what it is for. If you haven't already scanned your code for Marshal, DllImport, unsafe and COM references then do make sure to ask help from a team member that knows the code base better.Nowhither

© 2022 - 2024 — McMap. All rights reserved.