Valgrind无法识别指令 - 该怎么办?

时间:2017-11-07 14:13:52

标签: c++ runtime-error valgrind

Valgrind在我的BattleShip计划中指责这个错误,但我不知道如何解释它。能否帮助我理解并知道,我应该搜索什么,找到错误?

如果有遗漏的信息,请告知我们,以便我们更好地沟通

vex amd64->IR: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
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=0F
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==6644== valgrind: Unrecognised instruction at address 0x4ef5335.
==6644==    at 0x4EF5335: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==6644==    by 0x4EF54D1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==6644==    by 0x402259: std::random_device::operator()() (random.h:1612)
==6644==    by 0x406B6A: Player::set(Board&, Navio) (player.cpp:26)
==6644==    by 0x40602E: void BatalhaNaval::setTabuleiro<Player>(Player&,  Board&) (BatalhaNaval.cpp:30)
==6644==    by 0x404AC8: BatalhaNaval::BatalhaNaval(Player&, Player&) (BatalhaNaval.cpp:9)
==6644==    by 0x40E740: main (main.cpp:65)
==6644== Your program just tried to execute an instruction that Valgrind
==6644== did not recognise.  There are two possible reasons for this.
==6644== 1. Your program has a bug and erroneously jumped to a non-code
==6644==    location.  If you are running Memcheck and you just saw a
==6644==    warning about a bad jump, it's probably your program's fault.
==6644== 2. The instruction is legitimate but Valgrind doesn't handle it,
==6644==    i.e. it's Valgrind's fault.  If you think this is the case or
==6644==    you are not sure, please let us know and we'll try to fix it.
==6644== Either way, Valgrind will now raise a SIGILL signal which will
==6644== probably kill your program.
==6644== 
==6644== Process terminating with default action of signal 4 (SIGILL)
==6644==  Illegal opcode at address 0x4EF5335
==6644==    at 0x4EF5335: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==6644==    by 0x4EF54D1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.24)
==6644==    by 0x402259: std::random_device::operator()() (random.h:1612)
==6644==    by 0x406B6A: Player::set(Board&, Navio) (player.cpp:26)
==6644==    by 0x40602E: void BatalhaNaval::setTabuleiro<Player>(Player&, Board&) (BatalhaNaval.cpp:30)
==6644==    by 0x404AC8: BatalhaNaval::BatalhaNaval(Player&, Player&) (BatalhaNaval.cpp:9)
==6644==    by 0x40E740: main (main.cpp:65)
==6644== 
==6644== HEAP SUMMARY:
==6644==     in use at exit: 72,788 bytes in 3 blocks
==6644==   total heap usage: 5 allocs, 2 frees, 74,836 bytes allocated
==6644== 
==6644== LEAK SUMMARY:
==6644==    definitely lost: 0 bytes in 0 blocks
==6644==    indirectly lost: 0 bytes in 0 blocks
==6644==      possibly lost: 0 bytes in 0 blocks
==6644==    still reachable: 72,788 bytes in 3 blocks
==6644==         suppressed: 0 bytes in 0 blocks
==6644== Reachable blocks (those to which a pointer was found) are not shown.
==6644== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==6644== 
==6644== For counts of detected and suppressed errors, rerun with: -v
==6644== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Illegal instruction (core dumped)

我使用的库是: 串 的iostream 随机 stdexcept

0 个答案:

没有答案