Solved

HEAP [example.exe]: "Number of free blocks in arena (69) does not match number in the free lists (68)"

Posted on 2004-09-29
7
675 Views
Last Modified: 2007-12-19
This is a VERY difficult problem were having when we exit the main application in runtime. It does not come up in DEBUG mode. Im using Visual C++ V6 Service Pack 6 under Windows XP Pro.

Error Message: "HEAP:[example.exe] Number of free blocks in arena (69) does not match number in the free lists (68)

When it exits the main application the above error message comes up after it completes the exit instance in the main application.

Has anyone got any ideas what this error means and how to diagnose and fix the problem. The main application is very big.

Many thanks

Mike
0
Comment
Question by:Mike38
7 Comments
 
LVL 2

Accepted Solution

by:
carribus earned 168 total points
ID: 12178031
The last time I heard the term "arena" was back in the good old DOS days when one had to know about "arenas" of memory for virtual memory managers and so on. I went and did some reading in the MSDN, and it seems that Windows has 2 different "versions" of memory arenas, specifically one version for Win9x and ME, and another for the NT based Windows (for obvious reasons).

Coming back to your question, I don't have an answer for you, but I do have a few suggestions and queries.

1. In your application, are you performing any 'unusual' memory operations? perhaps dipping down into the metal with a few _asm { } blocks of code?
2. Do you have your own memory manager running in this app? Does it do any Virtual Memory calls during the execution of the app? If yes, make sure that all the calls are terminated correctly and all handles are closed.

Thats about all I can think of. If I find anything else, I'll post.
0
 

Author Comment

by:Mike38
ID: 12178084
Many thanks for the quick reply.

I don't do any unsual memory operations like _asm and I don't use my own memory manager app. I also make sure the calls are terminated correctly and handles closed.

Very strange bug error message.

Mike
0
 
LVL 22

Assisted Solution

by:grg99
grg99 earned 166 total points
ID: 12178469
You're probably zapping some bytes past the end of one of the blocks you allocate.   I'd use some heap debug tool that checks for this.  Or you can roll your own malloc() and free() wrappers that check for this.

0
 
LVL 86

Assisted Solution

by:jkr
jkr earned 166 total points
ID: 12179460
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

829 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