Bug 365325

Summary: unhandled instruction bytes: 0xF 0xC7 0xF0 0x89 0x6 0xF 0x42 0xC1
Product: [Developer tools] valgrind Reporter: Oskar <kde>
Component: callgrindAssignee: Josef Weidendorfer <josef.weidendorfer>
Status: RESOLVED DUPLICATE    
Severity: crash CC: jseward, steve.lorimer
Priority: NOR    
Version: 3.11.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:

Description Oskar 2016-07-10 16:35:06 UTC
==15073== Callgrind, a call-graph generating cache profiler
==15073== Copyright (C) 2002-2015, and GNU GPL'd, by Josef Weidendorfer et al.
==15073== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
----
==15073== 
==15073== For interactive control, run 'callgrind_control -h'.
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
==15073== valgrind: Unrecognised instruction at address 0x512fc65.
==15073==    at 0x512FC65: std::(anonymous namespace)::__x86_rdrand() (random.cc:69)
==15073==    by 0x512FE01: std::random_device::_M_getval() (random.cc:130)
==15073==    by 0x40659B: std::random_device::operator()() (random.h:1612)
==15073==    by 0x405ECE: __static_initialization_and_destruction_0(int, int) (socket.cpp:26)
==15073==    by 0x4062EF: _GLOBAL__sub_I__ZN2Ki2rdE (socket.cpp:223)
==15073==    by 0x40B2AC: __libc_csu_init (in /home/oskar/Programowanie/build-KiSockets-Desktop-Default/tests/kisocket-test)
==15073==    by 0x59376CF: (below main) (in /usr/lib/libc-2.23.so)
==15073== Your program just tried to execute an instruction that Valgrind
==15073== did not recognise.  There are two possible reasons for this.
==15073== 1. Your program has a bug and erroneously jumped to a non-code
==15073==    location.  If you are running Memcheck and you just saw a
==15073==    warning about a bad jump, it's probably your program's fault.
==15073== 2. The instruction is legitimate but Valgrind doesn't handle it,
==15073==    i.e. it's Valgrind's fault.  If you think this is the case or
==15073==    you are not sure, please let us know and we'll try to fix it.
==15073== Either way, Valgrind will now raise a SIGILL signal which will
==15073== probably kill your program.
==15073== 
==15073== Process terminating with default action of signal 4 (SIGILL): dumping core
==15073==  Illegal opcode at address 0x512FC65
==15073==    at 0x512FC65: std::(anonymous namespace)::__x86_rdrand() (random.cc:69)
==15073==    by 0x512FE01: std::random_device::_M_getval() (random.cc:130)
==15073==    by 0x40659B: std::random_device::operator()() (random.h:1612)
==15073==    by 0x405ECE: __static_initialization_and_destruction_0(int, int) (socket.cpp:26)
==15073==    by 0x4062EF: _GLOBAL__sub_I__ZN2Ki2rdE (socket.cpp:223)
==15073==    by 0x40B2AC: __libc_csu_init (in /home/oskar/Programowanie/build-KiSockets-Desktop-Default/tests/kisocket-test)
==15073==    by 0x59376CF: (below main) (in /usr/lib/libc-2.23.so)
==15073== 
==15073== Events    : Ir
==15073== Collected : 3010559
==15073== 
==15073== I   refs:      3,010,559

Reproducible: Always
Comment 1 steve.lorimer 2016-07-22 19:35:56 UTC
Getting the same error:

