1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-07 17:42:39 +03:00

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.
This commit is contained in:
Sergey Vojtovich
2020-05-27 19:38:55 +04:00
parent 2347c18c79
commit d72594d45d
2 changed files with 18 additions and 0 deletions

View File

@@ -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

View File

@@ -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;
}