Valgrind未处理的指令字节:: 0x8F 0xEA 0xF8 0x10 0xC9 0x3 0x1D 0x0

时间:2016-08-07 06:27:28

标签: linux valgrind unhandled

当我编译我的C程序并在valgrind下运行时,我有以下错误:

vex amd64->IR: unhandled instruction bytes: 0x8F 0xEA 0xF8 0x10 0xC9 0x3 0x1D 0x0
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=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==6097== valgrind: Unrecognised instruction at address 0x4011d34.
==6097==    at 0x4011D34: _dl_allocate_tls_storage (dl-tls.c:379)
==6097==    by 0x4000B9A: init_tls (rtld.c:622)
==6097==    by 0x40034BF: dl_main (rtld.c:1683)
==6097==    by 0x40169A8: _dl_sysdep_start (dl-sysdep.c:249)
==6097==    by 0x4004C30: _dl_start_final (rtld.c:307)
==6097==    by 0x4004C30: _dl_start (rtld.c:413)
==6097==    by 0x4000C47: ??? (in /lib64/ld-2.22.so)
...
==6097== For counts of detected and suppressed errors, rerun with: -v
==6097== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Segmentation fault

我的系统信息:

  

Linux 4.1.15-gentoo-r1#3 SMP x86_64 AMD Opteron(tm)处理器6320   AuthenticAMD GNU / Linux

我知道有一些与教学有关的东西。我按照这个链接 Bug 563796 - dev-util/valgrind: doesn't support TBM instructions并添加到我的Makefile CFLAGS -march=native -mno-tbm,甚至是-msse2-msse3,但我仍然遇到同样的错误。

我认为没有内存泄漏,因为我用不同的系统编译它运行正常。有没有办法摆脱错误并让valgrind工作?

1 个答案:

答案 0 :(得分:1)

尽管您使用-march=native -mno-tbm编译应用程序,但您仍然容易出现同样的问题,因为您的所有系统都是在没有-mno-tbm的情况下编译的,包括{{ 1}}代码,这是导致问题的原因。

您需要将glibc添加到-march=native -mno-tbm下的CFLAGS,然后显示/etc/portage/make.conf以及您可能正在使用的任何其他库。

最好,您应该重新编译整个gentoo系统。