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 545505 - Properly free unused message infos periodically
Properly free unused message infos periodically
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.28.x (obsolete)
Other Linux
: High critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
evolution[disk-summary] evolution[gno...
: 546388 604646 616513 629804 (view as bug list)
Depends on:
Blocks: 543389
 
 
Reported: 2008-07-30 12:48 UTC by Milan Crha
Modified: 2011-04-20 12:24 UTC
See Also:
GNOME target: ---
GNOME version: 2.27/2.28


Attachments
proposed eds patch (27.45 KB, patch)
2010-04-14 19:12 UTC, Milan Crha
none Details | Review
proposed evo patch (6.65 KB, patch)
2010-04-14 19:14 UTC, Milan Crha
committed Details | Review
proposed eex patch (1.02 KB, patch)
2010-04-14 19:15 UTC, Milan Crha
committed Details | Review
proposed eds patch ][ (28.68 KB, patch)
2010-04-16 07:20 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2008-07-30 12:48:28 UTC
I was just hanging in the browser and this was running on the background. I have some exchange, imap, maildir and pop3 accounts enabled.

Distribution: Fedora release 9 (Sulphur)
Gnome Release: 2.22.2 2008-05-28 (Red Hat, Inc)
BugBuddy Version: 2.22.0

System: Linux 2.6.25.6-55.fc9.x86_64 #1 SMP Tue Jun 10 16:05:21 EDT 2008 x86_64
X Vendor: The X.Org Foundation
X Vendor Release: 10499902
Selinux: Permissive
Accessibility: Disabled
GTK+ Theme: Nodoka
Icon Theme: Neu

Memory status: size: 704634880 vsize: 704634880 resident: 146731008 share: 21798912 rss: 146731008 rss_rlim: 18446744073709551615
CPU usage: start_time: 1217421340 rtime: 1768 utime: 1342 stime: 426 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/build/local/bin/evolution'

[?1034h[Thread debugging using libthread_db enabled]
[New Thread 0x7fbad9a7b7f0 (LWP 13577)]
[New Thread 0x44c1e950 (LWP 13597)]
[New Thread 0x437db950 (LWP 13596)]
[New Thread 0x441dc950 (LWP 13595)]
0x00000039a8c0e86f in __libc_waitpid (pid=<value optimized out>, stat_loc=<value optimized out>, options=<value optimized out>)
    at ../sysdeps/unix/sysv/linux/waitpid.c:41
41	  int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);


----------- .xsession-errors (2336 sec old) ---------------------
<memory>:1: Invalid color constant '(null)'
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkHTML::spell-error-color' of type `GdkColor' from rc file value ""(null)"" of type `gchararray'
<memory>:1: Invalid color constant '(null)'
Gtk-Message: (for origin information, set GTK_DEBUG): failed to retrieve property `GtkHTML::spell-error-color' of type `GdkColor' from rc file value ""(null)"" of type `gchararray'
(SciTE:23102): GLib-GObject-WARNING **: IA__g_object_new_valist: object class `GThemedIcon' has no property named `names'
(SciTE:23102): GLib-GIO-CRITICAL **: g_themed_icon_constructed: assertion `themed->names != NULL && themed->names[0] != NULL' failed
(SciTE:23102): GLib-CRITICAL **: g_strv_length: assertion `str_array != NULL' failed
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x400001e (Archive Ma)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Window manager warning: Buggy client sent a _NET_ACTIVE_WINDOW message with a timestamp of 0 for 0x4a00003 (Evince Doc)
Window manager warning: meta_window_activate called by a pager with a 0 timestamp; the pager needs to be fixed.
Window manager warning: Invalid WM_TRANSIENT_FOR window 0x4001201 specified for 0x4002395 (Delete acc).
--------------------------------------------------
Comment 1 Srinivasa Ragavan 2008-07-30 15:41:51 UTC
I pick session from summary. SOmething on the way seems to be NULL.

	CamelSession *session = ((CamelService *)((CamelFolder *)s->folder)->parent_store)->session;

Next time, you see it, can you print all values ?
Comment 2 Srinivasa Ragavan 2008-08-05 05:28:10 UTC
Anytime you got it recently ?
Comment 3 Milan Crha 2008-08-05 07:46:15 UTC
Yes, I got it last week, but the bugboddy doesn't allow me to print the values you requested, thus I run now with a patched version, which prints these values, even no luck in crashing again.
Comment 4 Srinivasa Ragavan 2008-08-05 16:23:07 UTC
*** Bug 546388 has been marked as a duplicate of this bug. ***
Comment 5 Srinivasa Ragavan 2008-08-05 16:32:18 UTC
Thx Plaes. Fixed it in trunk.
Comment 6 Milan Crha 2009-11-30 12:39:02 UTC
This doesn't seem to be fixed, as I just got a bug report about the same in 2.28.
https://bugzilla.redhat.com/show_bug.cgi?id=541763

Thus I'm reopening it.
Comment 7 Miguel Angel Ruiz Manzano 2009-11-30 21:06:51 UTC
Hi, 

This bug is related to a crash. Its severity must be CRITICAL.

Cheers!
Comment 8 Akhil Laddha 2009-12-16 04:16:49 UTC
bug 604646 looks duplicate
Comment 9 Milan Crha 2009-12-16 11:06:38 UTC
*** Bug 604646 has been marked as a duplicate of this bug. ***
Comment 10 Milan Crha 2010-01-05 18:17:02 UTC
Downstream bug report about the same in 2.28.0:
https://bugzilla.redhat.com/show_bug.cgi?id=545853
Comment 11 Akhil Laddha 2010-01-18 05:21:43 UTC
I got a similar crash in 2.28.2 while changing signature from html to plain text.
Comment 12 Akhil Laddha 2010-01-27 05:17:55 UTC
Evolution crashed again with similar traces after adding a new search folder and it was looking to fetch correspondent mails.
Comment 13 Milan Crha 2010-03-25 18:08:04 UTC
I didn't see this myself for quite a long time, the last time I was notified on this by Chen was with some issue in IMAPX provider with UID handling, which got sorted out. With that we had some thoughts about this, which I already forgot, unfortunately, but I think they were correct. Thus I'm confirming the bug for further investigation. (I think the clear on timeout doesn't work for some cases, some folders didn't have the timeouter invoked at all and similar - these all and other basic usages need a code review on this). Would be nice to have this sorted out during 2.31 development cycle.
Comment 14 Milan Crha 2010-04-14 19:12:39 UTC
Created attachment 158746 [details] [review]
proposed eds patch

for evolution-data-server;

I'm changing here the camel-folder-summary API functions a bit, together with other fixes making the "free CamelMessageInfo when unused" actually work:
a) I removed redundant function camel_folder_summary_reload_from_db and
   camel_folder_summary_ensure_infos_loaded and replaced them with one
   camel_folder_summary_prepare_fetch_all. It's better, because no such magic
   numbers and code to test whether reload from DB or not on various places
