Bug 372828

Summary: vex amd64->IR: unhandled instruction bytes: 0x66 0x4D 0xF 0x38 0xF6 0xD2 0x66 0x4D (adcx)
Product: [Developer tools] valgrind Reporter: mail
Component: vexAssignee: Ivo Raisr <ivosh>
Status: RESOLVED DUPLICATE    
Severity: normal CC: ivosh
Priority: NOR    
Version: 3.12 SVN   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description mail 2016-11-23 10:05:58 UTC
Hi,

the illegal instruction seen to come from GMP's function  __gmpn_sqr_basecase

GMP version: 6.1.1 compiled from source


vex amd64->IR: unhandled instruction bytes: 0x66 0x4D 0xF 0x38 0xF6 0xD2 0x66 0x4D
vex amd64->IR:   REX=1 REX.W=1 REX.R=1 REX.X=0 REX.B=1
vex amd64->IR:   VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F38
vex amd64->IR:   PFX.66=1 PFX.F2=0 PFX.F3=0
==11182== valgrind: Unrecognised instruction at address 0x4e64ac2.
==11182==    at 0x4E64AC2: __gmpn_sqr_basecase (in /home/cyril/lib/libgmp.so.10.3.1)
==11182==    by 0x4E8C22F: __gmpn_powm (in /home/xxxxx/lib/libgmp.so.10.3.1)
==11182==    by 0x4E55FB3: __gmpz_powm (in /home/xxxxx/lib/libgmp.so.10.3.1)
==11182==    by 0x4E5470C: __gmpz_millerrabin (in home/xxxxxx/lib/libgmp.so.10.3.1)
==11182==    by 0x4E57B41: __gmpz_probab_prime_p (in /home/xxxxxx/lib/libgmp.so.10.3.1)



$ uname -a
Linux zaphod 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux
Comment 1 Ivo Raisr 2017-05-05 15:52:46 UTC
Please could you report which unhandled instruction is this? You can use gdb or objdump, for example.
Comment 2 mail 2017-05-09 08:19:15 UTC
(In reply to Ivo Raisr from comment #1)
> Please could you report which unhandled instruction is this? You can use gdb
> or objdump, for example.

Hi,

Can you be more specific on how to use gdb or objdump to find the illegal instruction ?

Thanks,
Cyril.
Comment 3 Ivo Raisr 2017-05-09 08:23:34 UTC
For example with objdump:
    objdump -d /home/xxxxx/lib/libgmp.so.10.3.1 | grep '66 4d 0f 38 f6 d2 66 4d'

and the instruction name should be right after the byte sequence.
Comment 4 mail 2017-05-09 08:43:07 UTC
Hope it can help :

> objdump -d libgmp.so.10.3.1 | grep '66 4d 0f 38 f6 d2'
   2cac2:	66 4d 0f 38 f6 d2    	adcx   %r10,%r10

Cyril
Comment 5 Ivo Raisr 2017-05-09 08:53:27 UTC
Yes, it indeed does. Thank you.
Comment 6 Ivo Raisr 2017-05-09 08:55:46 UTC
This bug is a duplicate of:
360415 amd64 instructions ADCX and ADOX are not implemented in VEX
Comment 7 Ivo Raisr 2017-05-09 08:56:54 UTC

*** This bug has been marked as a duplicate of bug 360415 ***