Commit e3a7f75a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-12679 purge_sys_t::~purge_sys_t(): Assertion `latch.magic_n == 0' failed...

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.
parent 021d6365
......@@ -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);
}
/******************************************************************//**
......
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