Discussion:
[valgrind] [Bug 353370] New: amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0 0x72 0x4 0xFF 0xC9
Add Reply
Andrei Voropaev
2015-09-30 13:06:00 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Bug ID: 353370
Summary: amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7
0xF0 0x72 0x4 0xFF 0xC9
Product: valgrind
Version: 3.10 SVN
Platform: Gentoo Packages
OS: Linux
Status: UNCONFIRMED
Severity: grave
Priority: NOR
Component: vex
Assignee: ***@acm.org
Reporter: ***@gmail.com

Newest version 3.11 stopped handling some instruction. Version 3.10 works
without any problems. Version 3.11 aborts application with message

vex amd64->IR: unhandled instruction bytes: 0x48 0xF 0xC7 0xF0 0x72 0x4 0xFF
0xC9
vex amd64->IR: REX=1 REX.W=1 REX.R=0 REX.X=0 REX.B=0
vex amd64->IR: VEX=0 VEX.L=0 VEX.nVVVV=0x0 ESC=0F
vex amd64->IR: PFX.66=0 PFX.F2=0 PFX.F3=0
==24113== valgrind: Unrecognised instruction at address 0x519ac23.
==24113== at 0x519AC23: poll_drng.isra.0 (in /usr/lib64/libgcrypt.so.20.0.3)
==24113== by 0x519AE6B: _gcry_rndlinux_gather_random (in
/usr/lib64/libgcrypt.so.20.0.3)
==24113== by 0x51981FF: read_random_source (in
/usr/lib64/libgcrypt.so.20.0.3)
==24113== by 0x51992AB: _gcry_rngcsprng_randomize (in
/usr/lib64/libgcrypt.so.20.0.3)
==24113== by 0x5198074: _gcry_create_nonce (in
/usr/lib64/libgcrypt.so.20.0.3)
....



Reproducible: Always

Steps to Reproduce:
1. Start application that uses gcrypt under Valgrind 3.11
2.
3.

Actual Results:
Valgrind fails to recognize instruction and issues SIGKILL

Expected Results:
Valgrind runs without any complaints

I'm using gcc (Gentoo 4.8.5 p1.3, pie-0.6.2) 4.8.5 to compile binaries. The
libraries are compiled with flags -march=native -O2 -pipe. My CPU model_name is
Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2015-09-30 13:58:11 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@compton.nu

--- Comment #1 from Tom Hughes <***@compton.nu> ---
I suspect it's more likely that a change to the declared CPUID has caused your
program to execute instructions it didn't try and execute before.

The instruction here is RDRAND but with a REX prefix that sets REX.W to get 64
bit operation.
--
You are receiving this mail because:
You are watching all bug changes.
Andrei Voropaev
2015-09-30 14:39:13 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

--- Comment #2 from Andrei Voropaev <***@gmail.com> ---
Hm. What do you mean with the "change to the declared CPUID"?
Definitely I didn't change anything except for Valgrind. If I revert
back to version 3.10 (which I did now) then things work. With version
3.11 Valgrind becomes unusable.

After all, I don't really care what is causing this problem. I just
would like to keep using newer versions of Valgrind and not get stuck
with old one :)
Post by Andrei Voropaev
https://bugs.kde.org/show_bug.cgi?id=353370
What |Removed |Added
----------------------------------------------------------------------------
I suspect it's more likely that a change to the declared CPUID has caused your
program to execute instructions it didn't try and execute before.
The instruction here is RDRAND but with a REX prefix that sets REX.W to get 64
bit operation.
--
You reported the bug.
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2015-09-30 14:54:25 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

--- Comment #3 from Tom Hughes <***@compton.nu> ---
I mean that valgrind has potentially changed the CPU features that it
advertises to your program - because it is a virtualised CPU it advertises one
of a small number of standard feature sets rather than what your CPU natively
declares.
--
You are receiving this mail because:
You are watching all bug changes.
Florian Krohm
2015-09-30 15:25:30 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Florian Krohm <***@eich-krohm.de> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@eich-krohm.de

--- Comment #4 from Florian Krohm <***@eich-krohm.de> ---
Can you provide the following info:

(1) cat /proc/cpuinfo
(2) valgrind -d -v date 2> blah; grep hwcaps blah
both for 3.10.x and 3.11.0
--
You are receiving this mail because:
You are watching all bug changes.
Andrei Voropaev
2015-10-01 06:49:06 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370
Post by Florian Krohm
valgrind -d -v date 2> blah; grep hwcaps blah
See attached.
--
You are receiving this mail because:
You are watching all bug changes.
Andrei Voropaev
2015-10-01 06:49:09 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

--- Comment #6 from Andrei Voropaev <***@gmail.com> ---
Created attachment 94791
--> https://bugs.kde.org/attachment.cgi?id=94791&action=edit
hwcaps.3_10

