HEAP debug messages 
Author Message
 HEAP debug messages

Hello,

I'm developing a project using VC 6.0 and ATL under Windows 2000.  I was
debugging some new code recently and noticed some messages in the de{*filter*}'s
output window that are perplexing me.  The messages look something like the
following:

HEAP[Back.exe]: HEAP: Free Heap block d25050 modified at d25214 after it was
freed

I can consistenly make this message occur and it is occurring during a call
to the Win32 HeapFree function which is being called by the CRT free method.
It appears that during the process of freeing one heap block, another block
that was previously freed is being written to.

From my debugging, it seems that the data being written to the freed block
is always a 0x01 and that the freed block being violated always occurs
shortly before the block being freed in memory.

The errant write operations have not caused any detrimental side effects so
far, but I'm worried that they may.  If anyone has any experience with this
sort of heap behavior I would appeciate if you could give me any clues as to
what I am doing incorrectly.

Thanks,
Steve



Sat, 11 Oct 2003 07:21:01 GMT  
 HEAP debug messages
The error doesn't happen within free, it is detected within free.
Some code before that caused the memory overrun. Purify (or
Insure or BoundsCheck, whatever) your code to find the offending
line.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.*-*-*.com/
=====================================


Quote:
> Hello,

> I'm developing a project using VC 6.0 and ATL under Windows 2000.  I was
> debugging some new code recently and noticed some messages in the
de{*filter*}'s
> output window that are perplexing me.  The messages look something like
the
> following:

> HEAP[Back.exe]: HEAP: Free Heap block d25050 modified at d25214 after it
was
> freed

> I can consistenly make this message occur and it is occurring during a
call
> to the Win32 HeapFree function which is being called by the CRT free
method.
> It appears that during the process of freeing one heap block, another
block
> that was previously freed is being written to.

> From my debugging, it seems that the data being written to the freed block
> is always a 0x01 and that the freed block being violated always occurs
> shortly before the block being freed in memory.

> The errant write operations have not caused any detrimental side effects
so
> far, but I'm worried that they may.  If anyone has any experience with
this
> sort of heap behavior I would appeciate if you could give me any clues as
to
> what I am doing incorrectly.

> Thanks,
> Steve



Sat, 11 Oct 2003 08:16:40 GMT  
 HEAP debug messages
Alexander,

Thanks for clearing up my confusion about what was actually happening in my
code.  It took an embarrassing long time, but I've finally pinpointed and
corrected the bug.  Thanks again.

Steve



Sun, 12 Oct 2003 01:24:52 GMT  
 HEAP debug messages
You are welcome :).

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Alexander,

> Thanks for clearing up my confusion about what was actually happening in
my
> code.  It took an embarrassing long time, but I've finally pinpointed and
> corrected the bug.  Thanks again.

> Steve



Sun, 12 Oct 2003 02:35:03 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. HEAP Debug Messages

2. HEAP debug message

3. HEAP debug message

4. incorrect debug heap messages in 4.2?

5. Heap Problems: Both Debug and non-Debug versions of CRT are active

6. HEAP[dllhost.exe]: HEAP: Free Heap block 1e32c28 modified at 1e32dc4 after it was freed

7. Debugging the C++ heap

8. Using the Debug Heap

9. How to turn off debug heap checking?

10. Debugging the heap

11. CRT heap, debug configurations, and WS2_32.DLL

12. Turn of debug info in heap

 

 
Powered by phpBB® Forum Software