maryam alijani
maryam alijani

Reputation: 21

Valgrind unhandled instruction bytes: : 0x8F 0xEA 0xF8 0x10 0xC9 0x3 0x1D 0x0

When I compile my C program and run it under valgrind I have the following errors:

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

My system info:

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

I understand that there is something relating to instruction. I followed this link Bug 563796 - dev-util/valgrind: doesn't support TBM instructions and added to my Makefile CFLAGS -march=native -mno-tbm, or even -msse2 or -msse3 but still I have the same error.

I think there is no memory leak as I compiled with different system it just run fine. Is there any way to get rid of the error and make valgrind working?

Upvotes: 2

Views: 1651

Answers (1)

pah
pah

Reputation: 4778

Despite the fact that you're using -march=native -mno-tbm to compile your application, you're still prone to the same issue because all your system is compiled without -mno-tbm, including glibc code, which is what's causing the issue in your case.

You'll need to add the -march=native -mno-tbm to CFLAGS under your /etc/portage/make.conf and emerge glibc and any other libraries that your may be using.

Preferably, you should recompile your entire gentoo system.

Upvotes: 1

Related Questions