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 619098 - mail_shell_backend_sync_store_cb() has wrong signature
mail_shell_backend_sync_store_cb() has wrong signature
Status: RESOLVED FIXED
Product: evolution
Classification: Applications
Component: Mailer
2.30.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2010-05-19 15:19 UTC by Jonathon Jongsma
Modified: 2010-06-18 15:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jonathon Jongsma 2010-05-19 15:19:33 UTC


Thread 1 (Thread 0x7ffff7fab7f0 (LWP 29571))

  • #0 mail_shell_backend_sync_store_cb
    at e-mail-shell-backend.c line 243
  • #1 e_mail_store_foreach
    at e-mail-store.c line 429
  • #2 mail_shell_backend_mail_sync
    at e-mail-shell-backend.c line 268
  • #3 g_timeout_dispatch
    at /tmp/buildd/glib2.0-2.24.1/glib/gmain.c line 3396
  • #4 g_main_dispatch
    at /tmp/buildd/glib2.0-2.24.1/glib/gmain.c line 1960
  • #5 IA__g_main_context_dispatch
    at /tmp/buildd/glib2.0-2.24.1/glib/gmain.c line 2513
  • #6 g_main_context_iterate
    at /tmp/buildd/glib2.0-2.24.1/glib/gmain.c line 2591
  • #7 IA__g_main_loop_run
    at /tmp/buildd/glib2.0-2.24.1/glib/gmain.c line 2799
  • #8 IA__gtk_main
    at /tmp/buildd/gtk+2.0-2.20.1/gtk/gtkmain.c line 1219
  • #9 main
    at main.c line 578

Comment 1 Jonathon Jongsma 2010-05-19 15:22:06 UTC
Sorry for the lack of context.  This has started happening regularly after upgrading to 2.30 on debian.  It generally happens within about 5 minutes of sitting idly.
Comment 2 Matthew Barnes 2010-05-19 21:00:07 UTC
Line 243 is a strange place for it to crash.  It implies the backend is either finalized or there's something wrong with the private pointer.

239: static void
240: mail_shell_backend_sync_store_cb (CamelStore *store,
241:                                   EMailShellBackend *mail_shell_backend)
242: {
243:         mail_shell_backend->priv->mail_sync_in_progress++;
244:
245:         mail_sync_store (
246:                 store, FALSE,
247:                 mail_shell_backend_sync_store_done_cb,
248:                 mail_shell_backend);
249: }

Debian's packaging of Evolution 2.30 has been particularly problematic for some reason; much more so than on Fedora.  It looks like they may have enabled large file support in Camel, which is breaking existing accounts in strange and mysterious ways.  But I don't yet know if that has anything to do with this bug.

Would you mind trying to reproduce this crash in a gdb session and then examining the contents of "mail_shell_backend" and "mail_shell_backend->priv" so I can see exactly what it's dying on?
Comment 3 Jonathon Jongsma 2010-05-19 21:42:12 UTC
(gdb) p *mail_shell_backend
$2 = {parent = {parent = {parent = {g_type_instance = {
          g_class = 0x6e6f6874616e6f6a}, ref_count = 1852795438, 
        qdata = 0x6f62616c6c6f6340}, priv = 0x6b752e6f632e6172}, priv = 0x0}, 
  priv = 0x25}


something strange certainly going on there.
Comment 4 Jonathon Jongsma 2010-05-19 21:44:14 UTC
Hopefully-useful valgrind info:

