Heap problems in VC++ .NET 
Author Message
 Heap problems in VC++ .NET

Hi,

I have a ActiveX DLL component and a test program, i'm getting bizarre error
messages while debugging in VC++ .NET. The strange thing is that the program
can continue executing normally without any complications so far (and i've
tested it a lot!).
Another strange fact is that if i run the program without debugging, the OS
does not show any kind of warning or anything...

The error message is:

HEAP[DockTest.exe]: HEAP: Free Heap block 3d1ac68 modified at 3d1acfc after
it was freed
Unhandled exception at 0x77f97704 in DockTest.exe: User breakpoint.

The breakpoint goes to malloc.c, line 211, in a call to HeapAlloc.
The problem occurs with malloc AND new...
I beleive that the memory is getting corrupted in some point before the
message shows up, and it is only when i try to allocate a new object that
the de{*filter*} sees it.

Is there anyway i can have more information about who is messing up with the
memory??? It is probably my component, it might be the Test application (a
VB.NET app) or the de{*filter*}...

Thanks for your time.



Mon, 28 Feb 2005 04:10:46 GMT  
 Heap problems in VC++ .NET


Quote:
> Hi,

> I have a ActiveX DLL component and a test program, i'm getting bizarre
error
> messages while debugging in VC++ .NET. The strange thing is that the
program
> can continue executing normally without any complications so far (and i've
> tested it a lot!).
> Another strange fact is that if i run the program without debugging, the
OS
> does not show any kind of warning or anything...

> The error message is:

> HEAP[DockTest.exe]: HEAP: Free Heap block 3d1ac68 modified at 3d1acfc
after
> it was freed
> Unhandled exception at 0x77f97704 in DockTest.exe: User breakpoint.

> The breakpoint goes to malloc.c, line 211, in a call to HeapAlloc.
> The problem occurs with malloc AND new...
> I beleive that the memory is getting corrupted in some point before the
> message shows up, and it is only when i try to allocate a new object that
> the de{*filter*} sees it.

> Is there anyway i can have more information about who is messing up with
the
> memory??? It is probably my component, it might be the Test application (a
> VB.NET app) or the de{*filter*}...

Sometimes you can tell where the data came from by seeing *what* and *how
much* was written to the freed block. If it's consistently the same address,
I usually try to find out what that piece of memory was used for; then set
up the de{*filter*} to watch that area for modifications (breakpoint) after it's
freed or step through the code and see when it gets changed, repeatedly
narrowing down the code until the offending line is found.

You could also try commenting things out or otherwise removing functionality
to try to determine who might be at fault.

HTH

Jay



Mon, 28 Feb 2005 23:42:33 GMT  
 Heap problems in VC++ .NET

Quote:
> Is there anyway i can have more information about who is messing up with
the
> memory??? It is probably my component, it might be the Test application (a
> VB.NET app) or the de{*filter*}...

These bugs are usually HARD to track down, unfortunately.  You might try
running under BoundsChecker or Purify, if either of those are available to
you.

-cd



Tue, 01 Mar 2005 00:17:47 GMT  
 Heap problems in VC++ .NET
Thanks for your help!

Purify helped me get to the point of the bug, very nice tool by the way!



Tue, 01 Mar 2005 09:19:23 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. heap corruption issues with VC++.NET and STL

2. Performance problems with VS.net and heap data

3. Heap Usage problem with ATL exe - VC 5.0/ATL 2.1

4. problem with malloc in VC++6 SP1 (small block heap handler)

5. heap problem in VC++ compiler(help)

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

7. Problem converting VC++ 6.0 project to VC++.net

8. Problem porting ATL project from VC++ 6.0 to VC++.NET 2003

9. Problem with ATLCONV.H when porting from VC++6.0 to VC++.NET

10. problem porting an application from VC++ 6 to VC++ .NET

11. VC 6 -> VC.NET Problem

12. problem porting an application from VC++ 6 to VC++ .NET

 

 
Powered by phpBB® Forum Software