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 638810 - Crash in camel_folder_search_set_folder with IMAP account
Crash in camel_folder_search_set_folder with IMAP account
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.2.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 661456 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-01-06 10:51 UTC by Milan Crha
Modified: 2013-05-08 22:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
search-folder screenshot (33.73 KB, image/png)
2012-01-05 13:07 UTC, Damien Gombault
  Details
imap-account screenshot (40.64 KB, image/png)
2012-01-05 13:07 UTC, Damien Gombault
  Details
eds patch (4.45 KB, patch)
2012-01-06 17:50 UTC, Milan Crha
committed Details | Review
evo patch (1.83 KB, patch)
2012-01-06 17:51 UTC, Milan Crha
committed Details | Review

Description Milan Crha 2011-01-06 10:51:53 UTC
Moving this from a downstream bug report:
https://bugzilla.redhat.com/show_bug.cgi?id=665741

abrt version: 1.1.14
architecture: i686
Attached file: backtrace
cmdline: evolution
component: evolution
crash_function: camel_folder_search_set_folder
executable: /usr/bin/evolution
kernel: 2.6.35.10-72.fc14.i686.PAE
package: evolution-2.32.1-1.fc14
rating: 4
reason: Process /usr/bin/evolution was killed by signal 11 (SIGSEGV)
release: Fedora release 14 (Laughlin)
How to reproduce: It was startup . Unfortunately, I've not the slightest clue.
. I submit because I hope to reproduce with more info.

------------------------------------------------------------------------------

Package: evolution-2.32.1-1.fc14
Architecture: x86_64
OS Release: Fedora release 14 (Laughlin)


How to reproduce
-----
1. Restart computer
2. Launch Evolution


Comment
-----
I lauch Evolution and the UI appears for a couple of seconds and then goes away
with this crash.

This issue appears to happen the first time Evolution starts and on occasions
after the first start. It does not appear to be consistent.

