Skip to content

Commit d72594d

Browse files
committed
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.
1 parent 2347c18 commit d72594d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

storage/innobase/include/read0types.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,5 +276,22 @@ class ReadView: public ReadViewBase
276276
to->append(*this);
277277
mutex_exit(&m_mutex);
278278
}
279+
280+
281+
/**
282+
Unpoison the memory for innodb_monitor_set_option;
283+
It is operating also on the freed transaction objects.
284+
Declare the contents as initialized for Valgrind;
285+
We checked that it was initialized in trx_pools->mem_free(trx).
286+
*/
287+
void mem_valid() const
288+
{
289+
#ifdef __SANITIZE_ADDRESS__
290+
MEM_UNDEFINED(&m_mutex, sizeof m_mutex);
291+
#endif
292+
#ifdef HAVE_valgrind
293+
UNIV_MEM_VALID(&m_mutex, sizeof m_mutex);
294+
#endif
295+
}
279296
};
280297
#endif

storage/innobase/trx/trx0trx.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,7 @@ void trx_free(trx_t*& trx)
457457
/* Declare the contents as initialized for Valgrind;
458458
we checked that it was initialized in trx_pools->mem_free(trx). */
459459
UNIV_MEM_VALID(&trx->mutex, sizeof trx->mutex);
460+
trx->read_view.mem_valid();
460461

461462
trx = NULL;
462463
}

0 commit comments

Comments
 (0)