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 737903 - [SMTP] Crash when authentication fails
[SMTP] Crash when authentication fails
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Mailer
3.12.x (obsolete)
Other Linux
: Normal critical
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
: 738506 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-10-04 20:03 UTC by Adam Williamson
Modified: 2014-10-15 07:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
backtrace of the crash (46.31 KB, text/plain)
2014-10-04 20:04 UTC, Adam Williamson
  Details
updated backtrace, now with glib-networking debug symbols! (46.81 KB, text/plain)
2014-10-04 20:42 UTC, Adam Williamson
  Details
proposed eds patch (568 bytes, patch)
2014-10-07 16:27 UTC, Milan Crha
committed Details | Review
proposed eds patch ][ (1.17 KB, patch)
2014-10-14 07:42 UTC, Milan Crha
committed Details | Review

Description Adam Williamson 2014-10-04 20:03:49 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).
Comment 1 Adam Williamson 2014-10-04 20:04:14 UTC
Created attachment 287724 [details]
backtrace of the crash
Comment 2 Matthew Barnes 2014-10-04 20:27:46 UTC
Crashed in end_gnutls_io() but glib-networking debug symbols not installed.

(Where did the glib-networking Bugzilla product go?)
Comment 3 Adam Williamson 2014-10-04 20:42:32 UTC
Created attachment 287725 [details]
updated backtrace, now with glib-networking debug symbols!
Comment 4 Dan Winship 2014-10-05 14:33:28 UTC
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.
Comment 5 Milan Crha 2014-10-07 16:27:14 UTC
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
Comment 6 Milan Crha 2014-10-09 11:01:33 UTC
Downstream bug report about the same crash from 3.12.6 with XOAUTH2 authentication method:
https://bugzilla.redhat.com/show_bug.cgi?id=1149323
Comment 7 Adam Williamson 2014-10-09 16:48:12 UTC
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.
Comment 8 Milan Crha 2014-10-09 17:02:08 UTC
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
Comment 9 Milan Crha 2014-10-14 07:31:51 UTC
Reopening, it seems I broke authentication for some servers by this change.
Comment 10 Milan Crha 2014-10-14 07:34:01 UTC
*** Bug 738506 has been marked as a duplicate of this bug. ***
Comment 11 Paul Menzel 2014-10-14 07:40:22 UTC
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
Comment 12 Milan Crha 2014-10-14 07:42:38 UTC
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).
Comment 13 Paul Menzel 2014-10-14 07:42:59 UTC
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.
Comment 14 Milan Crha 2014-10-14 07:44:09 UTC
This is it:

> (evolution:5686): camel-WARNING **: CamelSmtpTransport::authenticate_sync()
> reported failure without setting its GError

The above patch will fix it.
Comment 15 Dominique Leuenberger 2014-10-14 12:52:04 UTC
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)
Comment 16 Milan Crha 2014-10-14 13:37:39 UTC
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
Comment 17 Adam Williamson 2014-10-14 15:16:41 UTC
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 :(
Comment 18 Milan Crha 2014-10-15 07:10:37 UTC
That's okay Adam, it's my fault, overlooking how this actually works.
Comment 19 Paul Menzel 2014-10-15 07:12:47 UTC
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.