?
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
Medium Priority
?
699 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
4 Comments
 
LVL 2

Accepted Solution

by:
carribus earned 672 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 664 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 664 total points
ID: 12179460
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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