视觉检漏仪输出分析:无法解码输出屏幕上的结果意味着什么

Visual leak detector output analysis: not able to decode what the result on output screen means

本文关键字:输出 屏幕 解码 意味着 结果 什么 视觉      更新时间:2023-10-16

使用Visual Leak Detector在Visual Studio 10.0上执行Visual C++程序时,我在输出屏幕上得到以下结果:

{359} normal block at 0x00000000012FFF30, 16 bytes long
 Data: <                > D8 0F 94 E4 F7 07 00 00 00 00 00 00 00 00 00 00 

这是输出的其中一行。。如果有人能告诉我如何分析这一点,或者这意味着什么,那将是一个很大的帮助。同样在泄漏开始时,我也得到了以下几行:

 Call Stack:
    c:program files (x86)microsoft visual studio 10.0vcincludexmemory (36): Dual OS.exe!std::_Allocate<std::_Container_proxy> + 0x22 bytes
    c:program files (x86)microsoft visual studio 10.0vcincludexmemory (188): Dual OS.exe!std::allocator<std::_Container_proxy>::allocate
    c:program files (x86)microsoft visual studio 10.0vcincludexstring (469): Dual OS.exe!std::_String_val<char,std::allocator<char> >::_String_val<char,std::allocator<char> > + 0xF bytes
    c:program files (x86)microsoft visual studio 10.0vcincludexstring (550): Dual OS.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::basic_string<char,std::char_traits<char>,std::allocator<char> > + 0x33 bytes
    c:usersparthkumarsdesktopdualosduosduosdlg.cpp (385): Dual OS.exe!CDUOSDlg::CDUOSDlg + 0xA2 bytes
    c:usersparthkumarsdesktopdualosduosduos.cpp (39): Dual OS.exe!`dynamic initializer for 'dlg'' + 0x12 bytes
    0x0000000014510E94 (File and line number not available): (Module name unavailable)!(Function name unavailable)
  Data:
    D0 0C 94 E4    F7 07 00 00    00 00 00 00    00 00 00 00     ........ ........

---------- Block 2 at 0x00000000012FFA40: 16 bytes ----------
  Call Stack:
    c:program files (x86)microsoft visual studio 10.0vcincludexmemory (36): Dual OS.exe!std::_Allocate<std::_Container_proxy> + 0x22 bytes
    c:program files (x86)microsoft visual studio 10.0vcincludexmemory (188): Dual OS.exe!std::allocator<std::_Container_proxy>::allocate
    c:program files (x86)microsoft visual studio 10.0vcincludevector (442): Dual OS.exe!std::_Vector_val<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >::_Vector_val<std::pair<unsign + 0xF bytes
    c:program files (x86)microsoft visual studio 10.0vcincludevector (507): Dual OS.exe!std::vector<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<unsigned long,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > >::vector<std::pair<unsigned long,st + 0x33 bytes
    c:usersparthkumarsdesktopdualosduoseventdispatcher.h (19): Dual OS.exe!CEventDispatcher::CEventDispatcher + 0x3D bytes
    c:usersparthkumarsdesktopdualosduosduosdlg.cpp (385): Dual OS.exe!CDUOSDlg::CDUOSDlg + 0x149 bytes
    c:usersparthkumarsdesktopdualosduosduos.cpp (39): Dual OS.exe!`dynamic initializer for 'dlg'' + 0x12 bytes
    0x0000000014510E94 (File and line number not available): (Module name unavailable)!(Function name unavailable)
  Data:
    88 0D 94 E4    F7 07 00 00    00 00 00 00    00 00 00 00     ........ ........

输出基本上告诉您的程序分配了一些内存,但它在终止之前没有释放内存。

第一个输出告诉内存中包含了多少数据和什么数据。

调用堆栈告诉内存分配在哪里。

查看一下CEventDispatcher构造函数,您应该会发现一个新的std::vector对,现在已经删除了(正确的放置位置可以是dtor)

对我来说,repot中最重要的是调用堆栈,它显示了分配点,以后如果您掌握了调试器,您将能够使用函数地址和偏移量!