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 600013 - Crash in mail_reader_message_loaded_cb at e-mail-reader.c line 1778
Crash in mail_reader_message_loaded_cb at e-mail-reader.c line 1778
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
3.0.x (obsolete)
Other Linux
: Urgent critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 604896 611108 618902 633716 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-10-29 11:37 UTC by Akhil Laddha
Modified: 2013-09-13 01:10 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32


Attachments
proposed evo patch (1.84 KB, patch)
2010-01-11 12:56 UTC, Milan Crha
needs-work Details | Review
evo patch (644 bytes, patch)
2011-01-12 12:56 UTC, Milan Crha
committed Details | Review

Description Akhil Laddha 2009-10-29 11:37:46 UTC
Evolution 2.29.1 

I clicked on a folder, it started fetching new mails, i canceled the process from status bar when it reached about 55% then i clicked on a unread mail but it didn't show me any message body then i double clicked on folder, it started fetching again and evolution crashed in the middle. 

(evolution:4214): evolution-shell-CRITICAL **: e_shell_backend_get_shell: assertion `E_IS_SHELL_BACKEND (shell_backend)' failed

(evolution:4214): evolution-shell-CRITICAL **: e_shell_get_shell_settings: assertion `E_IS_SHELL (shell)' failed

Program received signal SIGSEGV, Segmentation fault.
0xb607a581 in mail_reader_message_loaded_cb (folder=0xa91a0198, 
    message_uid=0x8984078 "8685", message=0x8c379f0, user_data=0x815d2c0, 
    ex=0x8bce09c) at e-mail-reader.c:1778
1778		if (g_strcmp0 (message_list->cursor_uid, message_uid) != 0)
(gdb) t a a bt

Thread 1 (Thread 0xb639e720 (LWP 4214))

  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1778
  • #1 get_messagex_done
    at mail-ops.c line 1900
  • #2 mail_msg_idle_cb
    at mail-mt.c line 447
  • #3 g_idle_dispatch
    at gmain.c line 4065
  • #4 g_main_dispatch
    at gmain.c line 1960
  • #5 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #6 g_main_context_iterate
    at gmain.c line 2591
  • #7 IA__g_main_loop_run
    at gmain.c line 2799
  • #8 IA__gtk_main
    at gtkmain.c line 1205
  • #9 main
    at main.c line 620
  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1778
  • #1 get_messagex_done
    at mail-ops.c line 1900
  • #2 mail_msg_idle_cb
    at mail-mt.c line 447
  • #3 g_idle_dispatch
    at gmain.c line 4065
  • #4 g_main_dispatch
    at gmain.c line 1960
  • #5 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #6 g_main_context_iterate
    at gmain.c line 2591
  • #7 IA__g_main_loop_run
    at gmain.c line 2799
  • #8 IA__gtk_main
    at gtkmain.c line 1205
  • #9 main
    at main.c line 620

Comment 1 Paul Bolle 2009-11-24 23:53:41 UTC
0) Similar crash here (evolution 2.29.2). Similar situation (cancelled some stuff in the status bar since evolution took its time when I returned to it after a suspend/resume cycle and manually switching network form wireless to wired).

1) Last few lines of output:
(evolution:10390): camel-WARNING **: Camel operation status stack non empty: 

(evolution:10390): evolution-shell-CRITICAL **: e_shell_backend_get_shell: assertion `E_IS_SHELL_BACKEND (shell_backend)' failed

(evolution:10390): evolution-shell-CRITICAL **: e_shell_get_shell_settings: assertion `E_IS_SHELL (shell)' failed
Segmentation fault (core dumped)

2) gdb on this core file:
(gdb) bt
  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1810
  • #1 get_messagex_done
    at mail-ops.c line 1931
  • #2 mail_msg_idle_cb
    at mail-mt.c line 447
  • #3 ??
    from /lib/libglib-2.0.so.0
  • #4 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #5 ??
    from /lib/libglib-2.0.so.0
  • #6 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #7 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 main
    at main.c line 621
  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1810
reader = 0x86aa6d0
html_display = <value optimized out>
message_list = 0x0
shell_backend = <value optimized out>
shell_settings = <value optimized out>
shell = <value optimized out>
event = 0x0
target = <value optimized out>
mark_read = <value optimized out>
timeout_interval = <value optimized out>

3) Quick, uninformed analysis
evolution is dereferencing a NULL pointer with "message_list->cursor_uid". message_list was set by e_mail_reader_get_message_list(). Shouldn't a NULL return by that function be checked and this call back return if message_list turns out to be NULL?

Note, however, that by the time evolution crashes here shell_backend, shell, and shell_settings all seem to be NULL too.
Comment 2 Akhil Laddha 2009-12-18 11:57:55 UTC
*** Bug 604896 has been marked as a duplicate of this bug. ***
Comment 3 Akhil Laddha 2010-01-11 06:53:27 UTC
Evolution 2.29.5 

I get this crash often now a days while fetching the new mails

(evolution:12195): evolution-shell-CRITICAL **: e_shell_backend_get_shell: assertion `E_IS_SHELL_BACKEND (shell_backend)' failed

(evolution:12195): evolution-shell-CRITICAL **: e_shell_get_shell_settings: assertion `E_IS_SHELL (shell)' failed

Program received signal SIGSEGV, Segmentation fault.
0xb606bf7d in mail_reader_message_loaded_cb (folder=0x89a1098, message_uid=0x9cd6398 "0853BD1E00000001FA9D5DF038000001", message=0x99f1c00, 
    user_data=0x8a241e0, ex=0x9d1744c) at e-mail-reader.c:1765
