Bug 273729 - Illegal opcode for SSE2 "roundsd" instruction
Summary: Illegal opcode for SSE2 "roundsd" instruction
Status: RESOLVED DUPLICATE of bug 283000
Alias: None
Product: valgrind
Classification: Developer tools
Component: vex (show other bugs)
Version: 3.6.0
Platform: Unlisted Binaries Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-20 15:12 UTC by Federico Ficarelli
Modified: 2011-10-19 20:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Federico Ficarelli 2011-05-20 15:12:52 UTC
Dear Valgrind developers,
we are facing the following problem using valgrind 3.6.0 and 3.6.1 on
this cpu and system:

/proc/cpuinfo:  Intel(R) Xeon(R) CPU           X5570  @ 2.93GHz
uname -a:       Linux node363 2.6.18-128.el5 #1 SMP Wed Dec 17 11:41:38
EST 2008 x86_64 x86_64 x86_64 GNU/Linux

Running Valgrind on a code which links the Intel MKL library we end up
with the following error:

vex amd64->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0xB 0xC0 0xC
==12289== valgrind: Unrecognised instruction at address 0x515ec89.
==12289== Your program just tried to execute an instruction that Valgrind
==12289== did not recognise.  There are two possible reasons for this.
==12289== 1. Your program has a bug and erroneously jumped to a non-code
==12289==    location.  If you are running Memcheck and you just saw a
==12289==    warning about a bad jump, it's probably your program's fault.
==12289== 2. The instruction is legitimate but Valgrind doesn't handle it,
==12289==    i.e. it's Valgrind's fault.  If you think this is the case or
==12289==    you are not sure, please let us know and we'll try to fix it.
==12289== Either way, Valgrind will now raise a SIGILL signal which will
==12289== probably kill your program.
==12289==
==12289== Process terminating with default action of signal 4 (SIGILL)
==12289==  Illegal opcode at address 0x515EC89
==12289==    at 0x515EC89: nearbyint.N (in
/gpfs/prod/compilers/intel/co-2011.2.137/binary/composerxe-2011.2.137/compiler/lib/intel64/libimf.so)

...and this is the code inside the MKL SSE-tuned function "nearbyint.N":

0000000000125c80 <nearbyint.N>:
  125c80:       f3 0f 7e c8             movq   %xmm0,%xmm1
  125c84:       f2 0f c2 c8 00          cmpeqsd %xmm0,%xmm1
  125c89:       66 0f 3a 0b c0 0c       roundsd $0xc,%xmm0,%xmm0
  125c8f:       c3                      retq

We suppose that SSE2's "roundsd" instruction is the problem.
We have found a similar bug report
(http://bugs.kde.org/show_bug.cgi?id=197266) that seems to be already fixed
around a year ago. The SSE instruction was the same (roundsd) but the
opcode is slightly different due to different operand values (XMM
registers configuration and rounding mode).

Thank you, please keep in touch.
Greetings from Italy,
Federico and Cristiano.

====================================================
Federico Ficarelli, Software Engineer
  High Performance Computing Dept.
  CINECA, Italy - www.cineca.it
  +390516171382 | f.ficarelli at cineca dot it
====================================================
Comment 1 Julian Seward 2011-10-19 20:50:55 UTC
This is fixed in the trunk; the root bug was 283000.

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