Re: [gmime-devel] Possible memory leakage in gmime
- From: Vsevolod Stakhov <vsevolod highsecure ru>
- To: Jeffrey Stedfast <fejj novell com>
- Cc: gmime-devel-list gnome org
- Subject: Re: [gmime-devel] Possible memory leakage in gmime
- Date: Thu, 26 Mar 2009 17:25:36 +0300
-----BEGIN PGP SIGNED MESSAGE-----
Jeffrey Stedfast wrote:
> Vsevolod Stakhov wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>> 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:
>> 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
==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
==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
-----END PGP SIGNATURE-----
] [Thread Prev