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
657 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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…
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 viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

746 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

10 Experts available now in Live!

Get 1:1 Help Now