Menu

#201 FoundationKit Dll memory leaks!

open
5
2009-12-01
2009-11-27
Sean Chen
No

About att:
SFService is my dll
DlgTest is my dialog
Because attachment size, please copy vcf-0.9.8 source to project\vcf\FoundationKit directory, and don't replace the files in project\vcf\FoundationKit, this is just modified include headers. others is not modify.

FoundationKit Dll memory leaks!

Liabary : vcf-0.9.8
Platform: Win2003 + vc2005/vc2008
language: Chinese
What caused the bug: VCF::Object or String or other, not sure
Email address: qmroom@126.com

Recur bug steps:
1. Build vcf-0.9.8 with "FoundationKitDLL_vc80.sln"

2. Add new MFC-DLL project "MyDLL", include vcf headers
#include "vcf/FoundationKit/FoundationKit.h"
#include "vcf/FoundationKit/RTTIMacros.h"

3. In "MyDLL" stdafx.cpp, create my new class inherit VCF::Object

class __declspec(dllexport) MyClass : public VCF::Object
{
};

// and add SFService
class __declspec(dllexport) SFService
{
public:
~SFService(){}
static void init(){}
static void terminate(){}
private :
SFService(){}
};

4. Add new MFC-Dialog project "MyDlg", "MyDlg" include vcf headers and "MyDLL" headers.
And in dlg InitInstance() add

SFService::init();

5. Link with above two dll libs. Start debug "MyDlg" and close dlg. VS2005 Detected memory leaks!

Dumping objects ->
{185} normal block at 0x00D572A8, 32 bytes long.
Data: <S h a r e d M o > 53 00 68 00 61 00 72 00 65 00 64 00 4D 00 6F 00
{183} normal block at 0x00D57248, 32 bytes long.
Data: <D e f a u l t M > 44 00 65 00 66 00 61 00 75 00 6C 00 74 00 4D 00
{181} normal block at 0x00D57158, 88 bytes long.
Data: <Xq Xq Xq > 58 71 D5 00 58 71 D5 00 58 71 D5 00 CD CD CD CD
{180} normal block at 0x00D57100, 28 bytes long.
Data: < q q q > 00 71 D5 00 00 71 D5 00 00 71 D5 00 CD CD CD CD
{179} normal block at 0x00D57088, 56 bytes long.
Data: < p p p > 88 70 D5 00 88 70 D5 00 88 70 D5 00 CD CD CD CD
{166} normal block at 0x00D57028, 32 bytes long.
Data: <D e c e m b e r > 44 00 65 00 63 00 65 00 6D 00 62 00 65 00 72 00
{164} normal block at 0x00D56FC8, 32 bytes long.
Data: <N o v e m b e r > 4E 00 6F 00 76 00 65 00 6D 00 62 00 65 00 72 00
{161} normal block at 0x00D56F68, 32 bytes long.

Data: <S e p t e m b e > 53 00 65 00 70 00 74 00 65 00 6D 00 62 00 65 00
{153} normal block at 0x00D56F08, 32 bytes long.
Data: <F e b r u a r y > 46 00 65 00 62 00 72 00 75 00 61 00 72 00 79 00
{143} normal block at 0x00D56EA8, 32 bytes long.
Data: <S a t u r d a y > 53 00 61 00 74 00 75 00 72 00 64 00 61 00 79 00
{140} normal block at 0x00D56E48, 32 bytes long.
Data: <T h u r s d a y > 54 00 68 00 75 00 72 00 73 00 64 00 61 00 79 00
{138} normal block at 0x00D56DE8, 32 bytes long.
Data: <W e d n e s d a > 57 00 65 00 64 00 6E 00 65 00 73 00 64 00 61 00
{133} normal block at 0x00D56D00, 88 bytes long.
Data: < m m m > 00 6D D5 00 00 6D D5 00 00 6D D5 00 CD CD CD CD
{132} normal block at 0x00D56C88, 56 bytes long.
Data: < l l l > 88 6C D5 00 88 6C D5 00 88 6C D5 00 CD CD CD CD
{131} normal block at 0x00D56BF8, 80 bytes long.
Data: < k k k > F8 6B D5 00 F8 6B D5 00 F8 6B D5 00 CD CD CD CD
{130} normal block at 0x00D56B68, 80 bytes long.
Data: <hk hk hk > 68 6B D5 00 68 6B D5 00 68 6B D5 00 CD CD CD CD
{129} normal block at 0x00D56AD8, 80 bytes long.
Data: < j j j > D8 6A D5 00 D8 6A D5 00 D8 6A D5 00 CD CD CD CD
{128} normal block at 0x00D56A68, 52 bytes long.
Data: <hj hj hj > 68 6A D5 00 68 6A D5 00 68 6A D5 00 CD CD CD CD
{127} normal block at 0x00D569F8, 52 bytes long.
Data: < i i i > F8 69 D5 00 F8 69 D5 00 F8 69 D5 00 CD CD CD CD
{126} normal block at 0x00D56970, 72 bytes long.
Data: <pi pi pi > 70 69 D5 00 70 69 D5 00 70 69 D5 00 CD CD CD CD
Object dump complete.

Discussion

  • Sean Chen

    Sean Chen - 2009-11-27

    my test code

     
  • Sean Chen

    Sean Chen - 2009-12-01
    • assigned_to: nobody --> ddiego
     
  • Sean Chen

    Sean Chen - 2009-12-01

    Ddiego, could you help me to solve it? thanks!

    I have tested, it seems to be a bug of String shared memory.

     

Log in to post a comment.