Skip to content

Commit

Permalink
MDEV-20315: MyRocks tests produce valgrind failures (Backport to 10.2)
Browse files Browse the repository at this point in the history
- Include the valgrind suppressions from the FB upstream

- Use HAVE_Valgrind, not HAVE_Purify (like the rest of MariaDB code does)
  The call to DisownData() is now actually disabled under Valgrind
  • Loading branch information
spetrunia committed Aug 13, 2019
1 parent ed4ccf3 commit a18d1cc
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 2 deletions.
94 changes: 94 additions & 0 deletions mysql-test/valgrind.supp
Original file line number Diff line number Diff line change
Expand Up @@ -1771,3 +1771,97 @@
obj:/usr/lib64/libcrypto.so*
}



##
## The following is a copy of facebook/mysql-5.6 suppressions:
##

#
# RocksDB Storage Engine suppressions start
#

{
Still reachable for once-per-process initializations
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZN7rocksdb16ThreadStatusUtil19NewColumnFamilyInfoEPKNS_2DBEPKNS_16ColumnFamilyDataERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKNS_3EnvE
fun:_ZNK7rocksdb6DBImpl21NewThreadStatusCfInfoEPNS_16ColumnFamilyDataE
fun:_ZN7rocksdb2DB4OpenERKNS_9DBOptionsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorINS_22ColumnFamilyDescriptorESaISD_EEPSC_IPNS_18ColumnFamilyHandleESaISJ_EEPPS0_
fun:_ZN7rocksdb13TransactionDB4OpenERKNS_9DBOptionsERKNS_20TransactionDBOptionsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKSt6vectorINS_22ColumnFamilyDescriptorESaISG_EEPSF_IPNS_18ColumnFamilyHandleESaISM_EEPPS0_
fun:_ZN7myrocksL17rocksdb_init_funcEPv
}


{
Still reachable for once-per-process initializations
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZN7rocksdb19ThreadStatusUpdater14RegisterThreadENS_12ThreadStatus10ThreadTypeEm
fun:_ZN7rocksdb16ThreadStatusUtil14RegisterThreadEPKNS_3EnvENS_12ThreadStatus10ThreadTypeE
fun:_ZN7rocksdb14ThreadPoolImpl4Impl15BGThreadWrapperEPv
fun:_ZNSt12_Bind_simpleIFPFPvS0_EPN7rocksdb16BGThreadMetadataEEE9_M_invokeIILm0EEEES0_St12_Index_tupleIIXspT_EEE
...
}

{
Still reachable for once-per-process initializations
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZN7rocksdb14ThreadLocalPtr14InitSingletonsEv
fun:_ZN7rocksdb3Env7DefaultEv
fun:_ZN7rocksdb9DBOptionsC1Ev
...
fun:_ZN7myrocksL27rdb_init_rocksdb_db_optionsEv
}

{
Still reachable for once-per-process initializations
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZN7rocksdb12_GLOBAL__N_18PosixEnv*
fun:_ZN7rocksdb3Env7DefaultEv
fun:_ZN7rocksdb9DBOptionsC1Ev
...
fun:_ZN7myrocksL27rdb_init_rocksdb_db_optionsEv
}

{
Still reachable for thread local storage initialization (SetHandle)
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZNSt13unordered_mapIjPFvPvESt4hashIjESt8equal_toIjESaISt4pairIKjS2_EEEixERS8_
fun:_ZN7rocksdb14ThreadLocalPtr10StaticMeta10SetHandlerEjPFvPvE
fun:_ZN7rocksdb14ThreadLocalPtrC1EPFvPvE
...
}

{
Still reachable for thread local storage initialization (ReclaimId)
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_ZN7rocksdb10autovectorIjLm8EE9push_backERKj
fun:_ZN7rocksdb14ThreadLocalPtr10StaticMeta9ReclaimIdEj
fun:_ZN7rocksdb14ThreadLocalPtrD1Ev
...
}

{
Static initialization
Memcheck:Leak
match-leak-kinds: reachable
...
fun:_Z41__static_initialization_and_destruction_0ii
...
}

##
## RocksDB Storage Engine suppressions end
##

4 changes: 2 additions & 2 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5836,11 +5836,11 @@ static int rocksdb_done_func(void *const p) {
// Disown the cache data since we're shutting down.
// This results in memory leaks but it improved the shutdown time.
// Don't disown when running under valgrind
#ifndef HAVE_purify
#ifndef HAVE_valgrind
if (rocksdb_tbl_options->block_cache) {
rocksdb_tbl_options->block_cache->DisownData();
}
#endif /* HAVE_purify */
#endif /* HAVE_valgrind */

/*
MariaDB: don't clear rocksdb_db_options and rocksdb_tbl_options.
Expand Down

0 comments on commit a18d1cc

Please sign in to comment.