Hallo!

This has kept me busy for a while now and I am not getting any
further. Can somebody please reproduce this or give a hint?

Behavior:
When trying to open GPG-encrypted message, pinentry shows up to ask the
passphrase for the private key. Upon entering correct passphrase, the
dialog is closed and the message "Invoking GPG" appears, which is
shortly afterwards interrupted by "Segmentation Fault". The decrypted
message and the temporary keyring (mutt-gpgme-*) can be found in /tmp.

Action:
I rebuilt mutt with debug symbols enabled, had it dump core, analysed
it. Backtrace will be attached to the message. I did this also with a
nightly build and the problem persisted. I narrowed it down to an
strftime-call in crypt-gpgme.c and reproduced the line in a test.c,
which did not segfault.

Looking at the backtrace it seems like localtime(&subkey->timestamp)
returns NULL. But why? Time and timezone are properly configured and why
would the error show just there?

Versions:
OpenBSD 5.7
mutt-1.5.23 (and mutt-1.5.23hg 31.08.15)
gnupg-2.1.2

Minimal muttrc:
set crypt_use_gpgme

muttdebug:
Entering pgp_application_pgp handler
crypt-gpgme.c:2061: mutt_mktemp returns "[...]".

gpgmedebug:
gpgme_op_keylist_next: leave: key=0x[...]
The key listed here is the public key of the sender, a 4096 bit RSA.

backtrace (nightly build, line numbers should be the current ones):
    ptlim=0xcfbc68b8 "/tmp/mutt-[...]",
    warnp=0xcfbc6744) at /usr/src/lib/libc/time/strftime.c:453
#1  0x0946a902 in strftime (s=0xcfbc67b8 "\003", maxsize=256,
    format=0x36a7490c "%Y-%m-%d", t=0x0)
    at /usr/src/lib/libc/time/strftime.c:130
#2 0x16af0e96 in pgp_gpgme_extract_keys (keydata=Variable "keydata" is not available.
) at crypt-gpgme.c:2084
#3  0x16af15a1 in pgp_gpgme_application_handler (m=0x844cb000, s=0xcfbc9e78)
    at crypt-gpgme.c:2396
#4  0x16af7c34 in crypt_mod_pgp_application_handler (m=0x844cb000,
    s=0xcfbc9e78) at crypt-mod-pgp-gpgme.c:55
#5  0x16a7c9fc in crypt_pgp_application_pgp_handler (m=0x844cb000,
    s=0xcfbc9e78) at cryptglue.c:153
#6  0x16a9fb8e in run_decode_and_handler (b=0x844cb000, s=0xcfbc9e78,
    handler=0x16a7c9a0 <crypt_pgp_application_pgp_handler>, plaintext=0)
    at handler.c:1669
#7  0x16a9fea8 in mutt_body_handler (b=0x844cb000, s=0xcfbc9e78)
    at handler.c:1810
#8  0x16aa05a4 in multipart_handler (a=0x7fdc2880, s=0xcfbc9e78)
    at handler.c:1276
#9  0x16a9fb8e in run_decode_and_handler (b=0x7fdc2880, s=0xcfbc9e78,
    handler=0x16aa0450 <multipart_handler>, plaintext=0) at handler.c:1669
#10 0x16a9fea8 in mutt_body_handler (b=0x7fdc2880, s=0xcfbc9e78)
    at handler.c:1810
#11 0x16af3cb4 in pgp_gpgme_encrypted_handler (a=0x771eb200, s=0xcfbc9e78)
    at crypt-gpgme.c:2606
#12 0x16af7c04 in crypt_mod_pgp_encrypted_handler (m=0x771eb200, s=0xcfbc9e78)
    at crypt-mod-pgp-gpgme.c:60
#13 0x16a7c99c in crypt_pgp_encrypted_handler (a=0x771eb200, s=0xcfbc9e78)
    at cryptglue.c:162
#14 0x16a9d252 in valid_pgp_encrypted_handler (b=0x7fdc2080, s=0xcfbc9e78)
    at handler.c:1697
#15 0x16a9fb8e in run_decode_and_handler (b=0x7fdc2080, s=0xcfbc9e78,
    handler=0x16a9d220 <valid_pgp_encrypted_handler>, plaintext=0)
    at handler.c:1669
#16 0x16a9fea8 in mutt_body_handler (b=0x7fdc2080, s=0xcfbc9e78)
    at handler.c:1810
#17 0x16a855f5 in _mutt_copy_message (fpout=0x293ea540, fpin=0x293ea598,
hdr=0x81347c00, body=0x7fdc2080, flags=2124, chflags=262294) at copy.c:600
#18 0x16a85db4 in mutt_copy_message (fpout=0x293ea540, src=0x7eac0180,
    hdr=0x81347c00, flags=2124, chflags=262294) at copy.c:688
#19 0x16a7f0dc in mutt_display_message (cur=0x81347c00) at commands.c:148
#20 0x16a8b0a5 in mutt_index_menu () at curs_main.c:1286
#21 0x16aa964f in main (argc=1886221359, argv=0xcfbcbbc4) at main.c:1061

test.c:
#include <sys/types.h>
#include <time.h>
#include <stdio.h>

int main()
{
        time_t t = 1402331216; /* timestamp of sender's pubkey */
        char date[256];
        strftime (date, sizeof (date), "%Y-%m-%d", localtime(&t));
        printf("%s\n", date);
}

--
Hannes Wenzel

Reply via email to