--- Comment #7 from Andrei Voropaev <***@gmail.com> ---
Created attachment 94792
--> https://bugs.kde.org/attachment.cgi?id=94792&action=edit
hwcaps.3_11
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2015-10-01 07:29:32 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #94791|application/octet-stream |text/plain
mime type| |
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2015-10-01 07:29:51 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
Attachment #94792|application/octet-stream |text/plain
mime type| |
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2015-10-01 09:27:15 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@redhat.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@redhat.com

--- Comment #8 from Mark Wielaard <***@redhat.com> ---
We seem to advertise RDRAND in cpuid:

valgrind -q cpuid | grep RDRAND
RDRAND instruction = true

But cannot find where we implement it.
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2015-10-01 09:40:44 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@redhat.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|amd64->IR: unhandled |RDRAND amd64->IR: unhandled
|instruction bytes: 0x48 0xF |instruction bytes: 0x48 0xF
|0xC7 0xF0 0x72 0x4 0xFF |0xC7 0xF0 0x72 0x4 0xFF
|0xC9 |0xC9

--- Comment #9 from Mark Wielaard <***@redhat.com> ---
Since we don't implement RDRAND we shouldn't advertise it. Does the following
patch help?

diff --git a/priv/guest_amd64_helpers.c b/priv/guest_amd64_helpers.c
index e77d753..ab53e15 100644
--- a/priv/guest_amd64_helpers.c
+++ b/priv/guest_amd64_helpers.c
@@ -3101,7 +3101,8 @@ void amd64g_dirtyhelper_CPUID_avx2 ( VexGuestAMD64State*
st )
SET_ABCD(0x0000000d, 0x756e6547, 0x6c65746e, 0x49656e69);
break;
case 0x00000001:
- SET_ABCD(0x000306c3, 0x02100800, 0x7ffafbff, 0xbfebfbff);
+ /* Don't advertise RDRAND support, bit 30 in ECX. */
+ SET_ABCD(0x000306c3, 0x02100800, 0x3ffafbff, 0xbfebfbff);
break;
case 0x00000002:
SET_ABCD(0x76036301, 0x00f0b6ff, 0x00000000, 0x00c10000);
--
You are receiving this mail because:
You are watching all bug changes.
Andrei Voropaev
2015-10-01 12:17:27 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370
Post by Mark Wielaard
guest_amd64_helpers.c
Yes. this patch fixes the problem.

Thank you
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2015-10-01 12:36:12 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@redhat.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED

--- Comment #11 from Mark Wielaard <***@redhat.com> ---
Thanks for reporting and checking.
Fix pushed as VEX svn r3197
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard via KDE Bugzilla
2016-01-12 14:45:36 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@redhat.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #12 from Mark Wielaard <***@redhat.com> ---
*** Bug 357873 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes via KDE Bugzilla
2016-02-04 16:34:28 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@opera.com

--- Comment #13 from Tom Hughes <***@compton.nu> ---
*** Bug 358988 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Julian Seward via KDE Bugzilla
2016-09-14 14:46:25 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Julian Seward <***@acm.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@kinomoto.me

--- Comment #14 from Julian Seward <***@acm.org> ---
*** Bug 365325 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2017-02-01 15:53:09 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@tycoint.com

--- Comment #15 from Tom Hughes <***@compton.nu> ---
*** Bug 375845 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2017-03-27 23:33:37 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #16 from Tom Hughes <***@compton.nu> ---
*** Bug 378180 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2017-06-26 22:38:50 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@klomp.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #17 from Mark Wielaard <***@klomp.org> ---
*** Bug 381699 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2018-04-18 11:30:48 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@mit.edu

--- Comment #18 from Tom Hughes <***@compton.nu> ---
*** Bug 387940 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-06-08 16:27:06 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

***@gmail.com changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2018-06-24 08:45:11 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@klomp.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gm
| |ail.com

--- Comment #19 from Mark Wielaard <***@klomp.org> ---
*** Bug 395809 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Tom Hughes
2018-07-04 23:14:09 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Tom Hughes <***@compton.nu> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |cJ-***@zougloub.eu

--- Comment #20 from Tom Hughes <***@compton.nu> ---
*** Bug 396176 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2018-10-25 17:34:33 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@klomp.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@enervision.
| |de

--- Comment #21 from Mark Wielaard <***@klomp.org> ---
*** Bug 400279 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Mark Wielaard
2018-12-07 08:05:17 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=353370

Mark Wielaard <***@klomp.org> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@prenav.com

--- Comment #22 from Mark Wielaard <***@klomp.org> ---
*** Bug 401846 has been marked as a duplicate of this bug. ***
--
You are receiving this mail because:
You are watching all bug changes.
Loading...