[Bug 1765001] Re: memcheck-amd64-linux crashed with SIGILL during valgrind --leak-check of my binary

Thomas A. F. Thorne 1765001 at bugs.launchpad.net
Wed Apr 18 10:46:45 UTC 2018


*** This bug is a duplicate of bug 1301850 ***
    https://bugs.launchpad.net/bugs/1301850

Interesting... I installed the valgrind-dbg package and I no longer get
an error report when I attempt to recreate the problem.


Before adding debug this was the output: 

$ ./runmysmoketests.sh "valgrind --leak-check=yes -v ./dmcp-debug"
Begining the smoke tests
nc: Address already in use
==4182== Memcheck, a memory error detector
==4182== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4182== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==4182== Command: ./dmcp-debug
==4182== 
--4182-- Valgrind options:
--4182--    --leak-check=yes
--4182--    -v
--4182-- Contents of /proc/version:
--4182--   Linux version 4.13.0-38-generic (buildd at lgw01-amd64-027) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)) #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018
--4182-- 
--4182-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--4182-- Page sizes: currently 4096, max supported 4096
--4182-- Valgrind library directory: /usr/lib/valgrind
--4182-- Reading syms from /home/thomas/work/src/dmcp/dmcp-debug
--4182-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
--4182--   .. CRC mismatch (computed aa979a42 wanted 9019bbb7)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
--4182--   .. CRC is valid
--4182-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--4182--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--4182--   .. CRC mismatch (computed eea41ea9 wanted 2009db78)
--4182--    object doesn't have a symbol table
--4182--    object doesn't have a dynamic symbol table
--4182-- Scheduler: using generic scheduler lock implementation.
--4182-- Reading suppressions file: /usr/lib/valgrind/default.supp
==4182== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-4182-by-thomas-on-???
==4182== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-4182-by-thomas-on-???
==4182== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-4182-by-thomas-on-???
==4182== 
==4182== TO CONTROL THIS PROCESS USING vgdb (which you probably
==4182== don't want to do, unless you know exactly what you're doing,
==4182== or are doing some strange experiment):
==4182==   /usr/lib/valgrind/../../bin/vgdb --pid=4182 ...command...
==4182== 
==4182== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==4182==   /path/to/gdb ./dmcp-debug
==4182== and then give GDB the following command
==4182==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=4182
==4182== --pid is optional if only one valgrind process is running
==4182== 
--4182-- REDIR: 0x401cfd0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
--4182-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--4182--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--4182--   .. CRC mismatch (computed 2567ccf6 wanted 49420590)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--4182--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--4182--   .. CRC mismatch (computed 0e27c9a8 wanted ac585421)
--4182--    object doesn't have a symbol table
==4182== WARNING: new redirection conflicts with existing -- ignoring it
--4182--     old: 0x0401cfd0 (strlen              ) R-> (0000.0) 0x3809e181 ???
--4182--     new: 0x0401cfd0 (strlen              ) R-> (2007.0) 0x04c31020 strlen
--4182-- REDIR: 0x401b920 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
--4182-- REDIR: 0x401bb40 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
--4182-- REDIR: 0x401dd30 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
--4182-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--4182--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--4182--   .. CRC mismatch (computed 9adedc07 wanted 319402e2)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /lib/x86_64-linux-gnu/libm-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/libm-2.23.so ..
--4182--   .. CRC mismatch (computed e8c3647b wanted c3efddac)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.23.so ..
--4182--   .. CRC is valid
--4182-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--4182--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--4182--   .. CRC mismatch (computed b9a68419 wanted 29d51b00)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.23.so
--4182--   Considering /usr/lib/debug/.build-id/ce/17e023542265fc11d9bc8f534bb4f070493d30.debug ..
--4182--   .. build-id is valid
--4182-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
--4182--   .. CRC mismatch (computed 7a8ee3e4 wanted a5190ac4)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
--4182--   .. CRC is valid
--4182-- REDIR: 0x5987a00 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5983280 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5989cf0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x59856f0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5985a80 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x598714b (libc.so.6:memcpy at GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5985400 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
--4182-- REDIR: 0x597c130 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
--4182-- REDIR: 0x5983720 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
--4182-- REDIR: 0x5986bf0 (libc.so.6:__GI_memcmp) redirected to 0x4c33b90 (__GI_memcmp)
--4182-- REDIR: 0x5981cd0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5997570 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
--4182-- REDIR: 0x4ec7e60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c2e080 (operator new(unsigned long))
--4182-- REDIR: 0x598c3f0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a45ea0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c324a0 (memcpy@@GLIBC_2.14)
--4182-- REDIR: 0x4ec5f10 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c2f1e0 (operator delete(void*))
--4182-- REDIR: 0x59871b0 (libc.so.6:memset) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a6a970 (libc.so.6:__memset_avx2) redirected to 0x4c344c0 (memset)
--4182-- REDIR: 0x5a459b0 (libc.so.6:__memmove_avx_unaligned) redirected to 0x4c32230 (memcpy at GLIBC_2.2.5)
--4182-- REDIR: 0x597c4f0 (libc.so.6:free) redirected to 0x4c2ed80 (free)
--4182-- REDIR: 0x598c470 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
--4182-- REDIR: 0x5986060 (libc.so.6:__GI_strstr) redirected to 0x4c354d0 (__strstr_sse2)
--4182-- REDIR: 0x5981d10 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
--4182-- REDIR: 0x59873b0 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
[2018-04-18 10:47:40.107] [console] [info] Starting Helios Emulator
[2018-04-18 10:47:40.164] [console] [debug] SPDLOG Version:0.16.3
--4182-- REDIR: 0x5986bb0 (libc.so.6:bcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a66430 (libc.so.6:__memcmp_sse4_1) redirected to 0x4c33cd0 (__memcmp_sse4_1)
[2018-04-18 10:47:40.172] [console] [trace] [ CommonIPNetworkLink.cpp:30 ] New CommonIPNetworkLink created
[2018-04-18 10:47:40.173] [console] [trace] [ HeliosEmulator.cpp:26 ] New HeliosEmulator created
[2018-04-18 10:47:40.174] [console] [debug] Sending to localhost
[2018-04-18 10:47:40.175] [console] [trace] [ HeliosEmulator.cpp:121 ] entered:void HeliosEmulator::sendRawStreamTo(const string&)
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
==4182== valgrind: Unrecognised instruction at address 0x4ef1b15.
==4182==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==4182==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==4182==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==4182== Your program just tried to execute an instruction that Valgrind
==4182== did not recognise.  There are two possible reasons for this.
==4182== 1. Your program has a bug and erroneously jumped to a non-code
==4182==    location.  If you are running Memcheck and you just saw a
==4182==    warning about a bad jump, it's probably your program's fault.
==4182== 2. The instruction is legitimate but Valgrind doesn't handle it,
==4182==    i.e. it's Valgrind's fault.  If you think this is the case or
==4182==    you are not sure, please let us know and we'll try to fix it.
==4182== Either way, Valgrind will now raise a SIGILL signal which will
==4182== probably kill your program.
==4182== 
==4182== Process terminating with default action of signal 4 (SIGILL)
==4182==  Illegal opcode at address 0x4EF1B15
==4182==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==4182==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==4182==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==4182== 
==4182== HEAP SUMMARY:
==4182==     in use at exit: 76,604 bytes in 128 blocks
==4182==   total heap usage: 141 allocs, 13 frees, 87,944 bytes allocated
==4182== 
==4182== Searching for pointers to 128 not-freed blocks
==4182== Checked 691,776 bytes
==4182== 
==4182== LEAK SUMMARY:
==4182==    definitely lost: 0 bytes in 0 blocks
==4182==    indirectly lost: 0 bytes in 0 blocks
==4182==      possibly lost: 0 bytes in 0 blocks
==4182==    still reachable: 76,604 bytes in 128 blocks
==4182==                       of which reachable via heuristic:
==4182==                         stdstring          : 3,540 bytes in 118 blocks
==4182==         suppressed: 0 bytes in 0 blocks
==4182== Reachable blocks (those to which a pointer was found) are not shown.
==4182== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==4182== 
==4182== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==4182== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Target return code:132
tee return code:
End of the smoke tests
The there were 0 errors reported
The exist status is 132$ ./runmysmoketests.sh "valgrind --leak-check=yes -v ./dmcp-debug"
Begining the smoke tests
nc: Address already in use
==4182== Memcheck, a memory error detector
==4182== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==4182== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==4182== Command: ./dmcp-debug
==4182== 
--4182-- Valgrind options:
--4182--    --leak-check=yes
--4182--    -v
--4182-- Contents of /proc/version:
--4182--   Linux version 4.13.0-38-generic (buildd at lgw01-amd64-027) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)) #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018
--4182-- 
--4182-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--4182-- Page sizes: currently 4096, max supported 4096
--4182-- Valgrind library directory: /usr/lib/valgrind
--4182-- Reading syms from /home/thomas/work/src/dmcp/dmcp-debug
--4182-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
--4182--   .. CRC mismatch (computed aa979a42 wanted 9019bbb7)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
--4182--   .. CRC is valid
--4182-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--4182--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--4182--   .. CRC mismatch (computed eea41ea9 wanted 2009db78)
--4182--    object doesn't have a symbol table
--4182--    object doesn't have a dynamic symbol table
--4182-- Scheduler: using generic scheduler lock implementation.
--4182-- Reading suppressions file: /usr/lib/valgrind/default.supp
==4182== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-4182-by-thomas-on-???
==4182== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-4182-by-thomas-on-???
==4182== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-4182-by-thomas-on-???
==4182== 
==4182== TO CONTROL THIS PROCESS USING vgdb (which you probably
==4182== don't want to do, unless you know exactly what you're doing,
==4182== or are doing some strange experiment):
==4182==   /usr/lib/valgrind/../../bin/vgdb --pid=4182 ...command...
==4182== 
==4182== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==4182==   /path/to/gdb ./dmcp-debug
==4182== and then give GDB the following command
==4182==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=4182
==4182== --pid is optional if only one valgrind process is running
==4182== 
--4182-- REDIR: 0x401cfd0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (???)
--4182-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--4182--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--4182--   .. CRC mismatch (computed 2567ccf6 wanted 49420590)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--4182--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--4182--   .. CRC mismatch (computed 0e27c9a8 wanted ac585421)
--4182--    object doesn't have a symbol table
==4182== WARNING: new redirection conflicts with existing -- ignoring it
--4182--     old: 0x0401cfd0 (strlen              ) R-> (0000.0) 0x3809e181 ???
--4182--     new: 0x0401cfd0 (strlen              ) R-> (2007.0) 0x04c31020 strlen
--4182-- REDIR: 0x401b920 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
--4182-- REDIR: 0x401bb40 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
--4182-- REDIR: 0x401dd30 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
--4182-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--4182--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--4182--   .. CRC mismatch (computed 9adedc07 wanted 319402e2)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /lib/x86_64-linux-gnu/libm-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/libm-2.23.so ..
--4182--   .. CRC mismatch (computed e8c3647b wanted c3efddac)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.23.so ..
--4182--   .. CRC is valid
--4182-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--4182--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--4182--   .. CRC mismatch (computed b9a68419 wanted 29d51b00)
--4182--    object doesn't have a symbol table
--4182-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.23.so
--4182--   Considering /usr/lib/debug/.build-id/ce/17e023542265fc11d9bc8f534bb4f070493d30.debug ..
--4182--   .. build-id is valid
--4182-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
--4182--   Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
--4182--   .. CRC mismatch (computed 7a8ee3e4 wanted a5190ac4)
--4182--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
--4182--   .. CRC is valid
--4182-- REDIR: 0x5987a00 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5983280 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5989cf0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x59856f0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5985a80 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x598714b (libc.so.6:memcpy at GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5985400 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
--4182-- REDIR: 0x597c130 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
--4182-- REDIR: 0x5983720 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
--4182-- REDIR: 0x5986bf0 (libc.so.6:__GI_memcmp) redirected to 0x4c33b90 (__GI_memcmp)
--4182-- REDIR: 0x5981cd0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5997570 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
--4182-- REDIR: 0x4ec7e60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c2e080 (operator new(unsigned long))
--4182-- REDIR: 0x598c3f0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a45ea0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c324a0 (memcpy@@GLIBC_2.14)
--4182-- REDIR: 0x4ec5f10 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c2f1e0 (operator delete(void*))
--4182-- REDIR: 0x59871b0 (libc.so.6:memset) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a6a970 (libc.so.6:__memset_avx2) redirected to 0x4c344c0 (memset)
--4182-- REDIR: 0x5a459b0 (libc.so.6:__memmove_avx_unaligned) redirected to 0x4c32230 (memcpy at GLIBC_2.2.5)
--4182-- REDIR: 0x597c4f0 (libc.so.6:free) redirected to 0x4c2ed80 (free)
--4182-- REDIR: 0x598c470 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
--4182-- REDIR: 0x5986060 (libc.so.6:__GI_strstr) redirected to 0x4c354d0 (__strstr_sse2)
--4182-- REDIR: 0x5981d10 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
--4182-- REDIR: 0x59873b0 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
[2018-04-18 10:47:40.107] [console] [info] Starting Helios Emulator
[2018-04-18 10:47:40.164] [console] [debug] SPDLOG Version:0.16.3
--4182-- REDIR: 0x5986bb0 (libc.so.6:bcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--4182-- REDIR: 0x5a66430 (libc.so.6:__memcmp_sse4_1) redirected to 0x4c33cd0 (__memcmp_sse4_1)
[2018-04-18 10:47:40.172] [console] [trace] [ CommonIPNetworkLink.cpp:30 ] New CommonIPNetworkLink created
[2018-04-18 10:47:40.173] [console] [trace] [ HeliosEmulator.cpp:26 ] New HeliosEmulator created
[2018-04-18 10:47:40.174] [console] [debug] Sending to localhost
[2018-04-18 10:47:40.175] [console] [trace] [ HeliosEmulator.cpp:121 ] entered:void HeliosEmulator::sendRawStreamTo(const string&)
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
==4182== valgrind: Unrecognised instruction at address 0x4ef1b15.
==4182==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==4182==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==4182==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==4182== Your program just tried to execute an instruction that Valgrind
==4182== did not recognise.  There are two possible reasons for this.
==4182== 1. Your program has a bug and erroneously jumped to a non-code
==4182==    location.  If you are running Memcheck and you just saw a
==4182==    warning about a bad jump, it's probably your program's fault.
==4182== 2. The instruction is legitimate but Valgrind doesn't handle it,
==4182==    i.e. it's Valgrind's fault.  If you think this is the case or
==4182==    you are not sure, please let us know and we'll try to fix it.
==4182== Either way, Valgrind will now raise a SIGILL signal which will
==4182== probably kill your program.
==4182== 
==4182== Process terminating with default action of signal 4 (SIGILL)
==4182==  Illegal opcode at address 0x4EF1B15
==4182==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==4182==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==4182==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==4182==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==4182== 
==4182== HEAP SUMMARY:
==4182==     in use at exit: 76,604 bytes in 128 blocks
==4182==   total heap usage: 141 allocs, 13 frees, 87,944 bytes allocated
==4182== 
==4182== Searching for pointers to 128 not-freed blocks
==4182== Checked 691,776 bytes
==4182== 
==4182== LEAK SUMMARY:
==4182==    definitely lost: 0 bytes in 0 blocks
==4182==    indirectly lost: 0 bytes in 0 blocks
==4182==      possibly lost: 0 bytes in 0 blocks
==4182==    still reachable: 76,604 bytes in 128 blocks
==4182==                       of which reachable via heuristic:
==4182==                         stdstring          : 3,540 bytes in 118 blocks
==4182==         suppressed: 0 bytes in 0 blocks
==4182== Reachable blocks (those to which a pointer was found) are not shown.
==4182== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==4182== 
==4182== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==4182== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Target return code:132
tee return code:
End of the smoke tests
The there were 0 errors reported
The exist status is 132


After installing the -dbg this was the output:

$ ./runmysmoketests.sh "valgrind --leak-check=yes -v ./dmcp-debug"
Begining the smoke tests
nc: Address already in use
==10035== Memcheck, a memory error detector
==10035== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==10035== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==10035== Command: ./dmcp-debug
==10035== 
--10035-- Valgrind options:
--10035--    --leak-check=yes
--10035--    -v
--10035-- Contents of /proc/version:
--10035--   Linux version 4.13.0-38-generic (buildd at lgw01-amd64-027) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)) #43~16.04.1-Ubuntu SMP Wed Mar 14 17:48:43 UTC 2018
--10035-- 
--10035-- Arch and hwcaps: AMD64, LittleEndian, amd64-cx16-lzcnt-rdtscp-sse3-avx-avx2-bmi
--10035-- Page sizes: currently 4096, max supported 4096
--10035-- Valgrind library directory: /usr/lib/valgrind
--10035-- Reading syms from /home/thomas/work/src/dmcp/dmcp-debug
--10035-- Reading syms from /lib/x86_64-linux-gnu/ld-2.23.so
--10035--   Considering /lib/x86_64-linux-gnu/ld-2.23.so ..
--10035--   .. CRC mismatch (computed aa979a42 wanted 9019bbb7)
--10035--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/ld-2.23.so ..
--10035--   .. CRC is valid
--10035-- Reading syms from /usr/lib/valgrind/memcheck-amd64-linux
--10035--   Considering /usr/lib/valgrind/memcheck-amd64-linux ..
--10035--   .. CRC mismatch (computed eea41ea9 wanted 2009db78)
--10035--   Considering /usr/lib/debug/usr/lib/valgrind/memcheck-amd64-linux ..
--10035--   .. CRC is valid
--10035--    object doesn't have a dynamic symbol table
--10035-- Scheduler: using generic scheduler lock implementation.
--10035-- Reading suppressions file: /usr/lib/valgrind/default.supp
==10035== embedded gdbserver: reading from /tmp/vgdb-pipe-from-vgdb-to-10035-by-thomas-on-???
==10035== embedded gdbserver: writing to   /tmp/vgdb-pipe-to-vgdb-from-10035-by-thomas-on-???
==10035== embedded gdbserver: shared mem   /tmp/vgdb-pipe-shared-mem-vgdb-10035-by-thomas-on-???
==10035== 
==10035== TO CONTROL THIS PROCESS USING vgdb (which you probably
==10035== don't want to do, unless you know exactly what you're doing,
==10035== or are doing some strange experiment):
==10035==   /usr/lib/valgrind/../../bin/vgdb --pid=10035 ...command...
==10035== 
==10035== TO DEBUG THIS PROCESS USING GDB: start GDB like this
==10035==   /path/to/gdb ./dmcp-debug
==10035== and then give GDB the following command
==10035==   target remote | /usr/lib/valgrind/../../bin/vgdb --pid=10035
==10035== --pid is optional if only one valgrind process is running
==10035== 
--10035-- REDIR: 0x401cfd0 (ld-linux-x86-64.so.2:strlen) redirected to 0x3809e181 (vgPlain_amd64_linux_REDIR_FOR_strlen)
--10035-- Reading syms from /usr/lib/valgrind/vgpreload_core-amd64-linux.so
--10035--   Considering /usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--10035--   .. CRC mismatch (computed 2567ccf6 wanted 49420590)
--10035--   Considering /usr/lib/debug/usr/lib/valgrind/vgpreload_core-amd64-linux.so ..
--10035--   .. CRC is valid
--10035-- Reading syms from /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so
--10035--   Considering /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--10035--   .. CRC mismatch (computed 0e27c9a8 wanted ac585421)
--10035--   Considering /usr/lib/debug/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so ..
--10035--   .. CRC is valid
==10035== WARNING: new redirection conflicts with existing -- ignoring it
--10035--     old: 0x0401cfd0 (strlen              ) R-> (0000.0) 0x3809e181 vgPlain_amd64_linux_REDIR_FOR_strlen
--10035--     new: 0x0401cfd0 (strlen              ) R-> (2007.0) 0x04c31020 strlen
--10035-- REDIR: 0x401b920 (ld-linux-x86-64.so.2:index) redirected to 0x4c30bc0 (index)
--10035-- REDIR: 0x401bb40 (ld-linux-x86-64.so.2:strcmp) redirected to 0x4c320d0 (strcmp)
--10035-- REDIR: 0x401dd30 (ld-linux-x86-64.so.2:mempcpy) redirected to 0x4c35270 (mempcpy)
--10035-- Reading syms from /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
--10035--   Considering /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21 ..
--10035--   .. CRC mismatch (computed 9adedc07 wanted 319402e2)
--10035--    object doesn't have a symbol table
--10035-- Reading syms from /lib/x86_64-linux-gnu/libm-2.23.so
--10035--   Considering /lib/x86_64-linux-gnu/libm-2.23.so ..
--10035--   .. CRC mismatch (computed e8c3647b wanted c3efddac)
--10035--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libm-2.23.so ..
--10035--   .. CRC is valid
--10035-- Reading syms from /lib/x86_64-linux-gnu/libgcc_s.so.1
--10035--   Considering /lib/x86_64-linux-gnu/libgcc_s.so.1 ..
--10035--   .. CRC mismatch (computed b9a68419 wanted 29d51b00)
--10035--    object doesn't have a symbol table
--10035-- Reading syms from /lib/x86_64-linux-gnu/libpthread-2.23.so
--10035--   Considering /usr/lib/debug/.build-id/ce/17e023542265fc11d9bc8f534bb4f070493d30.debug ..
--10035--   .. build-id is valid
--10035-- Reading syms from /lib/x86_64-linux-gnu/libc-2.23.so
--10035--   Considering /lib/x86_64-linux-gnu/libc-2.23.so ..
--10035--   .. CRC mismatch (computed 7a8ee3e4 wanted a5190ac4)
--10035--   Considering /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so ..
--10035--   .. CRC is valid
--10035-- REDIR: 0x5987a00 (libc.so.6:strcasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5983280 (libc.so.6:strcspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5989cf0 (libc.so.6:strncasecmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x59856f0 (libc.so.6:strpbrk) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5985a80 (libc.so.6:strspn) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x598714b (libc.so.6:memcpy at GLIBC_2.2.5) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5985400 (libc.so.6:rindex) redirected to 0x4c308a0 (rindex)
--10035-- REDIR: 0x597c130 (libc.so.6:malloc) redirected to 0x4c2db20 (malloc)
--10035-- REDIR: 0x5983720 (libc.so.6:strlen) redirected to 0x4c30f60 (strlen)
--10035-- REDIR: 0x5986bf0 (libc.so.6:__GI_memcmp) redirected to 0x4c33b90 (__GI_memcmp)
--10035-- REDIR: 0x5981cd0 (libc.so.6:strcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5997570 (libc.so.6:__strcmp_sse2_unaligned) redirected to 0x4c31f90 (strcmp)
--10035-- REDIR: 0x4ec7e60 (libstdc++.so.6:operator new(unsigned long)) redirected to 0x4c2e080 (operator new(unsigned long))
--10035-- REDIR: 0x598c3f0 (libc.so.6:memcpy@@GLIBC_2.14) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5a45ea0 (libc.so.6:__memcpy_avx_unaligned) redirected to 0x4c324a0 (memcpy@@GLIBC_2.14)
--10035-- REDIR: 0x4ec5f10 (libstdc++.so.6:operator delete(void*)) redirected to 0x4c2f1e0 (operator delete(void*))
--10035-- REDIR: 0x59871b0 (libc.so.6:memset) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5a6a970 (libc.so.6:__memset_avx2) redirected to 0x4c344c0 (memset)
--10035-- REDIR: 0x5a459b0 (libc.so.6:__memmove_avx_unaligned) redirected to 0x4c32230 (memcpy at GLIBC_2.2.5)
--10035-- REDIR: 0x597c4f0 (libc.so.6:free) redirected to 0x4c2ed80 (free)
--10035-- REDIR: 0x598c470 (libc.so.6:__GI_memcpy) redirected to 0x4c32b00 (__GI_memcpy)
--10035-- REDIR: 0x5986060 (libc.so.6:__GI_strstr) redirected to 0x4c354d0 (__strstr_sse2)
--10035-- REDIR: 0x5981d10 (libc.so.6:__GI_strcmp) redirected to 0x4c31fe0 (__GI_strcmp)
--10035-- REDIR: 0x59873b0 (libc.so.6:__GI_mempcpy) redirected to 0x4c34fa0 (__GI_mempcpy)
[2018-04-18 11:38:24.328] [console] [info] Starting Helios Emulator
[2018-04-18 11:38:24.384] [console] [debug] SPDLOG Version:0.16.3
--10035-- REDIR: 0x5986bb0 (libc.so.6:bcmp) redirected to 0x4a286f0 (_vgnU_ifunc_wrapper)
--10035-- REDIR: 0x5a66430 (libc.so.6:__memcmp_sse4_1) redirected to 0x4c33cd0 (__memcmp_sse4_1)
[2018-04-18 11:38:24.393] [console] [trace] [ CommonIPNetworkLink.cpp:30 ] New CommonIPNetworkLink created
[2018-04-18 11:38:24.394] [console] [trace] [ HeliosEmulator.cpp:26 ] New HeliosEmulator created
[2018-04-18 11:38:24.395] [console] [debug] Sending to localhost
[2018-04-18 11:38:24.396] [console] [trace] [ HeliosEmulator.cpp:121 ] entered:void HeliosEmulator::sendRawStreamTo(const string&)
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
==10035== valgrind: Unrecognised instruction at address 0x4ef1b15.
==10035==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==10035==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==10035==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==10035==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==10035==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==10035== Your program just tried to execute an instruction that Valgrind
==10035== did not recognise.  There are two possible reasons for this.
==10035== 1. Your program has a bug and erroneously jumped to a non-code
==10035==    location.  If you are running Memcheck and you just saw a
==10035==    warning about a bad jump, it's probably your program's fault.
==10035== 2. The instruction is legitimate but Valgrind doesn't handle it,
==10035==    i.e. it's Valgrind's fault.  If you think this is the case or
==10035==    you are not sure, please let us know and we'll try to fix it.
==10035== Either way, Valgrind will now raise a SIGILL signal which will
==10035== probably kill your program.
==10035== 
==10035== Process terminating with default action of signal 4 (SIGILL)
==10035==  Illegal opcode at address 0x4EF1B15
==10035==    at 0x4EF1B15: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==10035==    by 0x4EF1CB1: std::random_device::_M_getval() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21)
==10035==    by 0x43CFBC: std::random_device::operator()() (random.h:1612)
==10035==    by 0x43AE3C: HeliosEmulator::sendRawStreamTo(std::string const&) (HeliosEmulator.cpp:124)
==10035==    by 0x4048C5: main (HeliosEmulatorMain.cpp:27)
==10035== 
==10035== HEAP SUMMARY:
==10035==     in use at exit: 76,604 bytes in 128 blocks
==10035==   total heap usage: 141 allocs, 13 frees, 87,944 bytes allocated
==10035== 
==10035== Searching for pointers to 128 not-freed blocks
==10035== Checked 691,776 bytes
==10035== 
==10035== LEAK SUMMARY:
==10035==    definitely lost: 0 bytes in 0 blocks
==10035==    indirectly lost: 0 bytes in 0 blocks
==10035==      possibly lost: 0 bytes in 0 blocks
==10035==    still reachable: 76,604 bytes in 128 blocks
==10035==                       of which reachable via heuristic:
==10035==                         stdstring          : 3,540 bytes in 118 blocks
==10035==         suppressed: 0 bytes in 0 blocks
==10035== Reachable blocks (those to which a pointer was found) are not shown.
==10035== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==10035== 
==10035== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==10035== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Target return code:132
tee return code:
End of the smoke tests
The there were 0 errors reported
The exist status is 132


Output looks the same to me.  Could it be that Valgrind's attempt to generate something useful for a bug report, when it has not debug symbols, causes some undesirable behaviour?  


Whether that is the case or not I shall try to follow: 
==10035== 2. The instruction is legitimate but Valgrind doesn't handle it,
==10035==    i.e. it's Valgrind's fault.  If you think this is the case or
==10035==    you are not sure, please let us know and we'll try to fix it.
==10035== Either way, Valgrind will now raise a SIGILL signal which will
==10035== probably kill your program.
And post any bug report references back here (unless I find it is already fixed in a new version)

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to valgrind in Ubuntu.
https://bugs.launchpad.net/bugs/1765001

Title:
  memcheck-amd64-linux crashed with SIGILL during valgrind --leak-check
  of my binary

Status in Valgrind:
  Unknown
Status in valgrind package in Ubuntu:
  New

Bug description:
  On Ubuntu 16.04 I ran a 
  valgrind --leak-check=yes -v
  against a debug binary I had compiled using g++ (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609.  

  When I run without the -v option there is no crash reported.  With the
  -v option I have generated a bug prompt 2 runs for 2 (the first time I
  had out of date packaged though).

  #136538 was suggested as a possible, and it could be that but as it
  was a long time ago I made a new one.  That itself says it could be
  #97531 but that claims to now no longer be an issue.

  ProblemType: Crash
  DistroRelease: Ubuntu 16.04
  Package: valgrind 1:3.11.0-1ubuntu4.2
  ProcVersionSignature: Ubuntu 4.13.0-38.43~16.04.1-generic 4.13.16
  Uname: Linux 4.13.0-38-generic x86_64
  ApportVersion: 2.20.1-0ubuntu2.16
  Architecture: amd64
  CrashCounter: 1
  CurrentDesktop: Unity
  Date: Wed Apr 18 10:47:40 2018
  ExecutablePath: /usr/lib/valgrind/memcheck-amd64-linux
  InstallationDate: Installed on 2017-11-16 (152 days ago)
  InstallationMedia: Ubuntu 16.04.3 LTS "Xenial Xerus" - Release amd64 (20170801)
  ProcCmdline: /usr/bin/valgrind.bin --leak-check=yes -v ./dmcp-debug
  Signal: 4
  SourcePackage: valgrind
  StacktraceTop:
   ?? ()
   ?? ()
   ?? ()
   ?? ()
   ?? ()
  Title: memcheck-amd64-linux crashed with SIGILL
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dialout dip docker lpadmin plugdev sambashare sudo wireshark

To manage notifications about this bug go to:
https://bugs.launchpad.net/valgrind/+bug/1765001/+subscriptions



More information about the foundations-bugs mailing list