Click to See Complete Forum and Search --> : Debugger messages


Achim Enders
April 16th, 1999, 01:01 AM
If a program is terminated that in the debugger of the VC++ studio runs, I get the following messages:

Detected memory leaks!
Dumping objects ->
{35932} normal block at 0x012C0120, 332 bytes long.
Data: <` ! p ! ! ! > 60 CA 21 01 70 CD 21 01 A0 D1 21 01 B0 D4 21 01
{35931} normal block at 0x012BFF90, 12 bytes long.
Data: < q ,D , > 00 00 00 00 71 B1 2C 44 20 01 2C 01

How can I interpret these messages?

Oak
April 16th, 1999, 05:33 AM
It means you allocated memory somewhere and forgot to deallocate it.



WBR Oak

Dave Lorde
April 16th, 1999, 06:33 AM
The dumped object details give you the allocation sequence number (in curly braces), the type of memory block allocated, its address and its size, and a partial dump of the data in the block at dump time.

You can find out which allocation caused the dump by setting global variable _afxBreakAlloc to the allocation sequence number (or, for non MFC programs, using it as an argument to the _CrtSetBreakAlloc function), which will break when that allocation is made (this depends on exactly the same sequence of allocations being made on each program run).

See the 'Visual C++ Programmer's Guide', 'Debugging' section, especially 'Using Object Dumps'.

Dave