Commit d72594d4 authored by Sergey Vojtovich's avatar Sergey Vojtovich

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.
parent 2347c18c
......@@ -276,5 +276,22 @@ class ReadView: public ReadViewBase
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
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment