After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 702035 - EWS folder rec_mutex leak
EWS folder rec_mutex leak
Status: RESOLVED FIXED
Product: evolution-ews
Classification: Other
Component: Mail
3.8.x
Other Linux
: Normal normal
: ---
Assigned To: Evolution EWS maintainer(s)
Evolution EWS maintainer(s)
Depends on:
Blocks: 627707
 
 
Reported: 2013-06-11 16:26 UTC by David Woodhouse
Modified: 2013-07-15 16:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bug #702035 - EWS folder rec_mutex leak? (870 bytes, patch)
2013-07-12 13:18 UTC, Fabiano Fidêncio
reviewed Details | Review
Bug #702035 - EWS folder rec_mutex leak? (1.96 KB, patch)
2013-07-15 08:16 UTC, Fabiano Fidêncio
committed Details | Review

Description David Woodhouse 2013-06-11 16:26:00 UTC
==18892== 90,640 bytes in 2,266 blocks are definitely lost in loss record 44,331 of 44,487
==18892==    at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==18892==    by 0x376804D93E: g_malloc (gmem.c:159)
==18892==    by 0x37680634ED: g_slice_alloc (gslice.c:1003)
==18892==    by 0x3768086F3F: g_rec_mutex_impl_new (gthread-posix.c:271)
==18892==    by 0x3768087388: g_rec_mutex_init (gthread-posix.c:339)
==18892==    by 0x15ADEBBF: camel_ews_folder_init (camel-ews-folder.c:1967)
==18892==    by 0x3CFCC2FA9B: g_type_create_instance (gtype.c:1917)
==18892==    by 0x3CFCC14597: g_object_constructor (gobject.c:1855)
==18892==    by 0x3CFCC15B18: g_object_newv (gobject.c:1719)
==18892==    by 0x3CFCC162E5: g_object_new_valist (gobject.c:1836)
==18892==    by 0x3CFCC16653: g_object_new (gobject.c:1551)
==18892==    by 0x15AE092A: camel_ews_folder_new (camel-ews-folder.c:1176)
==18892==
Comment 1 Fabiano Fidêncio 2013-07-12 13:18:50 UTC
Created attachment 249002 [details] [review]
Bug #702035 - EWS folder rec_mutex leak?

Fix leak in cache_lock rec_mutex and in state_lock mutex
Comment 2 Milan Crha 2013-07-15 06:51:46 UTC
Review of attachment 249002 [details] [review]:

::: src/camel/camel-ews-folder.c
@@ +1880,2 @@
 	g_hash_table_destroy (ews_folder->priv->uid_eflags);
 	g_cond_clear (&ews_folder->priv->fetch_cond);

Looks good, with one exception (not caused by you), please move these destructions into finalize, because the dispose can be called multiple times, which might cause use-after-free. As I said, it's not your fault, it was there before your change.
Comment 3 Fabiano Fidêncio 2013-07-15 08:16:14 UTC
Created attachment 249162 [details] [review]
Bug #702035 - EWS folder rec_mutex leak?

Fix leak in cache_lock rec_mutex and in state_lock mutex
Comment 4 Milan Crha 2013-07-15 12:39:15 UTC
Review of attachment 249162 [details] [review]:

Untested, but looks correct, please commit to master and stable. Thanks.