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 543943 - Evolution failed to allocate memory
Evolution failed to allocate memory
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.24.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[disk-summary]
Depends on:
Blocks: 543389
 
 
Reported: 2008-07-21 04:44 UTC by Akhil Laddha
Modified: 2013-09-13 01:01 UTC
See Also:
GNOME target: ---
GNOME version: 2.21/2.22


Attachments
Valgrind of evolution process (16.97 KB, text/plain)
2008-07-21 04:44 UTC, Akhil Laddha
  Details
proposed eds patch (11.97 KB, patch)
2008-07-22 16:00 UTC, Milan Crha
committed Details | Review
proposed evo patch (2.00 KB, patch)
2008-07-22 16:03 UTC, Milan Crha
committed Details | Review
Valgrind of evolution process (161.30 KB, text/plain)
2008-07-24 03:40 UTC, Akhil Laddha
  Details

Description Akhil Laddha 2008-07-21 04:44:20 UTC
Evolution 2.23.5

I left evolution running on friday. When i checked today morning,
evolution was closed due to unavailability of memory. I had pop, imap
and group wise all there accounts configured. See the attached valgrind. 

These were the error messages on terminal  


(evolution:23931): camel-local-provider-WARNING **: Could not save
summary for local providers
Error in SQL SELECT statement: SELECT COUNT (*) FROM 'Mailbox' WHERE
deleted = 1 [out of memory]
Error in SQL SELECT statement: SELECT COUNT (*) FROM 'Mailbox' WHERE
read = 0 [out of memory]

(process:23931): GLib-ERROR (recursed) **: gmem.c:175: failed to
allocate 32 bytes
aborting...
Comment 1 Akhil Laddha 2008-07-21 04:44:48 UTC
Created attachment 114899 [details]
Valgrind of evolution process
Comment 2 Milan Crha 2008-07-22 14:34:14 UTC
It seems the db-summary leaks like a hell :) I'll attach patch for eds and evo to let it leak a bit less. Hopefully in an hour or so.
Comment 3 Milan Crha 2008-07-22 16:00:02 UTC
Created attachment 115024 [details] [review]
proposed eds patch

for evolution-data-server;

