Einzelnen Beitrag anzeigen

Benutzerbild von Dalai
Dalai

Registriert seit: 9. Apr 2006
1.078 Beiträge
 
Delphi 5 Professional
 
#4

AW: Speicherlecks in fremdem Code/Programm finden

  Alt 31. Dez 2016, 14:00
Um hier konkret mit Ideen aushelfen zu können, sind die Angaben zum Service etwas zu knapp.

Was macht er? (Grobe Beschreibung der Aufgabe.)
Der Dienst wird per Netzwerk von einem Sammler (dem "Server") alle 5 Minuten kontaktiert. Der Dienst ermittelt Angaben zum Systemstatus, darunter Auslastung von CPU und Speicher, sowie Netzwerktraffic, Dateisystembelegung, ggf. Systemtemperaturen usw. und liefert sie an den Server. Der Server verarbeitet diese Informationen und erzeugt daraus Graphen. Die Sache geht also in die gleiche Richtung wie dein Service.

Kannst du da vielleicht Beispiele posten?
Klar, kein Problem.
Code:
Visual Leak Detector Version 2.3 installed.
    Outputting the report to the debugger and to c:\VC\munin-node\memory_leak_report.txt
WARNING: Visual Leak Detector detected memory leaks!
---------- Block 116 at 0x003D5C00: 64 bytes ----------
  Call Stack:
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (43): munin-node.exe!std::_Allocate<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > + 0xC bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (145): munin-node.exe!std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >::allocate + 0xB bytes
    c:\programme\microsoft visual studio 9.0\vc\include\vector (1178): munin-node.exe!std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::_Insert_n + 0xF bytes
    c:\programme\microsoft visual studio 9.0\vc\include\vector (719): munin-node.exe!std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > > >::resize + 0x5C bytes
    c:\vc\munin-node\src\extra\inifile.cpp (227): munin-node.exe!CIniFile::SetValue
    c:\vc\munin-node\src\extra\inifile.cpp (87): munin-node.exe!CIniFile::ReadFile
    c:\vc\munin-node\src\core\munin-node.cpp (65): munin-node.exe!main
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (582): munin-node.exe!__tmainCRTStartup + 0x19 bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (399): munin-node.exe!mainCRTStartup
    0x7C817067 (File and line number not available): kernel32.dll!RegisterWaitForInputIdle + 0x49 bytes
  Data:
    00 00 00 00    CD CD CD CD   42 72 6F 61    64 63 61 73     ........ Broadcas
    74 49 50 00    CD CD CD CD   0B 00 00 00    0F 00 00 00     tIP..... ........
    00 00 00 00    CD CD CD CD   55 49 44 00    CD CD CD CD    ........ UID.....
    CD CD CD CD   CD CD CD CD   03 00 00 00    0F 00 00 00     ........ ........


---------- Block 127 at 0x003D5C80: 4 bytes ----------
  Call Stack:
    c:\vc\munin-node\src\core\muninpluginmanager.cpp (61): munin-node.exe!MuninPluginManager::MuninPluginManager + 0x7 bytes
    0x004665C5 (File and line number not available): munin-node.exe!MuninNodeServer::MuninNodeServer + 0x65 bytes
    c:\vc\munin-node\src\core\service.cpp (135): munin-node.exe!CService::Run + 0x2E bytes
    c:\vc\munin-node\src\core\service.cpp (63): munin-node.exe!CService::Start
    c:\vc\munin-node\src\core\munin-node.cpp (110): munin-node.exe!main
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (582): munin-node.exe!__tmainCRTStartup + 0x19 bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (399): munin-node.exe!mainCRTStartup
    0x7C817067 (File and line number not available): kernel32.dll!RegisterWaitForInputIdle + 0x49 bytes
  Data:
    E0 7F 47 00                                                  ..G..... ........


