ASSERT from non-existent AVX-512 K register decoded for non-code
Xref #3713. Just like that issue, this is blocking a tool, drstrace in this case:
0:000> U 0x0000018f`5665c0e8
0000018f`5665c0e8 c5 ???
0000018f`5665c0e9 a046568f010000ce9f mov al,byte ptr [9FCE0000018F5646h]
0000018f`5665c0f2 4656 push rsi
0000018f`5665c0f4 8f01 pop qword ptr [rcx]
0000018f`5665c0f6 0000 add byte ptr [rax],al
0d 00000081`ad7d9060 00007ff7`e970b832 drstrace!abort+0x24 [f:\dd\vctools\crt\crtw32\misc\abort.c @ 72]
0e 00000081`ad7d90a0 00007ff7`e970b43d drstrace!external_error+0x32 [d:\derek\drmemory\git\src\dynamorio\core\arch\decodelib.c @ 133]
0f 00000081`ad7d90d0 00007ff7`e9723720 drstrace!opnd_create_reg+0x5d [d:\derek\drmemory\git\src\dynamorio\core\arch\instr_inline.h @ 204]
10 00000081`ad7d9130 00007ff7`e9723c8a drstrace!decode_operand+0x12b0 [d:\derek\drmemory\git\src\dynamorio\core\arch\x86\decode.c @ 2148]
11 00000081`ad7d9470 00007ff7`e971cbec drstrace!decode_common+0x38a [d:\derek\drmemory\git\src\dynamorio\core\arch\x86\decode.c @ 2543]
12 00000081`ad7d96d0 00007ff7`e96d8598 drstrace!decode+0x2c [d:\derek\drmemory\git\src\dynamorio\core\arch\x86\decode.c @ 2672]
13 00000081`ad7d9700 00007ff7`e96d8b23 drstrace!get_syscall_num+0xa8 [d:\derek\drmemory\git\src\drsyscall\pdb2sysfile.cpp @ 666]
14 00000081`ad7d9850 00007ff7`e973ef16 drstrace!search_syms_cb+0xf3 [d:\derek\drmemory\git\src\drsyscall\pdb2sysfile.cpp @ 784]
15 00000081`ad7d9940 00007ff9`aea2bd9e drstrace!enum_cb+0x136 [d:\derek\drmemory\git\src\dynamorio\ext\drsyms\drsyms_windows.c @ 779]
16 00000081`ad7d9990 00007ff9`aea1b3db dbghelp!DoEnumCallback+0x232
17 00000081`ad7daa10 00007ff9`aea1b98e dbghelp!diaEnumScope+0x157
18 00000081`ad7daa90 00007ff9`aea1bf2e dbghelp!diaSearchAll+0xda
19 00000081`ad7dab30 00007ff9`aea3d3ef dbghelp!diaSearch+0x12a
1a 00000081`ad7dbb70 00007ff9`aea2c1f4 dbghelp!modSearch+0xa3
1b 00000081`ad7dbbd0 00007ff9`aea31a56 dbghelp!ModLoop+0x100
1c 00000081`ad7dbc50 00007ff9`aea31b30 dbghelp!SearchSymbols+0x14e
1d 00000081`ad7ddc60 00007ff7`e973f501 dbghelp!SymSearch+0xa4
1e 00000081`ad7ddce0 00007ff7`e973d7c3 drstrace!drsym_search_symbols_local+0x2d1 [d:\derek\drmemory\git\src\dynamorio\ext\drsyms\drsyms_windows.c @ 914]
1f 00000081`ad7ddda0 00007ff7`e96d9024 drstrace!drsym_search_symbols+0x83 [d:\derek\drmemory\git\src\dynamorio\ext\drsyms\drsyms_windows.c @ 1496]
20 00000081`ad7dde00 00007ff7`e96d62ce drstrace!identify_syscalls+0x334 [d:\derek\drmemory\git\src\drsyscall\pdb2sysfile.cpp @ 837]
21 00000081`ad7ddfb0 00007ff7`e96a4b4f drstrace!drsys_generate_sysnum_file+0x10e [d:\derek\drmemory\git\src\drsyscall\pdb2sysfile.cpp @ 956]
0:000> dv
r = 0x147
opnd = struct _opnd_t
0:000> ?? r
unsigned short 0x147
0:000> .formats @@(r)
Evaluate expression:
Hex: 00000000`00000147
Decimal: 327
0:000> ?? DR_REG_K7
<unnamed-enum-DR_REG_NULL> DR_REG_K7 (0n323)
0:000> dv
di = 0x00000081`ad7d9520
optype = 0x38 '8'
opsize = 0x03 ''
opnd = 0x00000081`ad7d95b0
ressize = 0x03 ''
0:000> .formats @@(optype)
Evaluate expression:
Hex: 00000000`00000038
Decimal: 56
0:000> ?? TYPE_K_VEX
<unnamed-enum-TYPE_NONE> TYPE_K_VEX (0n56)
0:000> ?? (~di->evex_vvvv) & 0xf
unsigned int 0xb
This blocks drstrace from generating a syscall file, just like in #3713. But here the assert is legitimate: it's the decoding of the TYPE_K_VEX register that produces a non-existent K register.