Heap block at 0114A0C0 modified at 0114B098 past requested size of fd0

Posted on 2005-05-04
Last Modified: 2013-11-20

When I close my application I am getting a message

HEAP[Acquisition.exe]: Heap block at 0114A0C0 modified at 0114B098 past requested size of fd0

and I am having trouble tracking it down. I have checked all the destructors for my objects and
they are all executing. The problem seems to come after everything (or almost!) has been destructed.

I do not have boundschecker or any other similar tool. Can anyone suggest a way of tracking this
error down.

Many, Many thanks in advance
Question by:antinutrino
    LVL 86

    Assisted Solution

    Let's start whith the message - check where you allocate memory areas with the size of '0xfd0' or 4048.
    LVL 55

    Accepted Solution

    Could be a better idea to review your destructors, instead of trying to analyze memory heap like in The Matrix.
    Even you can put some MessageBox() to stop into destructors to detect when the problem is caused.
    LVL 86

    Expert Comment

    >>instead of trying to analyze memory heap like in The Matrix

    That's not a big deal:

       An allocation hook function can have many, many different
       uses. This one simply logs each allocation operation in a file.
    int __cdecl MyAllocHook(
       int      nAllocType,
       void   * pvData,
       size_t   nSize,
       int      nBlockUse,
       long     lRequest,
       const unsigned char * szFileName,
       int      nLine

       if ( nBlockUse == _CRT_BLOCK )   // Ignore internal C runtime library allocations
          return( TRUE );

       // break in debugger to see where that came from if the size matches
       if ( nAllocType == _HOOK_ALLOC && nSize = 4048) DebugBreak ();

       return( TRUE );         // Allow the memory operation to proceed

    // in 'InitInstance()':


    Once it is known where the allocation of that size came from, it is not that difficult any more to find what caused the overwrite.
    LVL 55

    Expert Comment

    by:Jaime Olivares
    looks like piece of cake  ;)

    Author Comment


    Thanks for the posts. I managed to locate the problem it was in certain circumstances
    writing beyond the end of an array and when it came to deleting the array, I got the
    HEAP problem.

    Many thanks to all

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Suggested Solutions

    Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now