diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2020-05-27 19:38:55 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2020-05-27 19:43:20 +0400 |
commit | d72594d45d5ce8b3fc74b5bde9a60b9a148fd322 (patch) | |
tree | 6075c03205a327053e81e2924ed1160740391703 | |
parent | 2347c18c79ee2532e2ec60d77495df7951e23e1e (diff) | |
download | mariadb-git-d72594d45d5ce8b3fc74b5bde9a60b9a148fd322.tar.gz |
Fixed main.implicit_commit ASAN failure
InnoDB mutex monitor is accessing mutexes of poisoned (cached) trx
objects. Unpoison ReadView::m_mutex similarly to trx_t::mutex.
This is regression after MDEV-22593.
-rw-r--r-- | storage/innobase/include/read0types.h | 17 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/storage/innobase/include/read0types.h b/storage/innobase/include/read0types.h index 0ebdb6a4761..ff282aa1f3f 100644 --- a/storage/innobase/include/read0types.h +++ b/storage/innobase/include/read0types.h @@ -276,5 +276,22 @@ public: to->append(*this); mutex_exit(&m_mutex); } + + + /** + Unpoison the memory for innodb_monitor_set_option; + It is operating also on the freed transaction objects. + Declare the contents as initialized for Valgrind; + We checked that it was initialized in trx_pools->mem_free(trx). + */ + void mem_valid() const + { +#ifdef __SANITIZE_ADDRESS__ + MEM_UNDEFINED(&m_mutex, sizeof m_mutex); +#endif +#ifdef HAVE_valgrind + UNIV_MEM_VALID(&m_mutex, sizeof m_mutex); +#endif + } }; #endif diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index 79778c0d02d..85e4ec54cf6 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -457,6 +457,7 @@ void trx_free(trx_t*& trx) /* Declare the contents as initialized for Valgrind; we checked that it was initialized in trx_pools->mem_free(trx). */ UNIV_MEM_VALID(&trx->mutex, sizeof trx->mutex); + trx->read_view.mem_valid(); trx = NULL; } |