PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Heap bug, I'm going insane!

Hi all,

I've been trying to corner this bug I'm having for two weeks straight now, and I just can't find it.

My game runs fine. However, whenever I use the
_CRTDBG_CHECK_ALWAYS_DF heap check flag, I get this error:

HEAP[7errors.exe]: Number of free blocks in arena (43) does not match number in the free lists (44)

The numbers usually vary, sometimes <50, sometimes >6000.

The problem is that VisualStudio .NET breaks into the heap check function, not my code and I get no other information aside from what is mentioned above. No file or line number, nothing. Just the heap error in the output tab.

To make matter worse the bug doesn't occur after a specific action but at random, suggesting some kind of memory corruption.

If I don't use crtdbg at all I get no error report from VisualStudio or eVC, and the game doesn't crash, but I just fear the bug is there and will abide by Newton's law and popup at an innapropriate time.

If there are any debugging gurus out there, I'd appreciate a few hints as to what I could do to catch this sucker.

As a sidenote, BoundChecker doesn't report anything out of the ordinary, even with FinalCheck enabled.

Thanks. I have to finish this by sunday, and I tried all the tricks I could think of.

--Eric
The problem is that VisualStudio .NET breaks into the heap check function, not my code and I get no other information aside from what is mentioned above. No file or line number, nothing. Just the heap error in the output tab.
It doesn't give you a stack trace?
Yes it did...

I think I just found out the problem! Enhanced instruction set was set to SSE2 which I don't have on my trusty old Pentium 3.

What a nightmare, two weeks wasted for a lame properties that was wrong...

:cry:

--Eric
Pejo Software - Per · 16 Jul 2004, 17:31 UTC
Look at it on the bright side: You managed to find the problem :)
I actually think finding the solution to a problem you have been working on for a long time is one of the best moments when working as a programmer.
I agree Pejo... The guys at work just can't understanding how I can yell and scream and curse my ass off for days on end but claim to be having fun all along... I suppose it's not the days of acting like a maniac, it's that three seconds of lucidity at the end when everything falls into place that makes it all worth it. I wouldn't go so far as to say it's orgasmic, but I'm sure the endorphine levels are similar.
fzammetti wrote:it's that three seconds of lucidity at the end when everything falls into place that makes it all worth it
I must say that I know the feeling well and that you are right, it's pretty nice!

For my particular problem I went back and forth enabling and disabling the setting just to make sure it was the cause of the problem, and it pretty much amazed me that the "fix" didn't require any code change or hack or any ugly kludge of some sort!

--Eric
Hey Eric! It's nice to know you're back on the ppc scene. :) Sorry for the OT post guys.
Yep, good to see you back Eric! :)
Hi Erick and G.R.!

I've been in read-only mode for a while, I had to get my stuff in order. I just finished our small puzzle game a few days ago, and have been reading the Handango thread carefully. I'll be looking for sites to put the game on now I guess!

Anyway, thanks for the welcome back ;)

--Eric