2016-07-22 90 views
1

我已经升级到Ubuntu的16.04.1,其中有gcc-5.4valgrind-3.11无法通过运行GCC-5二进制的valgrind 3.11

我的代码编译罚款和单元测试通过。但是,当我通过valgrind运行测试时,出现错误。

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 
==10480== valgrind: Unrecognised instruction at address 0x4ef1b15. 

的Ubuntu 14.04gcc-4.9.3valgrind-3.10.1工作正常

在Valgrind的输出,它说:

你的程序只是试图执行一个Valgrind的不承认

它那张清单2个可能的原因,1是在我的程序中的错误的指令另一个是valgrind中的bug。

我已经证明了我的代码工作在另一个编译器和Valgrind的版本,所以我的问题是:这是一个错误Valgrind的?

这是Valgrind的输出:

==10480== Memcheck, a memory error detector 
==10480== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. 
==10480== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info 
==10480== Command: ./dsp/test/dsp_test 
==10480== 
Running 9 test cases... 
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 
==10480== valgrind: Unrecognised instruction at address 0x4ef1b15. 
==10480== at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) 
==10480== by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21) 
==10480== by 0x602627: std::random_device::operator()() (random.h:1612) 
==10480== by 0x60326C: cay::StatsFixture::StatsFixture() (dsp_tests.cpp:21) 
==10480== by 0x603403: mean_test::mean_test() (dsp_tests.cpp:43) 
==10480== by 0x5F9FEB: mean_test_invoker() (dsp_tests.cpp:43) 
==10480== by 0x60994E: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118) 
==10480== by 0x5B4D8C: boost::function0<void>::operator()() const (function_template.hpp:771) 
==10480== by 0x5AB13C: boost::detail::forward::operator()() (execution_monitor.ipp:1306) 
==10480== by 0x5DD424: boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:138) 
==10480== by 0x5C8390: boost::function0<int>::operator()() const (function_template.hpp:771) 
==10480== by 0x5B9A76: int boost::detail::do_invoke<boost::shared_ptr<boost::detail::translator_holder_base>, boost::function<int()> >(boost::shared_ptr<boost::detail::translator_holder_base> const&, boost::function<int()> const&) (execution_monitor.ipp:281) 
==10480== Your program just tried to execute an instruction that Valgrind 
==10480== did not recognise. There are two possible reasons for this. 
==10480== 1. Your program has a bug and erroneously jumped to a non-code 
==10480== location. If you are running Memcheck and you just saw a 
==10480== warning about a bad jump, it's probably your program's fault. 
==10480== 2. The instruction is legitimate but Valgrind doesn't handle it, 
==10480== i.e. it's Valgrind's fault. If you think this is the case or 
==10480== you are not sure, please let us know and we'll try to fix it. 
==10480== Either way, Valgrind will now raise a SIGILL signal which will 
==10480== probably kill your program. 
==10480== Warning: client switching stacks? SP change: 0x5d48008 --> 0xffeffe670 
==10480==   to suppress, use: --max-stackframe=68604880488 or greater 
unknown location(0): fatal error: in "mean_test": signal: illegal opcode; address of failing instruction: 0x04ef1b15 
/home/steve/src/vc/cay/dsp/test/dsp_tests.cpp(43): last checkpoint: "mean_test" fixture entry. 

回答

1

这是一个已知的错误

Bug 365325 - unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1

Bugzilla link