1765		cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
(gdb) bt
  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1765
  • #1 get_messagex_done
    at mail-ops.c line 1916
  • #2 mail_msg_idle_cb
    at mail-mt.c line 441
  • #3 g_idle_dispatch
    at gmain.c line 4065
  • #4 g_main_dispatch
    at gmain.c line 1960
  • #5 IA__g_main_context_dispatch
    at gmain.c line 2513
  • #6 g_main_context_iterate
    at gmain.c line 2591
  • #7 IA__g_main_loop_run
    at gmain.c line 2799
  • #8 IA__gtk_main
    at gtkmain.c line 1217
  • #9 main
    at main.c line 593

Comment 4 Milan Crha 2010-01-11 12:56:36 UTC
Created attachment 151166 [details] [review]
proposed evo patch

for evolution;

When you open a message in a new window, then new message list and mail browser are created, and the browser is freed immediately on the window close, but the message list is still alive, doing its part (for me waiting for message list regeneration). When it's done the signals are called with freed pointers as EMailReader and such. Thus the most important part is signal disconnection on browser dispose.

I was unable to get the exact crash you have, so maybe it'll not help for you completely. Please give it a try. Thanks.
Comment 5 Milan Crha 2010-01-13 13:25:43 UTC
Downstream bug report about the same:
https://bugzilla.redhat.com/show_bug.cgi?id=553550
Comment 6 Akhil Laddha 2010-01-19 08:11:04 UTC
I got a crash even after i have a patch applied from comment#4

evolution:636): evolution-shell-CRITICAL **: e_shell_backend_get_shell: assertion `E_IS_SHELL_BACKEND (shell_backend)' failed

(evolution:636): evolution-shell-CRITICAL **: e_shell_get_shell_settings: assertion `E_IS_SHELL (shell)' failed

Program received signal SIGSEGV, Segmentation fault.
0xb5d2bed1 in mail_reader_message_loaded_cb (folder=0x87d9070, message_uid=0x88b3a38 "7469", message=0x8ab8588, user_data=0x85ba2c0, ex=0x8820854) at e-mail-reader.c:1767
1767		cursor_uid = MESSAGE_LIST (message_list)->cursor_uid;
(gdb) bt full

Thread 1 (Thread 0xb6330760 (LWP 636))

  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 1767
  • #1 get_messagex_done
    at mail-ops.c line 1916
  • #2 mail_msg_idle_cb
    at mail-mt.c line 441
  • #3 g_idle_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #4 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #5 g_main_context_iterate
    from /usr/lib/libglib-2.0.so.0
  • #6 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #7 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 main
    at main.c line 609

Comment 7 Milan Crha 2010-01-19 16:01:30 UTC
(In reply to comment #4)
> I was unable to get the exact crash you have, so maybe it'll not help for you
> completely. Please give it a try. Thanks.

Err, I hate when I'm right with things like the one above. I didn't get those runtime warnings there, so that can be the clue. Could you either run it on valgrind, and/or try to find any exact steps/data what I should do to trigger that, please? Or, maybe, if Paul can reproduce, then maybe he can look at this?
Comment 8 Akhil Laddha 2010-02-26 03:31:02 UTC
*** Bug 611108 has been marked as a duplicate of this bug. ***
Comment 9 Fabio Durán Verdugo 2010-11-01 19:44:41 UTC
*** Bug 633716 has been marked as a duplicate of this bug. ***
Comment 10 Milan Crha 2010-12-21 20:35:15 UTC
Comment on attachment 151166 [details] [review]
proposed evo patch

code in latest evo git master diverged too much, the patch is unusable, thus I'm marking it as such (thanks ssieb for noting this on IRC)
Comment 11 Samuel Sieb 2010-12-22 00:34:55 UTC
Here's a backtrace from evolution current master:

  • #0 mail_reader_message_loaded_cb
    at e-mail-reader.c line 2646
  • #1 g_simple_async_result_complete
    from /lib/libgio-2.0.so.0
  • #2 ??
    from /lib/libgio-2.0.so.0
  • #3 ??
    from /lib/libglib-2.0.so.0
  • #4 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #5 ??
    from /lib/libglib-2.0.so.0
  • #6 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #7 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 main
    at main.c line 734

Here's the code in case it changes:
2641			!priv->restoring_message_selection;
2642		timeout_interval =
2643			e_shell_settings_get_int (
2644			shell_settings, "mail-mark-seen-timeout");
2645	
2646		if (MESSAGE_LIST (message_list)->seen_id > 0) {
2647			g_source_remove (MESSAGE_LIST (message_list)->seen_id);
2648			MESSAGE_LIST (message_list)->seen_id = 0;
2649		}
Comment 12 Milan Crha 2011-01-12 12:56:58 UTC
Created attachment 178125 [details] [review]
evo patch

for evolution;

I finally got to this, and when cheating a bit (adding slowness to camel_folder_get_message), then I can reproduce this too. This patch fixes it, because the EMailReader is reffed, but when one closes the message window then the underlying MessageList is freed, so later, when the event mail_reader_message_loaded_cb is called the message list is NULL.
Comment 13 Milan Crha 2011-01-12 12:58:19 UTC
Created commit 88e2ead in evo master (2.91.6+)
Comment 14 Milan Crha 2011-01-17 07:47:28 UTC
*** Bug 618902 has been marked as a duplicate of this bug. ***