b) I removed also camel_folder_summary_cache_size, it's not needed anymore
c) whenever is loaded a message info from DB, then the release timer is set
   (it wasn't set before). Also the live time is moved on a load, to ensure
   just added message info will not be removed in the next second.
d) I changed CamelFolderSummary locks to recursive locks, it's better to not
   release a 'summary_lock' in the middle of message info reading from DB.
e) Then I added on couple places call of camel_folder_summary_prepare_fetch_all
f) and fixed some refcount issues on CamelMessageInfo-s I noticed while
   testing this
g) together with NNTP fix to unset CAMEL_MESSAGE_FOLDER_FLAGGED on its infos
   before storing to the summary, because it was never freed from a memory
   because of this flag.
Comment 15 Milan Crha 2010-04-14 19:14:47 UTC
Created attachment 158747 [details] [review]
proposed evo patch

for evolution;

Applying API changes from the eds.patch, and more refcount "leaks" on CamelMessageInfo, together with using proper function for info free, as documented on camel (note the result is quite the same, but we should be consistent, shouldn't we?).
Comment 16 Milan Crha 2010-04-14 19:15:41 UTC
Created attachment 158748 [details] [review]
proposed eex patch

for evolution-exchange;

Just an API change from eds.patch.
Comment 17 Milan Crha 2010-04-14 19:20:32 UTC
My tests showed it's working as expected, aka loaded infos which are not used more than (up to 2*) SUMMARY_CACHE_DROP seconds are dropped from memory and reloaded on demand. I would appreciate any testing from anyone, as I didn't notice any crash like above, but my use case is too simple for a real testing. 

There is one little issue with the Templates plugin, as it reloads message infos for Templates folder whenever one selects a message (on actions update). There can be done some re-think for the plugin, but possibly not necessary, as the release time is set for 5 minutes at the moment. I'm only mentioning it here, as I noticed it while testing.
Comment 18 Milan Crha 2010-04-16 07:20:30 UTC
Created attachment 158872 [details] [review]
proposed eds patch ][

for evolution-data-server;

Updated previous patch to be applicable after yesterday's changes in camel.
Comment 19 Akhil Laddha 2010-04-23 03:39:52 UTC
*** Bug 616513 has been marked as a duplicate of this bug. ***
Comment 20 Chenthill P 2010-04-29 11:50:34 UTC
There are a couple of things,
it would be good not to expose camel_folder_summary_prepare_fetch_all and handle stuffs internally. If its not possible and is really required, it would be good to document the cases in which it should be used.

double_ref variable is unused at the moment with the change if I understand correctly,
-		data.double_ref = TRUE;
+		data.double_ref = FALSE;
if its unused, better to remove it from code.

A welcome change to convert the mutexes to recurrent one. Nice fix on using folder_message_info_free at relevant places, would definetly fix some hidden bugs.

Please make these changes and commit the patch. Am yet to test the patch. will get the master code running and test it out once its committed. Have been working with stable branch due to downstream work.
Comment 21 Milan Crha 2010-04-29 14:34:10 UTC
Created commit b0b52e4 in eds master (2.31.1+)
Created commit ad1b375 in evo master (2.31.1+)
Created commit 454c75f in eex master (2.31.1+)

I also removed the camel_folder_sync call in the remove_cache function, as we spoke about it on IRC.
Comment 22 David Woodhouse 2010-06-26 15:45:12 UTC
Could this be the reason my nntp folders are all appearing to be empty?
Comment 23 Milan Crha 2010-06-28 09:57:43 UTC
(In reply to comment #22)
> Could this be the reason my nntp folders are all appearing to be empty?

I wouldn't expect that, this is done periodically, about every 5 minutes, but it is just about memory, not about local cache (unless it uncovered other bug). Please open a new bug report for your issue.
Comment 24 Akhil Laddha 2010-09-16 03:41:10 UTC
*** Bug 629804 has been marked as a duplicate of this bug. ***
Comment 25 Ross Burton 2011-04-20 12:13:51 UTC
I'm getting this crasher frequently, can this be backported to 2.32?
Comment 26 Milan Crha 2011-04-20 12:21:22 UTC
it should be there, based on comment #21, which says 2.31.1+
Comment 27 Ross Burton 2011-04-20 12:24:15 UTC
Hmm, I'm still seeing crashes.  Maybe this isn't the same as #634285 after all.