The eds part. Please notice my change in chunk
@@ -608,7 +608,11 @@ summary_header_from_db (CamelFolderSumma
other changes are quite boring.
Comment 4 Milan Crha 2008-07-22 16:03:04 UTC
Created attachment 115025 [details] [review]
proposed evo patch

for evolution;

A little evo's part here.
Comment 5 Milan Crha 2008-07-22 16:04:56 UTC
The eds part contains patch for leaks I faced and I think are most common. It will still leak somewhere else probably, but not so much. If accepted, I think we can close this bug (maybe rather after a weekend Akhil's test).
Comment 6 Akhil Laddha 2008-07-23 04:59:47 UTC
I just noticed some invalid reads. I am putting all together here so that we don't end up filing separate bugs.



==17145== 
==17145== Thread 1:
==17145== Invalid read of size 1
==17145==    at 0x4025A70: memcpy (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x5A0522D: g_strdup (gstrfuncs.c:93)
==17145==    by 0x6B66F08: emfv_list_message_selected (em-folder-view.c:2628)
==17145==    by 0x6B54F14: emfb_gui_folder_changed (em-folder-browser.c:1880)
==17145==    by 0x6B9B2C2: do_async_event (mail-mt.c:684)
==17145==    by 0x6B9D271: mail_msg_idle_cb (mail-mt.c:494)
==17145==    by 0x59E2230: g_idle_dispatch (gmain.c:4173)
==17145==    by 0x59E4177: g_main_context_dispatch (gmain.c:2068)
==17145==    by 0x59E7812: g_main_context_iterate (gmain.c:2701)
==17145==    by 0x59E7D31: g_main_loop_run (gmain.c:2924)
==17145==    by 0x4E7E0A2: bonobo_main (bonobo-main.c:311)
==17145==    by 0x805DBE4: main (main.c:783)
==17145==  Address 0xb9f79a8 is 0 bytes inside a block of size 3 free'd
==17145==    at 0x4023B7A: free (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x59EC6A5: g_free (gmem.c:190)
==17145==    by 0x6B51AD2: emfb_list_message_selected (em-folder-browser.c:1364)
==17145==    by 0x597D309: g_cclosure_marshal_VOID__STRING (gmarshal.c:496)
==17145==    by 0x596EC2A: g_closure_invoke (gclosure.c:767)
==17145==    by 0x5986434: signal_emit_unlocked_R (gsignal.c:3244)
==17145==    by 0x5987B4D: g_signal_emit_valist (gsignal.c:2977)
==17145==    by 0x5987FD5: g_signal_emit (gsignal.c:3034)
==17145==    by 0x6BAF53A: message_list_select_uid (message-list.c:660)
==17145==    by 0x6B681F3: emfv_set_message (em-folder-view.c:798)
==17145==    by 0x6B54F14: emfb_gui_folder_changed (em-folder-browser.c:1880)
==17145==    by 0x6B9B2C2: do_async_event (mail-mt.c:684)
==17145== 
Comment 7 Akhil Laddha 2008-07-23 05:00:50 UTC
==17145== 
==17145== Invalid read of size 1
==17145==    at 0x4025473: strlen (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x7F4022B: groupwise_folder_item_to_msg (camel-groupwise-folder.c:283)
==17145==    by 0x7F425B4: gw_update_cache (camel-groupwise-folder.c:1438)
==17145==    by 0x7F432C0: update_update (camel-groupwise-folder.c:2001)
==17145==    by 0x42A42B1: session_thread_proxy (camel-session.c:592)
==17145==    by 0x5A0FE35: g_thread_pool_thread_proxy (gthreadpool.c:265)
==17145==    by 0x5A0E79E: g_thread_create_proxy (gthread.c:635)
==17145==    by 0x4F94174: start_thread (in /lib/libpthread-2.8.so)
==17145==    by 0x5B4FDCD: clone (in /lib/libc-2.8.so)
==17145==  Address 0x7c5a3fc is 0 bytes after a block of size 36 alloc'd
==17145==    at 0x4022E12: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x59EC78B: g_malloc0 (gmem.c:151)
==17145==    by 0x59BF51D: g_base64_decode (gbase64.c:371)
==17145==    by 0x61B5CCB: e_gw_item_new_from_soap_parameter (e-gw-item.c:1955)
==17145==    by 0x61A7F5C: e_gw_connection_get_item (e-gw-connection.c:1440)
==17145==    by 0x7F42232: gw_update_cache (camel-groupwise-folder.c:1275)
==17145==    by 0x7F432C0: update_update (camel-groupwise-folder.c:2001)
==17145==    by 0x42A42B1: session_thread_proxy (camel-session.c:592)
==17145==    by 0x5A0FE35: g_thread_pool_thread_proxy (gthreadpool.c:265)
==17145==    by 0x5A0E79E: g_thread_create_proxy (gthread.c:635)
==17145==    by 0x4F94174: start_thread (in /lib/libpthread-2.8.so)
==17145==    by 0x5B4FDCD: clone (in /lib/libc-2.8.so)
==17145== 
==17145== Invalid read of size 1
==17145==    at 0x4025A70: memcpy (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x59BDA49: g_array_append_vals (garray.c:134)
==17145==    by 0x59BDAAF: g_byte_array_append (garray.c:653)
==17145==    by 0x438CE23: camel_stream_mem_new_with_buffer (camel-stream-mem.c:147)
==17145==    by 0x4376C98: camel_mime_part_set_content (camel-mime-part.c:1052)
==17145==    by 0x7F40242: groupwise_folder_item_to_msg (camel-groupwise-folder.c:283)
==17145==    by 0x7F425B4: gw_update_cache (camel-groupwise-folder.c:1438)
==17145==    by 0x7F432C0: update_update (camel-groupwise-folder.c:2001)
==17145==    by 0x42A42B1: session_thread_proxy (camel-session.c:592)
==17145==    by 0x5A0FE35: g_thread_pool_thread_proxy (gthreadpool.c:265)
==17145==    by 0x5A0E79E: g_thread_create_proxy (gthread.c:635)
==17145==    by 0x4F94174: start_thread (in /lib/libpthread-2.8.so)
==17145==  Address 0x7c5a3fc is 0 bytes after a block of size 36 alloc'd
==17145==    at 0x4022E12: calloc (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x59EC78B: g_malloc0 (gmem.c:151)
==17145==    by 0x59BF51D: g_base64_decode (gbase64.c:371)
==17145==    by 0x61B5CCB: e_gw_item_new_from_soap_parameter (e-gw-item.c:1955)
==17145==    by 0x61A7F5C: e_gw_connection_get_item (e-gw-connection.c:1440)
==17145==    by 0x7F42232: gw_update_cache (camel-groupwise-folder.c:1275)
==17145==    by 0x7F432C0: update_update (camel-groupwise-folder.c:2001)
==17145==    by 0x42A42B1: session_thread_proxy (camel-session.c:592)
==17145==    by 0x5A0FE35: g_thread_pool_thread_proxy (gthreadpool.c:265)
==17145==    by 0x5A0E79E: g_thread_create_proxy (gthread.c:635)
==17145==    by 0x4F94174: start_thread (in /lib/libpthread-2.8.so)
==17145==    by 0x5B4FDCD: clone (in /lib/libc-2.8.so)
Comment 8 Akhil Laddha 2008-07-23 05:01:46 UTC
==17145== Invalid read of size 1
==17145==    at 0x5A07617: g_str_hash (gstring.c:95)
==17145==    by 0x59D6B36: g_hash_table_lookup (ghash.c:118)
==17145==    by 0x42B3B8A: message_info_from_uid (camel-vee-summary.c:174)
==17145==    by 0x4287E7F: camel_folder_summary_uid (camel-folder-summary.c:545)
==17145==    by 0x4287EE4: camel_folder_summary_index (camel-folder-summary.c:393)
==17145==    by 0x42B5621: vtrash_getv (camel-vtrash-folder.c:145)
==17145==    by 0x4386289: camel_object_get (camel-object.c:1589)
==17145==    by 0x4292728: camel_folder_get_unread_message_count (camel-folder.c:660)
==17145==    by 0x6B9A0B4: update_1folder (mail-folder-cache.c:319)
==17145==    by 0x6B9A27E: folder_changed (mail-folder-cache.c:434)
==17145==    by 0x43872BF: camel_object_trigger_event (camel-object.c:1495)
==17145==    by 0x42B47FC: vtrash_folder_changed (camel-vtrash-folder.c:506)
==17145==  Address 0x6212638 is 0 bytes inside a block of size 13 free'd
==17145==    at 0x4023B7A: free (in /usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==17145==    by 0x59EC6A5: g_free (gmem.c:190)
==17145==    by 0x42B4234: vee_message_info_free (camel-vee-summary.c:47)
==17145==    by 0x4288284: camel_message_info_free (camel-folder-summary.c:4044)
==17145==    by 0x42B4539: vtrash_uid_removed (camel-vtrash-folder.c:425)
==17145==    by 0x42B46CF: vtrash_folder_changed (camel-vtrash-folder.c:477)
==17145==    by 0x42AE821: folder_changed (camel-vee-folder.c:1584)
==17145==    by 0x43872BF: camel_object_trigger_event (camel-object.c:1495)
==17145==    by 0x7F59B56: imap_rescan (camel-imap-folder.c:977)
==17145==    by 0x7F5D5D9: imap_refresh_info (camel-imap-folder.c:724)
==17145==    by 0x427EBB5: disco_refresh_info (camel-disco-folder.c:269)
==17145==    by 0x4292A58: camel_folder_refresh_info (camel-folder.c:336)
==17145== 
Comment 9 Srinivasa Ragavan 2008-07-23 11:04:55 UTC
commit it milan
Comment 10 Milan Crha 2008-07-23 14:55:06 UTC
eds part committed to trunk. Committed revision 9171.
evo part committed to trunk. Committed revision 35826.

I'm keeping this opened, because of the above invalid reads.
Comment 11 Akhil Laddha 2008-07-24 03:40:08 UTC
Created attachment 115143 [details]
Valgrind of evolution process

Yesterday i applied both the memory leak fixes (evolution and eds) provided by Milan. I did run evolution for almost 24 hrs. Attached file has valgrind traces. Hope it will help in identifying some more leaks.
Comment 12 Srinivasa Ragavan 2008-07-24 20:12:11 UTC
Nothing much reflects in the db summary code. sqlite3 leaks. I have disabled sqlite free mem.
Comment 13 Milan Crha 2008-07-25 06:30:03 UTC
(In reply to comment #12)
> Nothing much reflects in the db summary code. sqlite3 leaks. I have disabled
> sqlite free mem.

Did you revert those patches? If not, then why did you change their status from "committed" to "none"?
Comment 14 Srinivasa Ragavan 2008-07-27 18:17:28 UTC
Oops I didn't intend to it. FF refresh :(
Comment 15 Srinivasa Ragavan 2008-08-18 09:32:09 UTC
Worth keeping this open?
Comment 16 Milan Crha 2008-08-18 09:37:37 UTC
It depends on the actual state of this:

(In reply to comment #12)
> Nothing much reflects in the db summary code. sqlite3 leaks. I have disabled
> sqlite free mem.
Comment 17 Srinivasa Ragavan 2008-08-18 10:49:32 UTC
Its all enabled from 2.23.6 (iirc)
Comment 18 Milan Crha 2008-08-18 11:14:48 UTC
In that case sure, closing as fixed.