Full or DLLs Heap Options

From the stack trace, you've discovered where the object was deleted, though not necessarily what allocated the memory or what corrupted it. You have developed some notion of where it might have been created and how it was processed. You can use this information to guide your search for a solution.

  1. Set /full or /dlls heap options. For a very small program, you can use /full heap options, as follows:

    GFlags /p /enable Program.exe /full

    For more complex code, you would use /dlls options, as follows:

    GFlags /p /enable Program.exe /dlls Library1.dll,Library2.dll,...

  2. Invoke WinDbg.exe.
  3. Run Program.exe from WinDbg using File, then Load Executable.
  4. Click View, then Call Stack to display the call stack.
  5. Click WinDbg, then Go from the toolbar.
  6. Wait for an error to occur. The /full and /dlls heap options cause the system to place a full page of protected memory after each allocation from the designated scope or scopes. For the /dlls options, the system places a suffix pattern after each allocation from the remaining scopes.

    When your program attempts to write into the protected memory, the system will raise an error. The symptom might be an error popup, an Application Verify Stop, an Access Violation, a Memory Check Error, or any other error type severe enough to force the operation system to halt execution. Note that the system will raise errors with /full or /dlls heap options that it will not raise with standard heap options.

    You may be able to find out why the memory is being corrupted by examining the error message, the contents of the registers and memory at various levels in the call stack, and the corresponding source and assembly-language code.

  7. Click Stop Debugging in the WinDbg toolbar. This will halt the program and empty the debug window.
  8. Clear the heap options:

    GFlags /p /disable Program.exe



This Help system was created using a trial version of Adobe RoboHelp. Files generated with the trial version are intended for evaluation purposes only and may not be used or distributed for any other purpose.