?
Solved

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

Posted on 2005-05-04
5
Medium Priority
?
1,459 Views
Last Modified: 2013-11-20
Hi

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
anti
0
Comment
Question by:antinutrino
  • 2
  • 2
5 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 1200 total points
ID: 13929562
Let's start whith the message - check where you allocate memory areas with the size of '0xfd0' or 4048.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 800 total points
ID: 13929702
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.
0
 
LVL 86

Expert Comment

by:jkr
ID: 13929801
>>instead of trying to analyze memory heap like in The Matrix

That's not a big deal:

/* ALLOCATION HOOK FUNCTION
   -------------------------
   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()':

_CrtSetAllocHook(MyAllocHook);

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.
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 13929862
looks like piece of cake  ;)
0
 

Author Comment

by:antinutrino
ID: 13936328
Hi

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
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

850 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