|
From: Markus T. <mar...@st...> - 2016-08-24 09:39:07
|
Heyho,
when running valgrind on an application linking to libgcrypt, I get the
following error:
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
==10769== valgrind: Unrecognised instruction at address 0x60082d3.
==10769== at 0x60082D3: poll_drng.isra.0 (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x6008389: _gcry_rndhw_poll_fast (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x6004AF4: do_fast_random_poll (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x600546B: _gcry_rngcsprng_fast_poll (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x5F57912: _gcry_vcontrol (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x5F54390: gcry_control (in /usr/lib64/libgcrypt.so.20.1.3)
==10769== by 0x507FBC6: GNUNET_CRYPTO_random_init (crypto_random.c:301)
==10769== by 0x400F269: call_init.part.0 (in /lib64/ld-2.22.so)
==10769== by 0x400F37A: _dl_init (in /lib64/ld-2.22.so)
==10769== by 0x4000C79: ??? (in /lib64/ld-2.22.so)
I have a x86_64 gentoo system with valgrind-3.11.0 and libgcrypt-1.7.3 installed.
The CFLAGS from my make.conf are:
CFLAGS="-O2 -pipe"
CFLAGS="${CFLAGS} -march=core-avx2 -mtune=core-avx2 -mcx16 -msahf -mmovbe -maes"
CFLAGS="${CFLAGS} -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop"
CFLAGS="${CFLAGS} -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt"
CFLAGS="${CFLAGS} -mrdrnd -mf16c -mfsgsbase --param l1-cache-size=32"
CFLAGS="${CFLAGS} --param l1-cache-line-size=64 --param l2-cache-size=4096"
Please keep me in the CC in your replies, since I am no list member.
--Markus
|
|
From: John R. <jr...@bi...> - 2016-08-24 15:02:24
|
Markus Teich wrote:
> 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
> ==10769== valgrind: Unrecognised instruction at address 0x60082d3.
> ==10769== at 0x60082D3: poll_drng.isra.0 (in /usr/lib64/libgcrypt.so.20.1.3)
> I have a x86_64 gentoo system with valgrind-3.11.0 and libgcrypt-1.7.3 installed.
> The CFLAGS from my make.conf are:
>
> CFLAGS="-O2 -pipe"
> CFLAGS="${CFLAGS} -march=core-avx2 -mtune=core-avx2 -mcx16 -msahf -mmovbe -maes"
> CFLAGS="${CFLAGS} -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop"
> CFLAGS="${CFLAGS} -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt"
> CFLAGS="${CFLAGS} -mrdrnd -mf16c -mfsgsbase --param l1-cache-size=32"
> CFLAGS="${CFLAGS} --param l1-cache-line-size=64 --param l2-cache-size=4096"
gdb says that the bytes 0xF 0xC7 0xF0 are "rdrand %rax". Evidently valgrind's libVEX
does not know about this, or perhaps the preceding 0x48 prefix has confused valgrind.
[gdb 7.9.1-20.fc22 didn't know how to interpret 0x48 0xF 0xC7 0xF0, either.]
So, please file a bug at http://valgrind.org/support/bug_reports.html .
Just copy+paste your original message into the bug report, and give a title
such as "rdrand not recognized on amd64". Give the version of your compiler, too:
the output from "gcc --version" .
Meanwhile, it should be possible to make progress by avoiding the 'rdrand' instruction.
Is there some application flag or environment variable which says "do not use
the hardware random number generator?"
After that, try rebuilding libgcrypt-1.7.3 without "-mrdrnd".
--
|
|
From: Mark W. <mj...@re...> - 2016-08-24 15:54:23
|
On Wed, 2016-08-24 at 07:42 -0700, John Reiser wrote:
> Markus Teich wrote:
>
> > 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
> > ==10769== valgrind: Unrecognised instruction at address 0x60082d3.
> > ==10769== at 0x60082D3: poll_drng.isra.0 (in /usr/lib64/libgcrypt.so.20.1.3)
>
> > I have a x86_64 gentoo system with valgrind-3.11.0 and libgcrypt-1.7.3 installed.
> > The CFLAGS from my make.conf are:
> >
> > CFLAGS="-O2 -pipe"
> > CFLAGS="${CFLAGS} -march=core-avx2 -mtune=core-avx2 -mcx16 -msahf -mmovbe -maes"
> > CFLAGS="${CFLAGS} -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop"
> > CFLAGS="${CFLAGS} -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt"
> > CFLAGS="${CFLAGS} -mrdrnd -mf16c -mfsgsbase --param l1-cache-size=32"
> > CFLAGS="${CFLAGS} --param l1-cache-line-size=64 --param l2-cache-size=4096"
>
> gdb says that the bytes 0xF 0xC7 0xF0 are "rdrand %rax". Evidently valgrind's libVEX
> does not know about this, or perhaps the preceding 0x48 prefix has confused valgrind.
> [gdb 7.9.1-20.fc22 didn't know how to interpret 0x48 0xF 0xC7 0xF0, either.]
This is https://bugs.kde.org/show_bug.cgi?id=353370 fixed in VEX svn
r3197.
|
|
From: Markus T. <mar...@st...> - 2016-08-24 20:50:52
|
Mark Wielaard wrote: > This is https://bugs.kde.org/show_bug.cgi?id=353370 fixed in VEX svn r3197. Heyho, thanks for the hint. When can we expect a new release containing the fix? 3.11.0 is nearly a year old now. --Markus |
|
From: Mark W. <mj...@re...> - 2016-08-24 22:39:20
|
On Wed, 2016-08-24 at 22:50 +0200, Markus Teich wrote: > When can we expect a new release containing the fix? 3.11.0 > is nearly a year old now. Hopefully in ~3 weeks. But Julian is the release master and he is away this week. So when he returns he might give you a slightly different estimate. You can help by building and testing valgrind from svn! Seriously, if you are able to build and test valgrind svn on your programs and let us know if you find any issues/regressions that would be appreciated. Thanks, Mark |
|
From: Markus T. <mar...@st...> - 2016-08-25 12:28:12
|
Heyho, John Reiser wrote: > Meanwhile, it should be possible to make progress by avoiding the 'rdrand' > instruction. Is there some application flag or environment variable which > says "do not use the hardware random number generator?" After that, try > rebuilding libgcrypt-1.7.3 without "-mrdrnd". surprisingly disabling the drnd feature in my make.conf and rebuilding libgcrypt did not solve the issue. Mark Wielaard wrote: > You can help by building and testing valgrind from svn! Seriously, if you are > able to build and test valgrind svn on your programs and let us know if you > find any issues/regressions that would be appreciated. I'll try to build it manually then. I'll let you know if I find something. --Markus |