==26083== Thread 1:
==26083== Invalid read of size 8
==26083==    at 0x1828ECE0: mail_shell_backend_sync_store_cb (e-mail-shell-backend.c:243)
==26083==    by 0x1890763B: e_mail_store_foreach (e-mail-store.c:429)
==26083==    by 0x1828ECCE: mail_shell_backend_mail_sync (e-mail-shell-backend.c:268)
==26083==    by 0xE1B0E9A: g_timeout_dispatch (gmain.c:3396)
==26083==    by 0xE1B06C1: g_main_context_dispatch (gmain.c:1960)
==26083==    by 0xE1B4537: g_main_context_iterate (gmain.c:2591)
==26083==    by 0xE1B4A44: g_main_loop_run (gmain.c:2799)
==26083==    by 0xB848646: gtk_main (gtkmain.c:1219)
==26083==    by 0x4027D3: main (main.c:578)
==26083==  Address 0x1a438fb8 is 7 bytes after a block of size 33 alloc'd
==26083==    at 0x4C221A7: malloc (vg_replace_malloc.c:195)
==26083==    by 0xE1B9504: g_malloc (gmem.c:132)
==26083==    by 0xE1D0D7D: g_strdup (gstrfuncs.c:102)
==26083==    by 0x1890796C: mail_store_add (e-mail-store.c:86)
==26083==    by 0x18907BFD: e_mail_store_add_by_uri (e-mail-store.c:330)
==26083==    by 0x18907EDE: e_mail_store_init (e-mail-store.c:260)
==26083==    by 0x1828ED3B: mail_shell_backend_constructed (e-mail-shell-backend.c:484)
==26083==    by 0xD92F8F7: g_object_newv (gobject.c:1289)
==26083==    by 0xD93014C: g_object_new_valist (gobject.c:1377)
==26083==    by 0xD930390: g_object_new (gobject.c:1095)
==26083==    by 0x4E400FD: shell_add_backend (e-shell.c:413)
==26083==    by 0x71055F9: e_type_traverse (e-util.c:514)
==26083== 
==26083== Invalid read of size 4
==26083==    at 0x1828ECF0: mail_shell_backend_sync_store_cb (e-mail-shell-backend.c:243)
==26083==    by 0x1890763B: e_mail_store_foreach (e-mail-store.c:429)
==26083==    by 0x1828ECCE: mail_shell_backend_mail_sync (e-mail-shell-backend.c:268)
==26083==    by 0xE1B0E9A: g_timeout_dispatch (gmain.c:3396)
==26083==    by 0xE1B06C1: g_main_context_dispatch (gmain.c:1960)
==26083==    by 0xE1B4537: g_main_context_iterate (gmain.c:2591)
==26083==    by 0xE1B4A44: g_main_loop_run (gmain.c:2799)
==26083==    by 0xB848646: gtk_main (gtkmain.c:1219)
==26083==    by 0x4027D3: main (main.c:578)
==26083==  Address 0x1a43a0a8 is not stack'd, malloc'd or (recently) free'd
==26083== 
==26083== 
==26083== Process terminating with default action of signal 11 (SIGSEGV)
==26083==  Access not within mapped region at address 0x3FF0021
==26083==    at 0x1828ECF0: mail_shell_backend_sync_store_cb (e-mail-shell-backend.c:243)
==26083==    by 0x1890763B: e_mail_store_foreach (e-mail-store.c:429)
==26083==    by 0x1828ECCE: mail_shell_backend_mail_sync (e-mail-shell-backend.c:268)
==26083==    by 0xE1B0E9A: g_timeout_dispatch (gmain.c:3396)
==26083==    by 0xE1B06C1: g_main_context_dispatch (gmain.c:1960)
==26083==    by 0xE1B4537: g_main_context_iterate (gmain.c:2591)
==26083==    by 0xE1B4A44: g_main_loop_run (gmain.c:2799)
==26083==    by 0xB848646: gtk_main (gtkmain.c:1219)
==26083==    by 0x4027D3: main (main.c:578)
Comment 5 Matthew Barnes 2010-05-30 04:31:04 UTC
I think we agreed on IRC that this might be due to an ABI mismatch in Debian's packaging because the stack trace is so out of whack.  Have you seen this crash again?
Comment 6 Jonathon Jongsma 2010-06-14 21:19:59 UTC
well, I downgraded to 2.28 for a while because of this.  I've now just upgraded again, and I see it every time I try to start evolution.  I will try to report a bug downstream in debian.
Comment 7 Jonathon Jongsma 2010-06-14 21:45:31 UTC
for reference: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585921
Comment 8 Yves-Alexis Perez 2010-06-15 04:50:53 UTC
Hey, Debian packager here.

What exactly are you calling “abi mismatch”? We had problem which were related to largefile handling, but I don't see how disabling it would be  a solution (except if you're saying it's serverly broken and shouldn't be used at all, which might be problematic, afaik).
Comment 9 Yves-Alexis Perez 2010-06-15 04:53:58 UTC
I mean, I can disable largefile support if it's not stable, but that still looks like a bad workaround. If largefile support is broken, it should be fixed.
Comment 10 Jonathon Jongsma 2010-06-15 14:48:26 UTC
Yves-Alexis: the ABI mismatch we're talking about is just speculation.  If you look at the trace (and particularly comment #3), you'll notice that the mail_shell_backend->priv has a value of 0x25, which is clearly garbage.  So the two possibilities I can think of are: A) that value is being corrupted, or B) different parts of the code have different ideas about the struct layout (e.g. ABI mismatch) such that it tries to read ->priv from a section of the memory that is not within the struct boundary.  

The valgrind trace indicates that option A) is not likely since the invalid read was from an address that was "not stack'd, malloc'd or (recently) free'd".  So that leaves us assuming option B: an ABI mismatch somewhere.
Comment 11 Yves-Alexis Perez 2010-06-15 18:38:57 UTC
(In reply to comment #10)
> Yves-Alexis: the ABI mismatch we're talking about is just speculation.  If you
> look at the trace (and particularly comment #3), you'll notice that the
> mail_shell_backend->priv has a value of 0x25, which is clearly garbage.  So the
> two possibilities I can think of are: A) that value is being corrupted, or B)
> different parts of the code have different ideas about the struct layout (e.g.
> ABI mismatch) such that it tries to read ->priv from a section of the memory
> that is not within the struct boundary.  
> 
> The valgrind trace indicates that option A) is not likely since the invalid
> read was from an address that was "not stack'd, malloc'd or (recently) free'd".
>  So that leaves us assuming option B: an ABI mismatch somewhere.

Yeah, it might make sense, I was just saying that if it's related to largefile, we shouldn't hide the problem but try to fix it.
Comment 12 Matthew Barnes 2010-06-18 14:37:40 UTC
Jonathon found the real problem: callback function had the wrong signature.

Fixed on master and gnome-2-30 branches (just in time for 2.30.2!):

http://git.gnome.org/browse/evolution/commit/?id=524a26232bf4028f59880a6636b938d60a3227d9

http://git.gnome.org/browse/evolution/commit/?h=gnome-2-30&id=53f8bd8e6e963b866efb2e5536f28a116f1912c4
Comment 13 Jonathon Jongsma 2010-06-18 15:32:30 UTC
excellent.  I've rebuilt the debian package with this patch attached and it fixes the issue for me.  thanks.
Comment 14 Yves-Alexis Perez 2010-06-18 15:37:21 UTC
(In reply to comment #13)
> excellent.  I've rebuilt the debian package with this patch attached and it
> fixes the issue for me.  thanks.

Good to know, thank your for checking. Expect evolution packages next week in unstable (if everything goes fine :)