GNOME Bugzilla – Bug 737903
[SMTP] Crash when authentication fails
Last modified: 2014-10-15 07:12:47 UTC
I have a Fedora 21 (GNOME 3.14) desktop and a Fedora 19 FreeIPA server. I'm experiencing a bug where GNOME seems to lose the Kerberos credentials periodically: https://bugzilla.gnome.org/show_bug.cgi?id=737902 I have Evo set up to authenticate via GSSAPI (mail server end is using Dovecot's SASL implementation, postfix as the MTA). This usually works great, but when I try to send an email when GNOME has lost the Kerberos credential, Evo crashes and loses most of the text of the email, which is obviously intensely frustrating. I'm attaching a backtrace of the crash (didn't have all debuginfos installed, but I think the important ones are there).
Created attachment 287724 [details] backtrace of the crash
Crashed in end_gnutls_io() but glib-networking debug symbols not installed. (Where did the glib-networking Bugzilla product go?)
Created attachment 287725 [details] updated backtrace, now with glib-networking debug symbols!
it's hitting the assertion: g_assert (!error || !*error); tracing back up the call chain from there, it looks like the bug is in camel-smtp-transport.c:smtp_transport_authenticate_sync(); if camel_sasl_challenge_base64_sync() returns an error, then camel_stream_write_string() with be called with an already-set GError.
Created attachment 287977 [details] [review] proposed eds patch for evolution-data-server; This should make it. A test package for Fedora 21 with the patch included can be found here: http://koji.fedoraproject.org/koji/taskinfo?taskID=7789210
Downstream bug report about the same crash from 3.12.6 with XOAUTH2 authentication method: https://bugzilla.redhat.com/show_bug.cgi?id=1149323
I tested mcrha's fix from c#5 and it looks good. Without that e-d-s build a crash can be triggered by running 'kdestroy' before attempting to send a mail. With that e-d-s build, the same test results in (as expected) an error dialog.
Thanks a lot for a help with testing of this. Created commit 70f3da6 in eds master (3.13.7+) [1] Created commit c0596a0 in eds evolution-data-server-3-12 (3.12.7+) [1] https://git.gnome.org/browse/evolution-data-server/commit/?id=70f3da6
Reopening, it seems I broke authentication for some servers by this change.
*** Bug 738506 has been marked as a duplicate of this bug. ***
Messages from the terminal: (evolution:5686): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync() reported failure without setting its GError (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): evolution-util-WARNING **: Schlüssel des Schlüsselbundes kann nicht genutzt werden: Kein Benutzer- oder Servername (evolution:5686): evolution-util-WARNING **: Schlüssel des Schlüsselbundes kann nicht genutzt werden: Kein Benutzer- oder Servername (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync() reported failure without setting its GError (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync() reported failure without setting its GError (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): GLib-GObject-CRITICAL **: g_closure_unref: assertion 'closure->ref_count > 0' failed (evolution:5686): evolution-util-WARNING **: Schlüssel des Schlüsselbundes kann nicht genutzt werden: Kein Benutzer- oder Servername (evolution:5686): evolution-util-WARNING **: Schlüssel des Schlüsselbundes kann nicht genutzt werden: Kein Benutzer- oder Servername (evolution:5686): evolution-util-WARNING **: Schlüssel des Schlüsselbundes kann nicht genutzt werden: Kein Benutzer- oder Servername (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync() reported failure without setting its GError ** (evolution:5686): WARNING **: Shell not finalized on exit
Created attachment 288438 [details] [review] proposed eds patch ][ for evolution-data-server; This does the same thing as the first patch, only in a safer way, which means it lets the authentication fail only if the SASL challenge is NULL and the function returned an error (previously wasn't checked the error part).
Sending a message the first time seems to work. My results so far: Sending message with SMTP Exim 4 (CRAM-MD5) works first time and then Web.de account and further messages with Exim 4, authentication is broken. Sending message first with Web.de account (LOGIN), all subsequent Web.de messages can be sent but Exim 4 fails every time.
This is it: > (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync() > reported failure without setting its GError The above patch will fix it.
I tested the patch in comment#12 and so far (after very short testing) I can confirm that my server(postfix, accepting LOGIN after TLS) is able to auth again. I sent two mails over this connection so far (before that patch, 3.12.7 did not allow me to send a single mail that required auth there)
Thanks for the testing and I'm sorry for a lame overlook I did. I will release evolution-data-server 3.12.7.1 shortly. Created commit b926284 in eds master (3.13.7+) [1] Created commit 68bdd55 eds evolution-data-server-3-12 (3.12.7.1+) [1] https://git.gnome.org/browse/evolution-data-server/commit/?id=b926284
Sorry folks for not testing Milan's proposed fix earlier, maybe we'd have spotted the breakage if we hadn't done the testing quickly to get it in 3.12.7 :(
That's okay Adam, it's my fault, overlooking how this actually works.
Milan, thank you for the quick fix and sorry that I was not able to test this earlier. Dominique thank you for testing the patch! Also big thank you to the Debian GNOME team to upload 3.12.7.1 quickly after its release.