Re: [gmime-devel] Possible memory leakage in gmime



Vsevolod Stakhov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Jeffrey Stedfast wrote:
>   
>> Vsevolod Stakhov wrote:
>>     
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>> Hi,
>>>
>>> I'm using gmime (ver 2.2.21) for writing spam filter and found that I
>>> have strange memory issues with it. I wrote a simple test, that can be
>>> found here:
>>> http://cebka.pp.ru/stuff/test_gmime_mem.c
>>>
>>> In short words it process in infinite cycle messages from command line
>>> (using mmapped memory to repeat conditions in my filter). When I run
>>> this test it uses more and more memory (memory usage increasing rate is
>>> not very high but it is definitely exists).
>>>
>>>   
>>>       
>> Okay, I found the problem. In your test program, you make a call to
>> g_mime_part_get_content_object(). This returns a ref'd instance of a
>> GMimeDataWrapper which your test program isn't unref'ing.
>>
>> After the line "g_object_unref (part_stream);", add "g_object_unref
>> (wrapper);" and the leak should disappear.
>>     
>
> Indeed, just found it by myself. So I think it would be useful to note
> that object that is returned by
> g_mime_part_get_content_object () should be unref'ed after using.
> And are there any ideas about valgrind error?
>
> ==9214== Conditional jump or move depends on uninitialised value(s)
> ==9214==    at 0x411D82F: check_boundary (gmime-parser.c:1130)
> ==9214==    by 0x411DAD3: parser_scan_content (gmime-parser.c:1222)
> ==9214==    by 0x411DC8A: parser_scan_mime_part_content
> (gmime-parser.c:1284)
> ==9214==    by 0x411E1A9: parser_construct_leaf_part (gmime-parser.c:1388)
> ==9214==    by 0x411EB73: parser_construct_message (gmime-parser.c:1657)
> ==9214==    by 0x411EC4E: g_mime_parser_construct_message
> (gmime-parser.c:1683)
> ==9214==    by 0x80492B5: main (test_gmime_mem.c:110)
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAknLkGAACgkQ4Gg1vsCGe4vmDwCdGSv5uXgo8lqqHcMUKw3iHCvs
> pNYAoJnvgH5e+wuLgT+/58ABMf5FOJhv
> =PuR+
> -----END PGP SIGNATURE-----
>   

I don't get this error in 2.2.23 (which is what I have installed). Not
sure what it could be...

Jeff



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]