$ valgrind -v ./dsp/test/dsp_test 
==11100== Memcheck, a memory error detector
==11100== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==11100== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==11100== Command: ./dsp/test/dsp_test
==11100== 
--11100-- Valgrind options:
--11100--    -v
--11100-- Contents of /proc/version:
--11100--   Linux version 4.4.0-31-generic (buildd@lgw01-16) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2.1) ) #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016
--11100-- 
--11100-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--11100-- Page sizes: currently 4096, max supported 4096
--11100-- Valgrind library directory: /usr/lib/valgrind
--11100-- Reading syms from /home/steve/src/vc/cay/build/dsp/test/dsp_test
--11100-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
--11100--   Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
--11100--   .. CRC mismatch (computed d3da0723 wanted a1c29704)
--11100--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
--11100--   .. CRC is valid
--11100-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--11100--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--11100--   .. CRC mismatch (computed 5529a2c7 wanted 5bd23904)
--11100--    object doesn't have a symbol table
--11100--    object doesn't have a dynamic symbol table
--11100-- Scheduler: using generic scheduler lock implementation.
--11100-- Reading suppressions file: /usr/lib/valgrind/default.supp
==11100== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-11100-by-steve-on-???
==11100== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-11100-by-steve-on-???
==11100== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-11100-by-steve-on-???
==11100== 
==11100== TO CONTROL THIS PROCESS USING vgdb (which you probably
==11100== don't want to do, unless you know exactly what you're doing,
==11100== or are doing some strange experiment):
==11100==   /usr/lib/valgrind/../../bin/vgdb --pid=11100 ...command...
==11100== 
==11100== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==11100==   /path/to/gdb ./dsp/test/dsp_test
==11100== and then give GDB the following command
==11100==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=11100
==11100== --pid is optional if only one valgrind process is running
==11100== 
--11100-- REDIR: 0x401cdc0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
--11100-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--11100--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--11100--   .. CRC mismatch (computed a30c8eaa wanted 7ae2fed4)
--11100--    object doesn't have a symbol table
--11100-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--11100--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--11100--   .. CRC mismatch (computed 402c2ab5 wanted 745f25ae)
--11100--    object doesn't have a symbol table
==11100== WARNING: new redirection conflicts with existing -- ignoring it
--11100--     old: 0x0401cdc0 (strlen              ) R-> (0000.0) 0x3809e181 ???
--11100--     new: 0x0401cdc0 (strlen              ) R-> (2007.0) 0x04c31020 strlen
--11100-- REDIR: 0x401b710 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
--11100-- REDIR: 0x401b930 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
--11100-- REDIR: 0x401db20 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
--11100-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--11100--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--11100--   .. CRC mismatch (computed 6d893738 wanted d420bd97)
--11100--    object doesn't have a symbol table
--11100-- Reading syms from /lib/x86_64-linux-gnu/libm-2.23.so
--11100--   Considering /lib/x86_64-linux-gnu/libm-2.23.so ..
--11100--   .. CRC mismatch (computed f7791cb7 wanted 92acf4be)
--11100--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.23.so ..
--11100--   .. CRC is valid
--11100-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--11100--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--11100--   .. CRC mismatch (computed b9a68419 wanted 29d51b00)
--11100--    object doesn't have a symbol table
--11100-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.23.so
--11100--   Considering /usr/lib/debug/.build-id/b7/7847cc9cacbca3b5753d0d25a32e5795afe75b.debug ..
--11100--   .. build-id is valid
--11100-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
--11100--   Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
--11100--   .. CRC mismatch (computed 2adb2e50 wanted 9b73f606)
--11100--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
--11100--   .. CRC is valid
--11100-- REDIR: 0x5986fd0 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5982850 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x59892c0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5984cc0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5985050 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x598671b (libc.so.6:memcpy@GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x59849d0 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
--11100-- REDIR: 0x597b550 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
--11100-- REDIR: 0x5982cf0 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
--11100-- REDIR: 0x59861c0 (libc.so.6:__GI_memcmp) redirected to 0x4c33b90 (__GI_memcmp)
--11100-- REDIR: 0x59812a0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5996b40 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
--11100-- REDIR: 0x5983140 (libc.so.6:__GI_strncmp) redirected to 0x4c31710 (__GI_strncmp)
--11100-- REDIR: 0x598b9c0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5a456d0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c324a0 (memcpy@@GLIBC_2.14)
--11100-- REDIR: 0x4ec7e60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c2e080 (operator new(unsigned long))
--11100-- REDIR: 0x5986180 (libc.so.6:bcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5a65c60 (libc.so.6:__memcmp_sse4_1) redirected to 0x4c33cd0 (__memcmp_sse4_1)
--11100-- REDIR: 0x597c290 (libc.so.6:calloc) redirected to 0x4c2faa0 (calloc)
--11100-- REDIR: 0x4ec5f10 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c2f1e0 (operator delete(void*))
--11100-- REDIR: 0x5a451e0 (libc.so.6:__memmove_avx_unaligned) redirected to 0x4c32230 (memcpy@GLIBC_2.2.5)
--11100-- REDIR: 0x5986780 (libc.so.6:memset) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--11100-- REDIR: 0x5a6a1a0 (libc.so.6:__memset_avx2) redirected to 0x4c344c0 (memset)
--11100-- REDIR: 0x4ec7f10 (libstdc++.so.6:operator new[](unsigned long)) redirected to 0x4c2e7a0 (operator new[](unsigned long))
--11100-- REDIR: 0x4ec5f40 (libstdc++.so.6:operator delete[](void*)) redirected to 0x4c2f6e0 (operator delete[](void*))
--11100-- REDIR: 0x5985e30 (libc.so.6:memchr) redirected to 0x4c32170 (memchr)
--11100-- REDIR: 0x598ba40 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
--11100-- REDIR: 0x597ba70 (libc.so.6:free) redirected to 0x4c2ed80 (free)
--11100-- REDIR: 0x598dd30 (libc.so.6:strchrnul) redirected to 0x4c34da0 (strchrnul)
--11100-- REDIR: 0x598db20 (libc.so.6:rawmemchr) redirected to 0x4c34dd0 (rawmemchr)
--11100-- REDIR: 0x5986980 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
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
==11100== valgrind: Unrecognised instruction at address 0x4ef1b15.
==11100==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==11100==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==11100==    by 0x602627: std::random_device::operator()() (random.h:1612)
==11100==    by 0x60326C: cay::StatsFixture::StatsFixture() (dsp_tests.cpp:21)
==11100==    by 0x603403: mean_test::mean_test() (dsp_tests.cpp:43)
==11100==    by 0x5F9FEB: mean_test_invoker() (dsp_tests.cpp:43)
==11100==    by 0x60994E: boost::detail::function::void_function_invoker0<void (*)(), void>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:118)
==11100==    by 0x5B4D8C: boost::function0<void>::operator()() const (function_template.hpp:771)
==11100==    by 0x5AB13C: boost::detail::forward::operator()() (execution_monitor.ipp:1306)
==11100==    by 0x5DD424: boost::detail::function::function_obj_invoker0<boost::detail::forward, int>::invoke(boost::detail::function::function_buffer&) (function_template.hpp:138)
==11100==    by 0x5C8390: boost::function0<int>::operator()() const (function_template.hpp:771)
==11100==    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)
==11100== Your program just tried to execute an instruction that Valgrind
==11100== did not recognise.  There are two possible reasons for this.
==11100== 1. Your program has a bug and erroneously jumped to a non-code
==11100==    location.  If you are running Memcheck and you just saw a
==11100==    warning about a bad jump, it's probably your program's fault.
==11100== 2. The instruction is legitimate but Valgrind doesn't handle it,
==11100==    i.e. it's Valgrind's fault.  If you think this is the case or
==11100==    you are not sure, please let us know and we'll try to fix it.
==11100== Either way, Valgrind will now raise a SIGILL signal which will
==11100== probably kill your program.
==11100== Warning: client switching stacks?  SP change: 0x5d48008 --> 0xffeffe670
==11100==          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 failure is detected in the test module "Master Test Suite"
==11100== 
==11100== HEAP SUMMARY:
==11100==     in use at exit: 72,744 bytes in 2 blocks
==11100==   total heap usage: 3,631 allocs, 3,629 frees, 309,688 bytes allocated
==11100== 
==11100== Searching for pointers to 2 not-freed blocks
==11100== Checked 152,632 bytes
==11100== 
==11100== LEAK SUMMARY:
==11100==    definitely lost: 40 bytes in 1 blocks
==11100==    indirectly lost: 0 bytes in 0 blocks
==11100==      possibly lost: 0 bytes in 0 blocks
==11100==    still reachable: 72,704 bytes in 1 blocks
==11100==         suppressed: 0 bytes in 0 blocks
==11100== Rerun with --leak-check=full to see details of leaked memory
==11100== 
==11100== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==11100== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Comment 2 Julian Seward 2016-09-14 14:46:25 UTC
I think this is almost certainly the same underlying cause as with bug 353370,
which has been fixed.  So I'll close this, as a dup of 353370.  Could you re-try
the trunk?  That should work.

*** This bug has been marked as a duplicate of bug 353370 ***