Core was generated by `evolution'.
Program terminated with signal 11, Segmentation fault.

Thread 14 (Thread 7173)

  • #0 type_get_qdata_L
    at gtype.c line 3604
  • #1 type_check_is_value_type_U
    at gtype.c line 4082
  • #2 g_type_check_value
    at gtype.c line 4115
  • #3 g_value_transform
    at gvalue.c line 530
  • #4 object_set_property
    at gobject.c line 1156
  • #5 g_object_constructor
    at gobject.c line 1611
  • #6 g_object_newv
    at gobject.c line 1462
  • #7 g_object_new_valist
    at gobject.c line 1578
  • #8 g_object_new
    at gobject.c line 1296
  • #9 g_file_icon_new
    at gfileicon.c line 168
  • #10 icon_info_ensure_scale_and_pixbuf
    at gtkicontheme.c line 2883
  • #11 IA__gtk_icon_info_load_icon
    at gtkicontheme.c line 3066
  • #12 gtk_cell_renderer_pixbuf_create_themed_pixbuf
    at gtkcellrendererpixbuf.c line 537
  • #13 gtk_cell_renderer_pixbuf_get_size
    at gtkcellrendererpixbuf.c line 615
  • #14 IA__gtk_cell_renderer_get_size
    at gtkcellrenderer.c line 522
  • #15 IA__gtk_tree_view_column_cell_get_size
    at gtktreeviewcolumn.c line 2645
  • #16 validate_row
    at gtktreeview.c line 5779
  • #17 validate_visible_area
    at gtktreeview.c line 6100
  • #18 do_presize_handler
    at gtktreeview.c line 6426
  • #19 presize_handler_callback
    at gtktreeview.c line 6448
  • #20 gdk_threads_dispatch
    at gdk.c line 512
  • #21 g_idle_dispatch
    at gmain.c line 4254
  • #22 g_main_dispatch
    at gmain.c line 2149
  • #23 g_main_context_dispatch
    at gmain.c line 2702
  • #24 g_main_context_iterate
    at gmain.c line 2780
  • #25 g_main_loop_run
    at gmain.c line 2988
  • #26 IA__gtk_main
    at gtkmain.c line 1237
  • #27 main
    at main.c line 679

Thread 1 (Thread 7208)

  • #0 camel_folder_search_set_folder
    at camel-folder-search.c line 268
  • #1 imap_search_by_expression
  • #2 camel_folder_search_by_expression
  • #3 vee_folder_rebuild_folder
    at camel-vee-folder.c line 1676
  • #4 vee_folder_add_folder
    at camel-vee-folder.c line 1458
  • #5 camel_vee_folder_add_folder
    at camel-vee-folder.c line 2123
  • #6 vfolder_adduri_exec
    at mail-vfolder.c line 265
  • #7 mail_msg_proxy
    at mail-mt.c line 469
  • #8 g_thread_pool_thread_proxy
    at gthreadpool.c line 319
  • #9 g_thread_create_proxy
    at gthread.c line 1897
  • #10 start_thread
    from /lib/libpthread.so.0
  • #11 clone
    from /lib/libc.so.6

Comment 1 Milan Crha 2012-01-04 16:57:57 UTC
*** Bug 661456 has been marked as a duplicate of this bug. ***
Comment 2 Milan Crha 2012-01-04 17:01:03 UTC
As I noted in bug #661456, one thread is freeing a folder, while another is still using it. That may happen when folder's initial search takes longer than the vFolder "expects". I'll check the code and update the bug with my findings.
Comment 3 Milan Crha 2012-01-04 19:17:02 UTC
I would like to ask for more information. It seems to me that it's not exactly what I thought in comment #2. The folder is reffed properly, on the first look. What I see from the backtrace is that the folder it crashes on is a real trash folder (in Edit->Preferences->Mail Accounts-><IMAP account>->Defaults tab is checked to use Real Trash folder). But apart of that I do not see things I would like to know.

Could anyone of you answer these questions, please?

a) am I right with the real trash folder?
b) is also junk folder being set as a real folder?
c) how is setup the search folder? (any search folder involving IMAP account)
d) in Edit->Preferences->Mail preferences-> tab General, section "Start up",
   what options are checked there?

I would like to get as close to your setup as possible, to be able to reproduce it here. Thanks in advance.
Comment 4 Damien Gombault 2012-01-05 13:06:53 UTC
I tried to reproduce the bug again (I do not use search folders anymore).

I have created a new search folder (search-folder.png screenshot) with one condition : State is not read.

My IMAP account is configured with custom IMAP folder for trash and junk (imap-account.png screenshot).

I mark some emails as not read.
I select my new search folder then close Evolution.

I open Evolution and sometimes I get a crash (~1/5 run) in camel_folder_search_set_folder.
Comment 5 Damien Gombault 2012-01-05 13:07:31 UTC
Created attachment 204684 [details]
search-folder screenshot
Comment 6 Damien Gombault 2012-01-05 13:07:47 UTC
Created attachment 204685 [details]
imap-account screenshot
Comment 7 larryoleary 2012-01-05 17:36:02 UTC
(In reply to comment #3)
> ...
> Could anyone of you answer these questions, please?
> 
> a) am I right with the real trash folder?
Yes. This is true for multiple IMAP accounts.
> b) is also junk folder being set as a real folder?
Yes. This is true for multiple IMAP accounts.
> c) how is setup the search folder? (any search folder involving IMAP account)
Yes. I have a search folder for Unread messages in any account which includes multiple IMAP accounts. I also have a search folder for To Do messages which are messages from any account that are labeled with ToDo.
> d) in Edit->Preferences->Mail preferences-> tab General, section "Start up",
>    what options are checked there?
Well, I am using 2.32.3 but I do not see a Start up section. But, what I have:

Message Display:
   Mark messages as read after 1.5 seconds = TRUE
   Do not display messages when text size exceeds 4096 KB = TRUE
   Shrink To / CC / Bcc headers to 5 addresses = TRUE
   Enable Magic Spacebar = TRUE
   Enable Search Folder = TRUE

Delete Mail:
   Confirm when expunging a folder = TRUE
Comment 8 Milan Crha 2012-01-06 17:46:02 UTC
Thank you both for an update. I was finally able to reproduce this, though only when cheating the code. I added g_usleep (2000000); into imap_folder_finalize(), just below the call to camel_offline_journal_write(). Then I can reproduce this pretty consistently.

I filled an enhancement request against GLib in bug #667424, to provide better mechanisms than I'll use here, and if they approve, then this can be changed in a development version of evolution. See that bug for a little explanation what is going on here.
Comment 9 Milan Crha 2012-01-06 17:50:12 UTC
Created attachment 204760 [details] [review]
eds patch

for evolution-data-server;

This is a change in the first cache of folders, to remove the disposing object just before its dispose method is invoked. It doesn't work fully, a change in evolution is needed too. I added also some sanitizing code to CamelFolderSearch, thus it will not crash any more, but will claim on a console instead.
Comment 10 Milan Crha 2012-01-06 17:51:53 UTC
Created attachment 204761 [details] [review]
evo patch

for evolution;

Evolution part, which uses another cache (mail-folder-cache), where cannot be used the toggle_ref. That's a reason of the GLib enhancement bug. This change is just a workaround for now.
Comment 11 Milan Crha 2012-01-06 18:02:52 UTC
Created commit 3ee0ee8 in eds master (3.3.4+)
Created commit 02bcba4 in evo master (3.3.4+)

Created commit f7d9eda in eds gnome-3-2 (3.2.3+)
Created commit a0c7def in evo gnome-3-2 (3.2.3+)
Comment 12 David Woodhouse 2013-05-08 22:37:52 UTC
This appears to be broken too, unfortunately — the toggle_ref support isn't thread-safe. See bug 699909.