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 769204 - evolution-3.20.3 takes minutes to open a mail
evolution-3.20.3 takes minutes to open a mail
Status: RESOLVED NOTGNOME
Product: evolution
Classification: Applications
Component: Mailer
3.20.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-mail-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2016-07-26 20:15 UTC by Pacho Ramos
Modified: 2016-12-05 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mail causing the issue (5.52 KB, text/plain)
2016-07-26 20:20 UTC, Pacho Ramos
Details
bt.txt (15.88 KB, text/plain)
2016-08-06 07:30 UTC, Pacho Ramos
Details

Description Pacho Ramos 2016-07-26 20:15:46 UTC
I am not sure about how to forward you the mail causing this... but each time I try to simply read it (it's fetched via POP3 already), it takes minutes to open. I don't see any special activity in CPU or I/O, then, I am not sure what it is doing :/

Thanks a lot for your help
Comment 1 Pacho Ramos 2016-07-26 20:20:08 UTC
Created attachment 332177 [details]
mail causing the issue

Is this one
Comment 2 Pacho Ramos 2016-07-26 20:24:09 UTC
Also, maybe as a consequence of that, if I try to reply to the mail, evolution gets stalled
Comment 3 Milan Crha 2016-08-05 07:38:15 UTC
Thanks for a bug report. It opens here in a tick of a second. The message is GPG signed, thus I guess the evolution is waiting for the GPG to respond. You can run evolution with:

   $ CAMEL_DEBUG=gpg evolution

to see the output from the GPG. It would be also good to install debuginfo packages for the evolution-data-server and evolution, then take a backtrace of the evolution while it is waiting. You can get the backtrace with command like this:
   $ gdb --batch --ex "t a a bt" -pid=`pidof evolution` &>bt.txt
Please check the bt.txt for any private information, like passwords, email address, server addresses,... I usually search for "pass" at least (quotes for clarity only).

If it's really waiting for the GPG, then you might be facing some variant of the bug #741786, which is pretty old. The backtrace will show what it is doing.
Comment 4 Pacho Ramos 2016-08-06 07:24:43 UTC
With the CAMEL_DEBUG it's waiting with:
status: [GNUPG:] NEWSIG

But as soon as I run:
gdb --batch --ex "t a a bt" -pid=`pidof evolution` &>bt.txt

evolution window becomes completely stalled, is that normal? :/
Comment 5 Pacho Ramos 2016-08-06 07:30:36 UTC
Created attachment 332817 [details]
bt.txt

Finally it works ;)

This is the bt
Comment 6 Pacho Ramos 2016-08-06 07:31:24 UTC
And, once the mail is finally opened, the following two lines are shown by CAMEL_DEBUG:
status: [GNUPG:] ERRSIG 9709F90C3C96FFC8 1 10 01 1469364044 9
status: [GNUPG:] NO_PUBKEY 9709F90C3C96FFC8
Comment 7 Milan Crha 2016-08-08 14:11:28 UTC
Thanks for the update.