---------- Block 1 at 0x003D5FD8: 24 bytes ----------
  Call Stack:
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (43): munin-node.exe!std::_Allocate<std::_Tree_nod<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> >,0> >::_Node> + 0xC bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (145): munin-node.exe!std::allocator<std::_Tree_nod<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> >,0> >::_Node>::allocate + 0xB bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (1384): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> >,0> >::_Buynode + 0xD bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (1178): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> >,0> >::_Init + 0x8 bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (511): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> >,0> >::_Tree<std::_Tmap_traits<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,vo
    c:\programme\microsoft visual studio 9.0\vc\include\map (104): munin-node.exe!std::map<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> > >::map<unsigned long,void *,std::less<unsigned long>,std::allocator<std::pair<unsigned long const ,void *> > >
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (14): munin-node.exe!CSmartReader::CSmartReader + 0x59 bytes
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (393): munin-node.exe!CSmartReader2::CSmartReader2 + 0x2B bytes
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (413): munin-node.exe!`dynamic initializer for 'g_SmartReader'' + 0x28 bytes
    0x1023C02C (File and line number not available): MSVCR90D.dll!initterm + 0x1C bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (497): munin-node.exe!__tmainCRTStartup + 0xF bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (399): munin-node.exe!mainCRTStartup
    0x7C817067 (File and line number not available): kernel32.dll!RegisterWaitForInputIdle + 0x49 bytes
  Data:
    D8 5F 3D 00    D8 5F 3D 00    D8 5F 3D 00    CD CD CD CD    ._=.._=. ._=.....
    CD CD CD CD   01 01 CD CD                                  ........ ........


---------- Block 2 at 0x003D6030: 548 bytes ----------
  Call Stack:
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (43): munin-node.exe!std::_Allocate<std::_Tree_nod<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> >,0> >::_Node> + 0xF bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xmemory (145): munin-node.exe!std::allocator<std::_Tree_nod<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> >,0> >::_Node>::allocate + 0xB bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (1384): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> >,0> >::_Buynode + 0xD bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (1178): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> >,0> >::_Init + 0x8 bytes
    c:\programme\microsoft visual studio 9.0\vc\include\xtree (511): munin-node.exe!std::_Tree<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> >,0> >::_Tree<std::_Tmap_traits<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std
    c:\programme\microsoft visual studio 9.0\vc\include\map (104): munin-node.exe!std::map<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAILS> > >::map<unsigned char,ST_SMART_DETAILS,std::less<unsigned char>,std::allocator<std::pair<unsigned char const ,ST_SMART_DETAIL
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (14): munin-node.exe!CSmartReader::CSmartReader + 0x6E bytes
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (393): munin-node.exe!CSmartReader2::CSmartReader2 + 0x2B bytes
    c:\vc\munin-node\src\plugins\disk\smartreader.cpp (413): munin-node.exe!`dynamic initializer for 'g_SmartReader'' + 0x28 bytes
    0x1023C02C (File and line number not available): MSVCR90D.dll!initterm + 0x1C bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (497): munin-node.exe!__tmainCRTStartup + 0xF bytes
    f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c (399): munin-node.exe!mainCRTStartup
    0x7C817067 (File and line number not available): kernel32.dll!RegisterWaitForInputIdle + 0x49 bytes
  Data:
    30 60 3D 00    30 60 3D 00    30 60 3D 00    CD CD CD CD    0`=.0`=. 0`=.....
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
    CD CD CD CD   CD CD CD CD   CD CD CD CD   CD CD CD CD    ........ ........
Aus dem Call Stack wird auch klar, dass es um Munin geht, konkret Munin Node for Windows (aktuell bei Github). Im Laufe der vergangenen Jahre habe ich immer mal wieder Bugs behoben und einige Funktionen ergänzt, aber die Speicherlecks gibt's auch mit der ursprünglichen unveränderten Version 1.5.1942.

Grüße
Dalai
  Mit Zitat antworten Zitat