CRASH x64 drinject stack mis-alignment: instr_create_restore_from_dc_via_reg()
From derek.br...@gmail.com on February 15, 2009 15:49:30
Just running release build x64 drinject on suite/tests/client-interface/strace I hit a somewhat non-deterministic crash: only happens within test harness. The problem is that drinject is not aligning the stack to 16 for the 3 calls it makes. The crash shows up like this:
(adc.158): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
dynamorio!instr_create_restore_from_dc_via_reg+0x10c:
000000007107fb2c 0f28442420 movaps xmm0,xmmword ptr [rsp+20h] ss:00000000
0012fa68=0000000800000128000000001f009006
0:000> kn
Child-SP RetAddr Call Site
00 000000000012fa48 00000000
71066448
dynamorio!instr_create_restore_from_dc_via_reg+0x10c
[d:\derek\opensource\dynamorio\core\x86\instr.c @ 4818]
01 000000000012fa98 00000000
71068ab4
dynamorio!emit_fcache_enter_common+0x128
[d:\derek\opensource\dynamorio\core\x86\emit_utils.c @ 3173]
02 000000000012fc78 00000000
7105b103
dynamorio!emit_fcache_enter_shared+0x14
[d:\derek\opensource\dynamorio\core\x86\emit_utils.c @ 3825]
03 000000000012fcb8 00000000
7105b7c0 dynamorio!shared_gencode_init+0x113
[d:\derek\opensource\dynamorio\core\x86\arch.c @ 308]
04 000000000012fd48 00000000
7102470b dynamorio!arch_init+0x10
[d:\derek\opensource\dynamorio\core\x86\arch.c @ 523]
05 000000000012fd78 00000000
71090562 dynamorio!dynamorio_app_init+0x10b
[d:\derek\opensource\dynamorio\core\dynamo.c @ 463]
06 000000000012fde8 00000000
71093a00 dynamorio!auto_setup+0x22
[d:\derek\opensource\dynamorio\core\x86\x86_code.c @ 144]
07 000000000012fe28 00000000
00000000 dynamorio!dynamo_auto_start+0x10
0:000> r
rax=0000000000000000 rbx=000000001f602270 rcx=ffffffffffffffff
rdx=0000000000000068 rsi=ffffffffffffffff rdi=ffffffffffffffff
rip=000000007107fb2c rsp=000000000012fa48 rbp=0000000000000000 r8 =000000001f5d2111 r9 =0000000000000128 r10 =0000000000000000 r11 =000000000012fbb8 r12 =0000000000000000 r13 =0000000000000000 r14 =000000001f601570 r15 =000000001f602280
iopl=0 nv up ei pl zr na po nc
cs=0033 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246
dynamorio!instr_create_restore_from_dc_via_reg+0x10c:
000000007107fb2c 0f28442420 movaps xmm0,xmmword ptr [rsp+20h] ss:00000000
0012fa68=0000000800000128000000001f009006
Original issue: http://code.google.com/p/dynamorio/issues/detail?id=13