Standard Heap Options

A session with standard heap options would go as follows:

  1. Set standard heap options.

    GFlags /p /enable Program.exe

  2. Invoke WinDbg.exe.
  3. Run Program.exe from WinDbg using File, then Open Executable. If this were a program that brought up a command window or a dialog box that waited for user input, you could also run it from the command line or via Windows, and then attach WinDbg to it by using File, then Attach to a Process.
  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 standard heap options cause the system to place a suffix pattern after each allocation.

    When your program attempts to delete the allocation, the system will check the suffix pattern, and if it has been overwritten, 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.

    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. If you do not do this, every user of the program after you will experience slow performance.

    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.