Reputation: 28679
I've upgraded to Ubuntu 16.04.1, which has gcc-5.4
and valgrind-3.11
My code builds fine and unit tests pass. However, when I run the tests through valgrind, I get an error.
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.
On Ubuntu 14.04 with gcc-4.9.3
and valgrind-3.10.1
it works fine.
In the valgrind output it says:
Your program just tried to execute an instruction that Valgrind did not recognise
It goes on to list 2 possible reasons, 1 being a bug in my program and the other being a bug in valgrind.
I've proven my code works on another compiler and valgrind version, so my question is: Is this a valgrind bug?
This is the valgrind output:
==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.
Upvotes: 3
Views: 406
Reputation: 28679
This is a known bug
Bug 365325 - unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
Upvotes: 2