GNOME Bugzilla – Bug 561069
crash in Evolution Mail and Calendar: Expunging 48k deleted ju...
Last modified: 2009-02-18 19:26:23 UTC
What were you doing when the application crashed? Expunging 48k deleted junk messages Distribution: Gentoo Base System release 2.0.0 Gnome Release: 2.24.1 2008-10-23 (Gentoo) BugBuddy Version: 2.24.1 System: Linux 2.6.27-gentoo-r2 #1 SMP Fri Oct 31 12:37:01 EDT 2008 x86_64 X Vendor: The X.Org Foundation X Vendor Release: 10503000 Selinux: No Accessibility: Disabled GTK+ Theme: dang Icon Theme: Tango Memory status: size: 877375488 vsize: 877375488 resident: 248840192 share: 15347712 rss: 248840192 rss_rlim: 18446744073709551615 CPU usage: start_time: 1226635439 rtime: 80772 utime: 58778 stime: 21994 cutime:2788 cstime: 8181 timeout: 0 it_real_value: 0 frequency: 100 Backtrace was generated from '/usr/bin/evolution' [Thread debugging using libthread_db enabled] [New Thread 0x7f4ff093c750 (LWP 18214)] [New Thread 0x43868950 (LWP 4866)] [New Thread 0x4486a950 (LWP 4856)] [New Thread 0x43067950 (LWP 19591)] [New Thread 0x40ab9950 (LWP 18234)] 0x00007f4fed0a951f in __libc_waitpid (pid=4999, stat_loc=0x7ffff8985ba0, options=0) at ../sysdeps/unix/sysv/linux/waitpid.c:41 41 int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+ Trace 209879
Thread 2 (Thread 0x43868950 (LWP 4866))
----------- .xsession-errors (129132 sec old) --------------------- Loading stream: http://g-ecx.images-amazon.com/images/G/01/digital/music/swfs/AlbumSampler_2_CD._V4029368_.swf Loading stream: http://g-ecx.images-amazon.com/images/G/01/digital/music/swfs/AlbumSampler_2_CD._V4029368_.swf Loading stream: http://g-ecx.images-amazon.com/images/G/01/digital/music/swfs/AlbumSampler_2_CD._V4029368_.swf Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect (gnome-terminal:16786): Vte-WARNING **: No handler for control sequence `device-control-string' defined. Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect Window manager warning: Attempt to perform window operation 26 on window none when operation 26 on none already in effect ...Too much output, ignoring rest... --------------------------------------------------
*** Bug 561082 has been marked as a duplicate of this bug. ***
Crash is due to this..
+ Trace 209900
uids is NULL and qsort (uids->pdata, uids->len, sizeof (void *), uid_compar) crashes. But I don't understand how uids can be NULL. Below is the code. static void imap_expunge (CamelFolder *folder, CamelException *ex) { CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); GPtrArray *uids; int i, count; CamelMessageInfo *info; uids = g_ptr_array_new (); count = camel_folder_summary_count (folder->summary); for (i = 0; i < count; i++) { info = camel_folder_summary_index (folder->summary, i); if (camel_message_info_flags(info) & CAMEL_MESSAGE_DELETED) g_ptr_array_add (uids, g_strdup (camel_message_info_uid (info))); camel_message_info_free(info); } if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) imap_expunge_uids_online (folder, uids, ex); else imap_expunge_uids_offline (folder, uids, ex); for (i = 0; i < uids->len; i++) g_free (uids->pdata[i]); g_ptr_array_free (uids, TRUE); }
Hi srag, you imap_expunge code does not match what I have from SVN: static void imap_expunge (CamelFolder *folder, CamelException *ex) { CamelImapStore *store = CAMEL_IMAP_STORE (folder->parent_store); GPtrArray *uids; camel_folder_summary_save_to_db (folder->summary, ex); uids = camel_db_get_folder_deleted_uids (folder->parent_store->cdb_r, folder->full_name, ex); if (CAMEL_OFFLINE_STORE (store)->state == CAMEL_OFFLINE_STORE_NETWORK_AVAIL) imap_expunge_uids_online (folder, uids, ex); else imap_expunge_uids_offline (folder, uids, ex); g_ptr_array_foreach (uids, (GFunc) camel_pstring_free, NULL); g_ptr_array_free (uids, TRUE); } But... looking at the version on this bug, it makes a bit of a sense: this is not about SVN, but 2.24.1 (which sports the code you show). So I went into camel_db_get_folder_deleted_uids -- it pretty much runs a SQL query: camel_db_get_folder_deleted_uids (CamelDB *db, char *folder_name, CamelException *ex) { char *sel_query; int ret; GPtrArray *array = g_ptr_array_new(); sel_query = sqlite3_mprintf("SELECT uid FROM %Q where deleted=1", folder_name); ret = camel_db_select (db, sel_query, read_uids_callback, array, ex); sqlite3_free (sel_query); if (!array->len || ret != 0) { g_ptr_array_free (array, TRUE); array = NULL; } return array; } I then looked at my Evo log, and I see this at the end: camel_db_select: SELECT uid FROM 'BusinessRelated' where deleted=1 =========== DB SQL operation [SELECT uid FROM 'BusinessRelated' where deleted=1] started DB Operation ended. Time Taken : 0.000375 ########### (evolution:24370): camel-WARNING **: Error in select statement 'SELECT uid FROM 'BusinessRelated' where deleted=1' [no such table: BusinessRelated]. (By the way, the table *should* exist.)
If the folder wan't even visited once or if the folder is empty, it wont have a table for it.
Created attachment 122909 [details] [review] Proposed patch This must fix this.
Confirmed on trunk. IN my case the folder is a IMAP high-level folder, with only sub-folders under it.
Mine was a junk folder on an IMAP inbox. The inbox was not empty, but the junk folder was (had just been deleted). This is not easily reproducible, so I can't verify it works.
Even if there was nothing to expunge, it can crash.
Committed to stable/trunk
*** Bug 544438 has been marked as a duplicate of this bug. ***
*** Bug 561507 has been marked as a duplicate of this bug. ***
*** Bug 562090 has been marked as a duplicate of this bug. ***
*** Bug 554689 has been marked as a duplicate of this bug. ***