简体   繁体   中英

Running Valgrind fails

I'm trying to run valgrind in order to identify memory leaks in my program.

Unfortunately, running it fails as follows:

igor@WaylandGnome ~/dbhandler/Debug/dbhandler $ valgrind --leak-check=full dbhandler
==32622== Memcheck, a memory error detector
==32622== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==32622== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==32622== Command: dbhandler
==32622== 
vex amd64->IR: unhandled instruction bytes: 0x8F 0xEA 0x78 0x10 0xD0 0x8 0x4 0x0 0x0 0x89
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
==32622== valgrind: Unrecognised instruction at address 0x40197cf.
==32622==    at 0x40197CF: get_common_indices.constprop.0 (in /lib64/ld-2.33.so)
==32622==    by 0x401ACB6: init_cpu_features.constprop.0 (in /lib64/ld-2.33.so)
==32622==    by 0x401BE1D: _dl_sysdep_start (in /lib64/ld-2.33.so)
==32622==    by 0x4001FDB: _dl_start (in /lib64/ld-2.33.so)
==32622==    by 0x4001057: ??? (in /lib64/ld-2.33.so)
==32622== Your program just tried to execute an instruction that Valgrind
==32622== did not recognise.  There are two possible reasons for this.
==32622== 1. Your program has a bug and erroneously jumped to a non-code
==32622==    location.  If you are running Memcheck and you just saw a
==32622==    warning about a bad jump, it's probably your program's fault.
==32622== 2. The instruction is legitimate but Valgrind doesn't handle it,
==32622==    i.e. it's Valgrind's fault.  If you think this is the case or
==32622==    you are not sure, please let us know and we'll try to fix it.
==32622== Either way, Valgrind will now raise a SIGILL signal which will
==32622== probably kill your program.
==32622== 
==32622== Process terminating with default action of signal 4 (SIGILL)
==32622==  Illegal opcode at address 0x40197CF
==32622==    at 0x40197CF: get_common_indices.constprop.0 (in /lib64/ld-2.33.so)
==32622==    by 0x401ACB6: init_cpu_features.constprop.0 (in /lib64/ld-2.33.so)
==32622==    by 0x401BE1D: _dl_sysdep_start (in /lib64/ld-2.33.so)
==32622==    by 0x4001FDB: _dl_start (in /lib64/ld-2.33.so)
==32622==    by 0x4001057: ??? (in /lib64/ld-2.33.so)
==32622== 
==32622== HEAP SUMMARY:
==32622==     in use at exit: 0 bytes in 0 blocks
==32622==   total heap usage: 0 allocs, 0 frees, 0 bytes allocated
==32622== 
==32622== All heap blocks were freed -- no leaks are possible
==32622== 
==32622== For lists of detected and suppressed errors, rerun with: -s
==32622== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction

Any idea what is happening?

I'm running Gentoo here and my program is built with C++11 standard.

This is valgrind bug https://bugs.kde.org/show_bug.cgi?id=381819

There is a patch attached to the bug but the patch is not in the latest valgrind release as it is reported as not being complete.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM