-3

i have an error says "HEAP CORRUPTION DETECTED" so i want to know how to get the memory locations of all the program .

the error

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46
  • I'm not quite clear what you're wanting the tool to tell you. Do you want to know the memory locations that were accessed by your program, or the lines of code that tried to write to that section of memory? Also, put an exclamation mark (`!`) in front of your image link to directly embed it in the question, eg `![alt text][1]` – Zoey Hewll Oct 14 '17 at 11:29
  • 4
    Possible duplicate of [How do I diagnose heap corruption errors on Windows?](https://stackoverflow.com/questions/30413066/how-do-i-diagnose-heap-corruption-errors-on-windows) – user0042 Oct 14 '17 at 11:42
  • SmartBear AQTime is a pretty good profiling tool. – user0042 Oct 14 '17 at 11:43
  • 1
    i want to know the memory locations that were accessed by the program @ZoeyHewll – ahmed ibrahim Oct 14 '17 at 12:32

1 Answers1

0

If the program is reliable at always allocation #150 then you can call _CrtSetBreakAlloc(150) to break on the 150th allocation. Alternatively, you can slow your program down and make the debug heap more accurate at reporting issues by calling _CrtSetDbgFlag( _CRTDBG_CHECK_ALWAYS_DF ) which turns on the heap checking for all allocations and frees.

Finally you could use Application Verifier for release builds of your product to find issues. Application Verifier download is Microsoft : here

mksteve
  • 12,614
  • 3
  • 28
  • 50