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 561069 - crash in Evolution Mail and Calendar: Expunging 48k deleted ju...
crash in Evolution Mail and Calendar: Expunging 48k deleted ju...
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: BugBuddyBugs
2.24.x (obsolete)
Other All
: High critical
: ---
Assigned To: Evolution Triage Team
Evolution QA team
: 544438 554689 561082 561507 562090 (view as bug list)
Depends on:
Blocks: 543389
 
 
Reported: 2008-11-16 16:09 UTC by Daniel Gryniewicz
Modified: 2009-02-18 19:26 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Proposed patch (606 bytes, patch)
2008-11-18 03:27 UTC, Srinivasa Ragavan
committed Details | Review

Description Daniel Gryniewicz 2008-11-16 16:09:47 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);

Thread 2 (Thread 0x43868950 (LWP 4866))

  • #0 __lll_lock_wait
    from /lib/libpthread.so.0
  • #1 _L_lock_102
    from /lib/libpthread.so.0
  • #2 __pthread_mutex_lock
    at pthread_mutex_lock.c line 86
  • #3 <signal handler called>
  • #4 imap_expunge_uids_online
    at camel-imap-folder.c line 1523
  • #5 imap_expunge
    at camel-imap-folder.c line 1592
  • #6 imap_sync
    at camel-imap-folder.c line 1433
  • #7 camel_folder_sync
    at camel-folder.c line 303
  • #8 vee_sync
    at camel-vee-folder.c line 582
  • #9 camel_folder_expunge
    at camel-folder.c line 591
  • #10 mail_msg_proxy
    at mail-mt.c line 520
  • #11 g_thread_pool_thread_proxy
    at gthreadpool.c line 265
  • #12 g_thread_create_proxy
    at gthread.c line 635
  • #13 start_thread
    at pthread_create.c line 297
  • #14 clone
    from /lib/libc.so.6
  • #15 ??


----------- .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...
--------------------------------------------------
Comment 1 Akhil Laddha 2008-11-17 04:05:52 UTC
*** Bug 561082 has been marked as a duplicate of this bug. ***
Comment 2 Srinivasa Ragavan 2008-11-17 05:09:49 UTC
Crash is due to this..
  • #3 <signal handler called>
  • #4 imap_expunge_uids_online
    at camel-imap-folder.c line 1523
  • #5 imap_expunge
    at camel-imap-folder.c line 1592
  • #6 imap_sync
    at camel-imap-folder.c line 1433
  • #7 camel_folder_

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);
}
Comment 3 C de-Avillez 2008-11-17 12:55:45 UTC
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.)
Comment 4 Srinivasa Ragavan 2008-11-18 03:25:31 UTC
If the folder wan't even visited once or if the folder is empty, it wont have a table for it.
Comment 5 Srinivasa Ragavan 2008-11-18 03:27:14 UTC
Created attachment 122909 [details] [review]
Proposed patch

This must fix this.
Comment 6 C de-Avillez 2008-11-18 04:25:09 UTC
Confirmed on trunk.

IN my case the folder is a IMAP high-level folder, with only sub-folders under it.
Comment 7 Daniel Gryniewicz 2008-11-18 16:19:34 UTC
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.
Comment 8 Srinivasa Ragavan 2008-11-19 05:35:52 UTC
Even if there was nothing to expunge, it can crash.
Comment 9 Srinivasa Ragavan 2008-11-19 05:37:13 UTC
Committed to stable/trunk
Comment 10 Srinivasa Ragavan 2008-11-19 05:38:02 UTC
*** Bug 544438 has been marked as a duplicate of this bug. ***
Comment 11 Kandepu Prasad 2008-11-24 10:43:08 UTC
*** Bug 561507 has been marked as a duplicate of this bug. ***
Comment 12 Kandepu Prasad 2008-11-24 10:43:28 UTC
*** Bug 562090 has been marked as a duplicate of this bug. ***
Comment 13 Milan Crha 2009-02-18 19:26:23 UTC
*** Bug 554689 has been marked as a duplicate of this bug. ***