Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.6, 10.11, 11.1(EOL), 11.2, 11.4, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 11.0(EOL), 11.3(EOL), 11.5(EOL)
-
POSIX-like without futex-like system calls: AIX, macOS, Solaris
Description
To better catch platform-specific bugs such as MDEV-34422, per the suggestion of debarun, I implemented some debug instrumentation for the pthread_mutex_wrapper. This revealed a few places where an init() member function was invoked without a prior destroy().
For the futex-based implementations of srw_mutex, srw_lock, and sux_lock, this is not an issue, because init() on those data structures simply asserts that the contents is zero-initialized.
On systems that lack a futex-like system call (systems other than Linux, Microsoft Windows, or those served by MDEV-26476) and where pthread_mutex_init() is allocating some resources that need to be freed by pthread_mutex_destroy(), a memory leak could occur when we are repeatedly invoking pthread_mutex_init() without a pthread_mutex_destroy() in between. This could affect buf_page_t::lock, dict_index_t::lock (in a special case of ALTER TABLE...IMPORT TABLESPACE), and trx_rseg_t::latch (when innodb_undo_tablespaces is being changed; MDEV-19229).
Attachments
Issue Links
- relates to
-
MDEV-26476 InnoDB is missing futex support on some platforms
- Closed
-
MDEV-34422 InnoDB writes corrupted log on macOS and AIX due to uninitialized log_sys.lsn_lock
- Closed
-
MDEV-34521 Running mysql_install_db on 10.11 results in crash by assert failure at log0log.cc
- Closed