Backtrace with debug symbols:
(gdb) bt full
#0 0x655ea3e9 in aesni_do_setkey (ctx=0xc6f868,
key=0x6565dc10 <key_128.65421>
"\350\351\352\353\355\356\357\360\362\363\364\365\367\370\371\372\001K\257\"x\246\235\063\035Q\200\020\066C\351\232gC\303\321Q\232\264\362͚x\253\t\245\021\275]\036\362\r\316ּ\274\022\023\032\307\305G\210\252\b\016\225\027\353\026wq\232\317r\200\206\004",
<incomplete sequence \343>)
at
/home/aheinecke/arbeit/gpg4win/src/gnupg-w32-2.1.7/PLAY/src/libgcrypt/cipher/rijndael.c:248
No locals.
#1 0x655ead8a in do_setkey (ctx=0xc6f868,
key=0x6565dc10 <key_128.65421>
"\350\351\352\353\355\356\357\360\362\363\364\365\367\370\371\372\001K\257\"x\246\235\063\035Q\200\020\066C\351\232gC\303\321Q\232\264\362͚x\253\t\245\021\275]\036\362\r\316ּ\274\022\023\032\307\305G\210\252\b\016\225\027\353\026wq\232\317r\200\206\004",
<incomplete sequence \343>, keylen=16)
at
/home/aheinecke/arbeit/gpg4win/src/gnupg-w32-2.1.7/PLAY/src/libgcrypt/cipher/rijndael.c:569
initialized = 1 selftest_failed = 0x0 rounds = 10 i = 1 j = 1 r = 1 t = 13813018 rconpointer = 0 KC = 4 hwfeatures = 1472
#2 0x655eb2b1 in rijndael_setkey (context=0xc6f868,
key=0x6565dc10 <key_128.65421>
"\350\351\352\353\355\356\357\360\362\363\364\365\367\370\371\372\001K\257\"x\246\235\063\035Q\200\020\066C\351\232gC\303\321Q\232\264\362͚x\253\t\245\021\275]\036\362\r\316ּ\274\022\023\032\307\305G\210\252\b\016\225\027\353\026wq\232\317r\200\206\004",
<incomplete sequence \343>, keylen=16)
at
/home/aheinecke/arbeit/gpg4win/src/gnupg-w32-2.1.7/PLAY/src/libgcrypt/cipher/rijndael.c:668
ctx = 0xc6f868
...
info registers
eax 0x6565dc10 1701174288
ecx 0xd25110 13783312
edx 0xc6f868 13039720
ebx 0x0 0
esp 0xc6f760 0xc6f760
ebp 0xc6f760 0xc6f760
esi 0x0 0
edi 0xd24478 13780088
eip 0x655ea3e9 0x655ea3e9 <aesni_do_setkey+31>
eflags 0x10297 [ CF PF AF SF IF RF ]
cs 0x1b 27
ss 0x23 35
ds 0x23 35
es 0x23 35
fs 0x3b 59
gs 0x0 0
disas 0x655ea3e2,0x655ea3ff
Dump of assembler code from 0x655ea3e2 to 0x655ea3ff:
0x655ea3e2 <aesni_do_setkey+24>: mov 0xc(%ebp),%eax 0x655ea3e5 <aesni_do_setkey+27>: movdqu (%eax),%xmm1
> 0x655ea3e9 <aesni_do_setkey+31>: movdqa %xmm1,(%edx)
0x655ea3ed <aesni_do_setkey+35>: aeskeygenassist $0x1,%xmm1,%xmm2 0x655ea3f3 <aesni_do_setkey+41>: pshufd $0xff,%xmm2,%xmm2 0x655ea3f8 <aesni_do_setkey+46>: movdqa %xmm1,%xmm3 0x655ea3fc <aesni_do_setkey+50>: pslldq $0x4,%xmm3
It appears to be that this is crash is due to the fact that windows uses a 4
Byte stack alignment and the movdqa call expects 16 byte alignment.
I've found some info on this here:
http://www.peterstock.co.uk/games/mingw_sse/
I also confirmed that with "-mstackrealign" the crash no longer happens.
Werner: should we add this globaly to the configure options of gcrypt or do you
have a better fix for this?