Difference between revisions of "Memory Corruption"
Line 9: | Line 9: | ||
For the memory corruption finding: find a place where the possible problem can appear. Call | For the memory corruption finding: find a place where the possible problem can appear. Call | ||
− | {,, | + | {,,ucrtbased.dll}_CrtCheckMemory() in watch to ensure the result of function is 1. |
− | Do next step in debug and again call {,, | + | Do next step in debug and again call {,,ucrtbased.dll}_CrtCheckMemory() to check the result. |
+ | P.s. also '''need load symbols for ucrtbased.dll''' | ||
Old: | Old: |
Revision as of 07:49, 10 June 2022
In the stack find first place the problem can appear and put:
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF );
_CrtCheckMemory();
Then in each function put _CrtCheckMemory(); before and after functions that can lead to problem
For the memory corruption finding: find a place where the possible problem can appear. Call
{,,ucrtbased.dll}_CrtCheckMemory() in watch to ensure the result of function is 1.
Do next step in debug and again call {,,ucrtbased.dll}_CrtCheckMemory() to check the result.
P.s. also need load symbols for ucrtbased.dll
Old:
For the memory corruption finding: find a place where the possible problem can appear. Call
{,,msvcr120d.dll}_CrtCheckMemory() in watch to ensure the result of function is 1.
Do next step in debug and again call {,,msvcr120d.dll}_CrtCheckMemory() to check the result.
Tags: memory, corrupt, leak, problem.