PRB: Starting Heap Walker Results in a GP Fault

Last reviewed: February 15, 1996
Article ID: Q97759
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1

SYMPTOMS

When the Microsoft Windows Heap Walker application (HEAPWALK.EXE) that is shipped with the Microsoft Windows versions 3.0 and 3.1 SDK is started or if another application is started after Heap Walker is running, a general protection (GP) fault may occur with the following message:

   HEAPWALK caused a general Protection Fault in
   module HEAPWALK.EXE at xxxx.xxxx.

If Dr. Watson is running, it reports the fault as:

   'Exceed Segment Bounds (Write)' fault at HEAPWALK xxxx:xxxx

CAUSE

There is a bug in the Heap Walker application that results in a GP fault when there are too many objects in the global heap. This problem happens more often when many applications are running in the system. The problem can also happen, however, when only a few applications are running in the system but some of them are allocating a number of global memory blocks.

RESOLUTION

Do one of the following to resolve this problem:

  • Do not run the Heap Walker application when many applications are running in the system. If the GP fault occurs, exit and restart Windows, and run Heap Walker only when a few applications are running.

    -or-

  • Use the updated version of the Heap Walker application available in the Software Library. The updated version, called NEWHEAP, corrects the GP fault problem.

Download NEWHEAP.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download NEWHEAP.EXE (size: 35070 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get NEWHEAP.EXE (size: 35070 bytes) 
    

MORE INFORMATION

When the Heap Walker application is started, it tries to list all the objects in the global heap in its main window. It uses the Toolhelp Library to walk the global heap, and it keeps track of all these objects in a linked list. If there are a large number of objects in the global heap, the linked list would grow beyond a 64K segment. Any global object that grows larger than a 64K segment must be accessed using huge pointers, otherwise an error will occur. In the Heap Walker application, the linked list is being accessed using far pointers instead of huge pointers. This results in a GP fault.

The updated version of Heap Walker corrects this problem by using huge pointers instead of far pointers to access the linked list.


Additional reference words: 3.00 3.10 crash gpf gp-fault heapwalker
KBCategory: kbtool kbprg kbfile kbprb
KBSubcategory: TlsHeapWalk


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.