(In reply to Pacho Ramos from comment #4)
> evolution window becomes completely stalled, is that normal? :/

Yes, that's correct. As long as the gdb command runs the process doesn't update, because it's "paused" by the gdb.

The backtrace shows that the Thread 3 is waiting on gpg, thus it's due to it. I do not know what the gpg is waiting for, though. You can try to install debug package for the gnupg (and/or gnupg2) and capture similar backtrace from the gpg (or gpg2) process the evolution is waiting for.
Comment 8 Pacho Ramos 2016-08-08 20:09:38 UTC
I get this:
0x0000003df50dc430 in read () from /lib64/libc.so.6

Thread 1 (process 10631)

  • #0 read
    from /lib64/libc.so.6
  • #1 read
    at /usr/include/bits/unistd.h line 44
  • #2 file_filter
    at iobuf.c line 588
  • #3 underflow
    at iobuf.c line 1840
  • #4 iobuf_readbyte
    at iobuf.c line 1960
  • #5 iobuf_read_line
    at iobuf.c line 2495
  • #6 keyserver_spawn
    at keyserver.c line 1547
  • #7 keyserver_work
    at keyserver.c line 1688
  • #8 keyserver_import_keyid
    at keyserver.c line 1847
  • #9 check_sig_and_print
    at mainproc.c line 1704
  • #10 proc_tree
    at mainproc.c line 2229
  • #11 release_list
    at mainproc.c line 124
  • #12 do_proc_packets
    at mainproc.c line 1409
  • #13 proc_signature_packets
    at mainproc.c line 1180
  • #14 verify_signatures
    at verify.c line 114
  • #15 main
    at gpg.c line 3638

Comment 9 Pacho Ramos 2016-08-18 09:57:15 UTC
I have gnupg-2.0.30 (the same happens with 2.0.28)
Comment 10 Pacho Ramos 2016-08-18 14:06:52 UTC
What more information is needed? (I cannot switch this bug out of NEEDINFO status :( )
Comment 11 Milan Crha 2016-08-19 08:45:54 UTC
I'd need an information from a gnupg developer, but I do not know any being here, unfortunately.
Comment 12 Pacho Ramos 2016-10-02 19:43:53 UTC
I can try to ask our downstream maintainers of gnupg... maybe they know or, at least, they will be able to know who to contact about this :/
Comment 13 Pacho Ramos 2016-10-22 08:00:14 UTC
Any news about this? Should I report to gnupg people for asking them for help? (Well, I am still hitting this really often :S)

Thanks
Comment 14 Milan Crha 2016-10-24 13:55:46 UTC
I'm sorry, I lost track of this bug report. There is really nothing much to be done on the evolution-data-server side. I'm open for any advices from the gnupg folks, because as long as there is any gpg/gpg2 running at the time when the evolution is stuck, then it can be both evolution waiting for an output from the gpg/gpg2 incorrectly or the gpg/gpg2 not returning expected data, or even flushing its output buffers, thus the system can cache the pipe and cause the delay. I do not know how to verify that on the gpg/gpg2 side.
Comment 15 Pacho Ramos 2016-10-24 13:59:59 UTC
It looks like this is fixed with newer gnupg-2.1.x (now 2.1.15) over 2.0.x :/
Comment 16 Milan Crha 2016-10-24 16:36:11 UTC
I suppose it's a good news, isn't it?
Comment 17 Pacho Ramos 2016-10-28 07:24:23 UTC
Yeah, but I was waiting a bit to see with new mails if I was still suffering... it looks to work ;)
Comment 18 Pacho Ramos 2016-11-28 21:21:54 UTC
It is happening again :(
gnupg-2.1.15

Is there a way to know what concrete gnupg command is evolution trying to run? (to see if I can run it manually to at least see why it's failing or similar :/)
Comment 19 Milan Crha 2016-11-29 08:03:48 UTC
You do not need to reopen the bug report to ask questions.

If the gpg2 is still running then `ps ax | grep gpg` shows also the command line being invoked. Otherwise see:
https://git.gnome.org/browse/evolution-data-server/tree/src/camel/camel-gpg-context.c#n572
even it's a generic function which constructs the arguments based on the parameters.
Comment 20 Pacho Ramos 2016-11-29 19:45:44 UTC
This is the command:
gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=42 --verify /tmp/evolution-pgp.W3K7QY -


Before trying to ask gnupg guys... do you think is it ok? (or, at least, that was intended?) 

When running that manually I get it also hung:
$ LC_ALL=C gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=42 --verify /tmp/evolution-pgp.W3K7QY -
gpg: armor header: Version: GnuPG v2.0

If I drop the "-" at the end I get:
$ LC_ALL=C gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=42 --verify /tmp/evolution-pgp.W3K7QY 
gpg: armor header: Version: GnuPG v2.0
gpg: no signed data
gpg: can't hash datafile: No data

Is that normal?

Thanks
Comment 21 Milan Crha 2016-11-30 13:09:48 UTC
The --status-fd=42 says the gpg2 to write any "status" to file descriptor with number 42. Those are opened before the call is done. Hard to tell what it does when you run the same command line from a terminal. Either skip it, or use file number 1, to get it on stdout.

The --verify /tmp/evolution-pgp.W3K7QY expects an existing file /tmp/evolution-pgp.W3K7QY which contains a signed GPG data. It looks like the file doesn't exist or doesn't contain valid data.

I had a hard time to figure out what the '-' at the end exactly means, then I noticed the mention of it in the WARNINGS section of its man page:

> If you are going to verify detached signatures, make sure that the program
> knows about it; either give both filenames on the command line or use '-' to
> specify STDIN.

That sort of explains the change in the behaviour you see when removing it.

I re-read the backtraces above and what I see is that the evolution is waiting for a response from the gpg2 and the gpg2 is waiting for a response from a keyserver. Whether it's a local key server or a remote one I do not know.
Comment 22 Pacho Ramos 2016-12-04 10:22:07 UTC
I don't user any remote key server, how could I check my local key server is working? (at least, seahorse looks to open they keyring properly without dropping warnings or errors)

Thanks
Comment 23 Pacho Ramos 2016-12-04 11:47:45 UTC
Ah, regarding the /tmp files... I already checked them... they seem to exist and be readable (at least with "less")

they contain only PGP signatures, like:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.1
Comment: Robbat2 @ Orbis-Terrarum Networks - The text below is a digital signature. If it doesn't make any sense to you, ignore it.

iQJ8BAEBCgBmBQJYPgKxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDQjJEMjlCMjBCMkM5MUFDQzE2NDk2NkRB
RTcyMjg3ODM3QzU5RjVGAAoJEK5yKHg3xZ9fZPgQAJC4OmBHBkMai3sE2E7c8oDn
qHe9LChyydnpGtueRvIAhH78ZbnyJShj1iCeJrd2EElEcSqIDBiT6GT8kWCQRLia
odGTtyowXKjVAYFWr6KAI8DV3ceuJJ/EMCMTqx3f9xYXMSeK8g8w+FjGaxFXiQvN
BtYDO66rufIMg6mwwc4C3KNHbSudNEctlUho8LHsM/zJLEfA9t5EWIhAyi5W4nMF
/cSJGeBKs2VoLiz+tpWOYgTc3d+1l2UI48BX5sTGk/iC7iA641Z2i/7UF4Y9prrf
GoxuO2G9VFVhZrbIFP705AcYhw/oxcp/Jih2R5kHyJB62I3ZYSy8y1W9bRBiXBDv
ntW5v7v56tXkSUnz5XGsKICkEMvpxAs34M4zqPEjXqZ+r/GZKUJyU16Usejz2sxx
fCEU9lyFZayhicnZYEpEViLBhOep7TpeZMFg8lchIovVWLk4SSxjyy8T+Mje2/N7
HWX1NV1zaNPwud63sJDTBUKXq7zaWRM0ATm4uax6gl1INqiY7FADS9u8rfLUlHRr
PBBKnupO58z/s6qPQJjZ2VAsyAuO7Si8guU47sH1gcl40+2/0VOc2InXUeGQh3hQ
jVYmqSJMSkMpcK4ydSPOfCy6mVnvTdxLz3B67uo5irv17Smvux3eaJGgpFjd1Llb
sX30dxGp6Xef+x231pN7
=JARy
-----END PGP SIGNATURE-----

And, running gpg2 command with the --status-fd= set to 1, shows me this:
$ LC_ALL=C gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch --yes --status-fd=1 --verify /tmp/evolution-pgp.U92WRY -
gpg: armor header: Version: GnuPG v2.1
gpg: armor header: Comment: Robbat2 @ Orbis-Terrarum Networks - The text below is a digital signature. If it doesn't make any sense to you, ignore it.

[It gets stalled at this point]
Comment 24 Pacho Ramos 2016-12-04 12:46:36 UTC
Ah, I have found and old setting in ~/.gnupg/gpg.conf... I had this:
keyserver hkp://subkeys.pgp.net
#keyserver mailto:pgp-public-keys@keys.nl.pgp.net
#keyserver ldap://keyserver.pgp.com

I commented also the first line and it seems to work now :D

Thanks a lot for your guidance and help! :)
Comment 25 Milan Crha 2016-12-05 11:44:14 UTC
(In reply to Pacho Ramos from comment #23)
> $ LC_ALL=C gpg2 --verbose --no-secmem-warning --no-greeting --no-tty --batch
> --yes --status-fd=1 --verify /tmp/evolution-pgp.U92WRY -
> gpg: armor header: Version: GnuPG v2.1
> gpg: armor header: Comment: Robbat2 @ Orbis-Terrarum Networks - The text
> below is a digital signature. If it doesn't make any sense to you, ignore it.
> 
> [It gets stalled at this point]

Right, it can be also waiting for the message content being passed to it through stdin.

(In reply to Pacho Ramos from comment #24)
> Ah, I have found and old setting in ~/.gnupg/gpg.conf... I had this:
> keyserver hkp://subkeys.pgp.net
> #keyserver mailto:pgp-public-keys@keys.nl.pgp.net
> #keyserver ldap://keyserver.pgp.com
> 
> I commented also the first line and it seems to work now :D

Aha. Maybe consider asking the gpg2 developers to set some shorter timeout limit for the key server connections.
Comment 26 Pacho Ramos 2016-12-05 13:59:43 UTC
Yeah, well, ideally it should be a bit more verbose about what it's doing (either gpg2 command trying to connect or evolution showing that it's waiting for gpg2)... but maybe it's too difficult to implement :/