https://bugs.kde.org/show_bug.cgi?id=360415

--- Comment #4 from Jeffrey Walton <noloa...@gmail.com> ---
I'm working from the SVN sources, and the issue still exists. It appears
something is amiss with the patch.

The program was built with Clang on a Skylake machine. Its not in the big
integer part of the library. Clang is using it for regular math.

**********

Here's what GDB shows:

Breakpoint 2, ECP::EncodedPointSize (this=0x7fffffffb3f8,
    compressed=0x0) at ./ecp.h:75
75                      {return 1 +
(compressed?1:2)*GetField().MaxElementByteLength();}
(gdb) disass
Dump of assembler code for function ECP::EncodedPointSize(bool) const:
=> 0x0000000000594750 <+0>:     push   %rbx
   0x0000000000594751 <+1>:     xor    %eax,%eax
   0x0000000000594753 <+3>:     cmp    $0x1,%sil
   0x0000000000594757 <+7>:     mov    $0x1,%ebx
   0x000000000059475c <+12>:    adcx   %eax,%ebx
   0x0000000000594761 <+17>:    callq  0x475eb0 <ECP::GetField() const>
   0x0000000000594766 <+22>:    mov    %rax,%rdi
   0x0000000000594769 <+25>:    callq  0x521020
<ModularArithmetic::MaxElementByteLength() const>
   0x000000000059476e <+30>:    imul   %ebx,%eax
   0x0000000000594771 <+33>:    add    $0x1,%eax
   0x0000000000594774 <+36>:    pop    %rbx
   0x0000000000594775 <+37>:    retq
End of assembler dump.


**********

Here's what Valgrind shows:

valgrind ./cryptest.exe v
...

HMQV validation suite running...

vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x38 0xF6 0xD8 0xE8 0x4A
0x17 0xEE 0xFF
vex amd64->IR:   REX=0 REX.W=0 REX.R=0 REX.X=0 REX.B=0
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
==12079== valgrind: Unrecognised instruction at address 0x59475c.
==12079==    at 0x59475C: ECP::EncodedPointSize(bool) const (ecp.h:75)
==12079==    by 0x591A3B: ECP::DecodePoint(ECPPoint&, BufferedTransformation&,
unsigned long) const (ecp.cpp:107)
==12079==    by 0x5917DD: ECP::DecodePoint(ECPPoint&, unsigned char const*,
unsigned long) const (ecp.cpp:69)
==12079==    by 0x591D66: ECP::BERDecodePoint(BufferedTransformation&) const
(ecp.cpp:151)
==12079==    by 0x54E3EA:
DL_GroupParameters_EC<ECP>::BERDecode(BufferedTransformation&)
(eccrypto.cpp:534)
==12079==    by 0x4AAF77: Test::ValidateHMQV() (validat2.cpp:392)
==12079==    by 0x48201A: Test::ValidateAll(bool) (validat1.cpp:162)
==12079==    by 0x4369B6: Validate(int, bool, char const*) (test.cpp:916)
==12079==    by 0x432FE4: main (test.cpp:406)
==12079== Your program just tried to execute an instruction that Valgrind
==12079== did not recognise.  There are two possible reasons for this.
==12079== 1. Your program has a bug and erroneously jumped to a non-code
==12079==    location.  If you are running Memcheck and you just saw a
==12079==    warning about a bad jump, it's probably your program's fault.
==12079== 2. The instruction is legitimate but Valgrind doesn't handle it,
==12079==    i.e. it's Valgrind's fault.  If you think this is the case or
==12079==    you are not sure, please let us know and we'll try to fix it.
==12079== Either way, Valgrind will now raise a SIGILL signal which will
==12079== probably kill your program.
==12079==
==12079== Process terminating with default action of signal 4 (SIGILL)
==12079==  Illegal opcode at address 0x59475C
==12079==    at 0x59475C: ECP::EncodedPointSize(bool) const (ecp.h:75)
==12079==    by 0x591A3B: ECP::DecodePoint(ECPPoint&, BufferedTransformation&,
unsigned long) const (ecp.cpp:107)
==12079==    by 0x5917DD: ECP::DecodePoint(ECPPoint&, unsigned char const*,
unsigned long) const (ecp.cpp:69)
==12079==    by 0x591D66: ECP::BERDecodePoint(BufferedTransformation&) const
(ecp.cpp:151)
==12079==    by 0x54E3EA:
DL_GroupParameters_EC<ECP>::BERDecode(BufferedTransformation&)
(eccrypto.cpp:534)
==12079==    by 0x4AAF77: Test::ValidateHMQV() (validat2.cpp:392)
==12079==    by 0x48201A: Test::ValidateAll(bool) (validat1.cpp:162)
==12079==    by 0x4369B6: Validate(int, bool, char const*) (test.cpp:916)
==12079==    by 0x432FE4: main (test.cpp:406)
==12079==
==12079== HEAP SUMMARY:
==12079==     in use at exit: 69,547 bytes in 538 blocks
==12079==   total heap usage: 210,211 allocs, 209,673 frees, 67,196,780 bytes
allocated
==12079==
==12079== LEAK SUMMARY:
==12079==    definitely lost: 0 bytes in 0 blocks
==12079==    indirectly lost: 0 bytes in 0 blocks
==12079==      possibly lost: 0 bytes in 0 blocks
==12079==    still reachable: 69,547 bytes in 538 blocks
==12079==         suppressed: 0 bytes in 0 blocks
==12079== Rerun with --leak-check=full to see details of leaked memory
==12079==
==12079== For counts of detected and suppressed errors, rerun with: -v
==12079== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction (core dumped)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to