https://bugs.kde.org/show_bug.cgi?id=409999

            Bug ID: 409999
           Summary: Valgrind causes SIGILL due to unrecognized instruction
                    in rocksdb static initialization
           Product: valgrind
           Version: unspecified
          Platform: unspecified
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: andrei...@gmail.com
  Target Milestone: ---

SUMMARY

Most likely g++ generated an instruction, which is not recognized by valgrind.
Remark: SSE 4.2 is enabbled during rocksdb's build process.


STEPS TO REPRODUCE
1. Build rocksdb 6.1.2 (https://github.com/facebook/rocksdb)
2. Link a program with librocksdb
3. Start valgrind with the program.

OBSERVED RESULT

Some nasty happens along the lines of:
==93== Memcheck, a memory error detector
==93== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==93== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==93== Command: build/correlation/common/persistence/test/test_persistence
==93== 
vex amd64->IR: unhandled instruction bytes: 0x62 0xD1 0xFE 0x8 0x6F 0x84 0x24
0x8 0x0 0x0
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=NONE
vex amd64->IR:   PFX.66=0 PFX.F2=0 PFX.F3=0
==93== valgrind: Unrecognised instruction at address 0x51e81ce.
==93==    at 0x51E81CE: std::_Hashtable<std::string, std::pair<std::string
const, rocksdb::OptionTypeInfo>, std::allocator<std::pair<std::string const,
rocksdb::OptionTypeInfo> >, std::_
_detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>,
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,
std::__detail::_Prime_rehash_policy, std:
:__detail::_Hashtable_traits<true, false, true>
>::_Hashtable<std::pair<std::string const, rocksdb::OptionTypeInfo>
const*>(std::pair<std::string const, rocksdb::OptionTypeInfo> const*, 
std::pair<std::string const, rocksdb::OptionTypeInfo> const*, unsigned long,
std::hash<std::string> const&, std::__detail::_Mod_range_hashing const&,
std::__detail::_Default_ranged_hash 
const&, std::equal_to<std::string> const&, std::__detail::_Select1st const&,
std::allocator<std::pair<std::string const, rocksdb::OptionTypeInfo> > const&)
(in /usr/lib64/librocksdb.so)
==93==    by 0x519CEBF: __static_initialization_and_destruction_0(int, int)
[clone .constprop.642] (in /usr/lib64/librocksdb.so)
==93==    by 0x400F552: _dl_init (in /usr/lib64/ld-2.17.so)
==93==    by 0x40011A9: ??? (in /usr/lib64/ld-2.17.so)
==93== Your program just tried to execute an instruction that Valgrind
==93== did not recognise.  There are two possible reasons for this.
==93== 1. Your program has a bug and erroneously jumped to a non-code
==93==    location.  If you are running Memcheck and you just saw a
==93==    warning about a bad jump, it's probably your program's fault.
==93== 2. The instruction is legitimate but Valgrind doesn't handle it,
==93==    i.e. it's Valgrind's fault.  If you think this is the case or
==93==    you are not sure, please let us know and we'll try to fix it.
==93== Either way, Valgrind will now raise a SIGILL signal which will
==93== probably kill your program.
==93== 
==93== Process terminating with default action of signal 4 (SIGILL): dumping
core
==93==  Illegal opcode at address 0x51E81CE
==93==    at 0x51E81CE: std::_Hashtable<std::string, std::pair<std::string
const, rocksdb::OptionTypeInfo>, std::allocator<std::pair<std::string const,
rocksdb::OptionTypeInfo> >, std::_
_detail::_Select1st, std::equal_to<std::string>, std::hash<std::string>,
std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash,
std::__detail::_Prime_rehash_policy, std:
:__detail::_Hashtable_traits<true, false, true>
>::_Hashtable<std::pair<std::string const, rocksdb::OptionTypeInfo>
const*>(std::pair<std::string const, rocksdb::OptionTypeInfo> const*, 
std::pair<std::string const, rocksdb::OptionTypeInfo> const*, unsigned long,
std::hash<std::string> const&, std::__detail::_Mod_range_hashing const&,
std::__detail::_Default_ranged_hash 
const&, std::equal_to<std::string> const&, std::__detail::_Select1st const&,
std::allocator<std::pair<std::string const, rocksdb::OptionTypeInfo> > const&)
(in /usr/lib64/librocksdb.so)
==93==    by 0x519CEBF: __static_initialization_and_destruction_0(int, int)
[clone .constprop.642] (in /usr/lib64/librocksdb.so)
==93==    by 0x400F552: _dl_init (in /usr/lib64/ld-2.17.so)
==93==    by 0x40011A9: ??? (in /usr/lib64/ld-2.17.so)

EXPECTED RESULT

Run normally reporting eventual memory leaks and undefined behaviour.


SOFTWARE/OS VERSIONS
Linux: RHEL 7 

ADDITIONAL INFORMATION

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to