Interpreting Visual C++ Object Dump. - Programmer

This is a discussion on Interpreting Visual C++ Object Dump. - Programmer ; Hi, I have a MFC program created in Visual Studio 6.0. I noticed the following message if I manually exiting the program while running from the debugger in the "debug tab": ================================================== ====================== The thread 0x944 has exited with code ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Interpreting Visual C++ Object Dump.

  1. Interpreting Visual C++ Object Dump.

    Hi, I have a MFC program created in Visual Studio 6.0. I noticed the
    following message if I manually exiting the program while running from
    the debugger in the "debug tab":

    ================================================== ======================
    The thread 0x944 has exited with code 0 (0x0).
    Detected memory leaks!
    Dumping objects ->
    {54} normal block at 0x020227F8, 928 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {52} normal block at 0x02022678, 132 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {51} normal block at 0x020225C0, 112 bytes long.
    Data: < Yw > EC 59 77 00 CD CD CD CD 01 00 00 00 00 00 00
    00
    {50} normal block at 0x02034ED0, 20000 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {49} normal block at 0x02030068, 20000 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {48} normal block at 0x02029668, 20000 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {47} normal block at 0x02024800, 20000 bytes long.
    Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD
    CD
    {46} normal block at 0x02022508, 112 bytes long.
    Data: < Yw > E0 59 77 00 CD CD CD CD 00 00 00 00 00 00 00
    00
    Object dump complete.
    The thread 0x7FC has exited with code 0 (0x0).
    The thread 0x358 has exited with code 0 (0x0).
    ================================================== ======================

    I have little in interpretting object dump in this environment. Some of
    the questions that I have:

    1). Do I need to enable some setting neither in the source code or in
    some menu of visual studio to even get this object dump message?

    2). Any recommendations of a good resource where I can learn about
    object dump messages/memory leak detection methods for visual studio?

    3). Since I get this message when I exit the program and the fact I can
    run the program for days without crashing, does that mean the memory
    leak as described in the message only occur WHEN the program exits?

    4). Any thoughts as to what the memory leak can come from? I am pretty
    good at initializing variables and when I can avoid do not use the new
    operator or the malloc function...The data being dumped in above seems
    to be alot of New Page and Carriage Returns....any thoughts on
    that?.... and what does the "{number }" mean?

    Thank you for your help.


  2. Re: Interpreting Visual C++ Object Dump.

    1) Only when _DEBUG is defined I guess.

    2) Not sure what you meant, but MFC tracks allocations for you.

    3) No, it means that at the point of exiting, some memory you allocated
    was still not freed. Since it's not a lot of memory, its effect can go
    unnoticed. But you should still find the source of the leak.

    4) The CD's in the data means the data is uninitialized. Make sure your
    allocations and deallocations are always paired, and also check if you
    did an allocation but deallocation was skipped due to exception, etc.


+ Reply to Thread