Visual Studio - how to find source of heap corruption errors

前端 未结 8 1836
失恋的感觉
失恋的感觉 2020-12-02 05:32

I wonder if there is a good way to find the source code that causes a heap corruption error, given the memory address of the data that was written \'outside\' the allocated

相关标签:
8条回答
  • 2020-12-02 05:59

    Maybe you can try Microsoft's Application Verifier. It solved a similar problem for me once,by turning on extra checks on heap operations. In my opinion, the randomness of corrupted address is because the heap can be 'subtly' damaged, and the problem won't show up until something big happens to the heap (like massive allocation/free).

    0 讨论(0)
  • 2020-12-02 06:04

    You could set a breakpoint on a write to the memory address. The debugger will then show you the code that writes to the location, but you still need to work out which of the writes are causing the problem.

    0 讨论(0)
提交回复
热议问题