2014-05-12 10 views
5

Sto testando la mia DLL che ho creato. A sua volta usa diverse altre DLL. Il mio Dll tester di memoria report applicativi perdite quando inizio l'applicazione di test e uscire senza fare nulla, se non il caricamento di DLL utilizzando LoadLibrary. Non mostra i file esatti nel mio codice sorgente dll. Non ci sono perdite se non carico la DLL. È una dll MFC e ha classe App. Ho rimosso tutto dalla classe dell'app della DLL, in modo che non faccia altro, ma continuo a ricevere un rapporto sulle perdite di memoria quando lo carico. Ho creato un altro set di DLL manichino e applicazione di test, ma questo non segnalare eventuali perdite in modo che ha a che fare con la mia dll originale, forse il suo collegamento con altre DLL?Potrebbe essere un rapporto di perdita di memoria positivo falso?

Ho provato con _crtBreakAlloc = {allocation_#}; tecnica, ma non si ferma il debugger sia. Sono abbastanza perso se questa perdita di memoria è reale. Vedo da documentation può segnalare falsi positivi. Questo potrebbe essere falso positivo solo perché la mia DLL è collegata a un mucchio di altre DLL? Non riesco a pensare ad altro perché ho commentato tutte le funzionalità di dll.

Ecco la perdita di memoria erros

Detected memory leaks! 
Dumping objects -> 
{250} client block at 0x00567E40, subtype c0, 64 bytes long. 
a CDynLinkLibrary object at $00567E40, 64 bytes long 
a CDynLinkLibrary object at $00567E40, 64 bytes long 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {244} normal block at 0x00567C20, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {243} normal block at 0x00567BC8, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {242} normal block at 0x00567B58, 52 bytes long. 
Data: < x   > E4 B8 07 78 11 00 00 00 11 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {241} normal block at 0x00566C08, 40 bytes long. 
Data: < x   > E4 B8 07 78 0B 00 00 00 0B 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {240} normal block at 0x00566BA8, 32 bytes long. 
Data: < x   > E4 B8 07 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {239} normal block at 0x00566B50, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {238} normal block at 0x00566AE0, 46 bytes long. 
Data: < x   > E4 B8 07 78 0E 00 00 00 0E 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {237} normal block at 0x00566A70, 48 bytes long. 
Data: < x   > E4 B8 07 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {235} normal block at 0x005676B0, 42 bytes long. 
Data: < x   > E4 B8 07 78 0C 00 00 00 0C 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {234} normal block at 0x00567658, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {233} normal block at 0x00567600, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {232} normal block at 0x00567590, 50 bytes long. 
Data: < x   > E4 B8 07 78 10 00 00 00 10 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {231} normal block at 0x00567538, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {230} normal block at 0x005674E0, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {229} normal block at 0x00567488, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {228} normal block at 0x00567430, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {227} normal block at 0x005673D8, 24 bytes long. 
Data: < x   > E4 B8 07 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {226} normal block at 0x00567380, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {225} normal block at 0x00567328, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {224} normal block at 0x005672C0, 40 bytes long. 
Data: < x   > E4 B8 07 78 0B 00 00 00 0B 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {223} normal block at 0x00567268, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {222} normal block at 0x00567200, 44 bytes long. 
Data: < x   > E4 B8 07 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {221} normal block at 0x00567198, 38 bytes long. 
Data: < x   > E4 B8 07 78 0A 00 00 00 0A 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {220} normal block at 0x00567140, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {219} normal block at 0x005670E8, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {218} normal block at 0x00567080, 38 bytes long. 
Data: < x   > E4 B8 07 78 0A 00 00 00 0A 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {217} normal block at 0x00567028, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {216} normal block at 0x00566FD0, 24 bytes long. 
Data: < x   > E4 B8 07 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {215} normal block at 0x00566F78, 24 bytes long. 
Data: < x   > E4 B8 07 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {214} normal block at 0x00566F18, 36 bytes long. 
Data: < x   > E4 B8 07 78 09 00 00 00 09 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {213} normal block at 0x00566EC0, 24 bytes long. 
Data: < x   > E4 B8 07 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {212} normal block at 0x00566E68, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {211} normal block at 0x00566E10, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {210} normal block at 0x00566DB8, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {209} normal block at 0x00566D60, 24 bytes long. 
Data: < x   > E4 B8 07 78 03 00 00 00 03 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {208} normal block at 0x00566D08, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {207} normal block at 0x00566CB0, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {206} normal block at 0x00561918, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {205} normal block at 0x005618C0, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {204} normal block at 0x00561868, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {202} normal block at 0x005669F8, 60 bytes long. 
Data: < x   > E4 B8 07 78 15 00 00 00 15 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {201} normal block at 0x00566988, 46 bytes long. 
Data: < x   > E4 B8 07 78 0E 00 00 00 0E 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {200} normal block at 0x00566920, 42 bytes long. 
Data: < x   > E4 B8 07 78 0C 00 00 00 0C 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {199} normal block at 0x005668C8, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {198} normal block at 0x00566868, 32 bytes long. 
Data: < x   > E4 B8 07 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {197} normal block at 0x00566800, 44 bytes long. 
Data: < x   > E4 B8 07 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {196} normal block at 0x00566790, 50 bytes long. 
Data: < x   > E4 B8 07 78 10 00 00 00 10 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {195} normal block at 0x00566718, 60 bytes long. 
Data: < x   > E4 B8 07 78 15 00 00 00 15 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {194} normal block at 0x005666C0, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {193} normal block at 0x00566040, 48 bytes long. 
Data: < x   > E4 B8 07 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {192} normal block at 0x00561C98, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {81} normal block at 0x00561BA0, 32 bytes long. 
Data: < x   > E4 B8 07 78 07 00 00 00 07 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {80} normal block at 0x00561B48, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {79} normal block at 0x00561AE0, 44 bytes long. 
Data: < x   > E4 B8 07 78 0D 00 00 00 0D 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {78} normal block at 0x00561A80, 34 bytes long. 
Data: < x   > E4 B8 07 78 08 00 00 00 08 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {77} normal block at 0x00561A20, 30 bytes long. 
Data: < x   > E4 B8 07 78 06 00 00 00 06 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {76} normal block at 0x005613D0, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {75} normal block at 0x005619A8, 56 bytes long. 
Data: < x   > E4 B8 07 78 13 00 00 00 13 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {74} normal block at 0x00561378, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {72} normal block at 0x005617F8, 48 bytes long. 
Data: < x   > E4 B8 07 78 0F 00 00 00 0F 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {71} normal block at 0x005617A0, 28 bytes long. 
Data: < x   > E4 B8 07 78 05 00 00 00 05 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {70} normal block at 0x00561748, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {69} normal block at 0x005616D0, 54 bytes long. 
Data: < x   > E4 B8 07 78 12 00 00 00 12 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {68} normal block at 0x00561670, 34 bytes long. 
Data: < x   > E4 B8 07 78 08 00 00 00 08 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {67} normal block at 0x00561618, 22 bytes long. 
Data: < x   > E4 B8 07 78 02 00 00 00 02 00 00 00 01 00 00 00 
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {66} normal block at 0x005615B8, 36 bytes long. 
Data: < x   > E4 B8 07 78 09 00 00 00 09 00 00 00 01 00 00 00 
Object dump complete. 

C'è un altro modo per controllare due volte la memoria non esistono perdite? Ho installato anche Deleaker ma è un programma bacato, che tiene su file pdb e non lo stava rilasciando ... che mi ha causato più dolore.

+1

solo per verificare, come si chiama 'FreeLibrary' prima di uscire il vostro programma? – Velox

+0

Sì che faccio, ho anche un file di log che registra in quando carica e scarica il dll ma ho commentato anche che la funzionalità. – zar

+1

[Questo MSKB] (http://support.microsoft.com/kb/167929) potrebbe essere rilevante. –

risposta

6

Secondo l'articolo MSKB, questo è probabilmente previsto:

Memory leaks are reported when you use multiple MFC DLLs

Citando dalla pagina collegata:

Queste perdite di memoria vengono segnalate quando più versioni del DLL MFC sono caricati nello stesso processo. Dal momento che l'estensione MFC (AFXDLL) DLL richiedono la stessa DLL MFC come l'applicazione chiamata, questo problema può verificarsi solo quando si utilizzano normali DLL MFC (USRDLL) o ActiveX controlli (OCX) che utilizzano la versione condivisa di MFC.

Il caso più comune sta mescolando ANSI (MFC4xd.DLL) e Unicode (MFC4xxUd.DLL) versioni di MFC nello stesso processo. Questo può anche verificarsi quando si mescolano MFC42d.DLL e MFC40d.DLL.

E per quanto riguarda la soluzione del "problema" va:

Queste notifiche di perdita di memoria sono false, e possono essere ignorati. Dal momento che né copia di MFC conosce gli altri, non è facile smettere di queste false fughe di essere segnalati.