diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-10 14:14:50 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-10 14:14:50 +0300 |
commit | e3a7f75aefb882a291b7308d84e8a36b34d3009f (patch) | |
tree | 8a5cc6588d6697b7df0c0e42c0d33c66b3a841dd | |
parent | 021d636551865c3a7403171e8d6f027a365bf9df (diff) | |
download | mariadb-git-e3a7f75aefb882a291b7308d84e8a36b34d3009f.tar.gz |
MDEV-12679 purge_sys_t::~purge_sys_t(): Assertion `latch.magic_n == 0' failed on --bootstrap (CMAKE_BUILD_TYPE=Debug)
rw_lock_free_func(): Assign lock->magic_n = 0 in debug builds,
because sometimes, the assignment in the explicit destructor call
is being optimized away.
This was verified when using GCC 6.3.0 with -O3 -g -mtune=native
on a Debian GNU/Linux 9.0 system on AMD64.
-rw-r--r-- | storage/innobase/sync/sync0rw.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/innobase/sync/sync0rw.cc b/storage/innobase/sync/sync0rw.cc index c748bad1417..6322b14335f 100644 --- a/storage/innobase/sync/sync0rw.cc +++ b/storage/innobase/sync/sync0rw.cc @@ -277,6 +277,9 @@ rw_lock_free_func( /* We did an in-place new in rw_lock_create_func() */ ut_d(lock->~rw_lock_t()); + /* Sometimes (maybe when compiled with GCC -O3) the above call + to rw_lock_t::~rw_lock_t() will not actually assign magic_n=0. */ + ut_d(lock->magic_n = 0); } /******************************************************************//** |