From d3a7e46bb46d1347c6d2738590d177e463376f56 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 11 Jun 2024 08:21:28 -0600 Subject: [PATCH 1/2] MDEV-34365: UBSAN runtime error: call to function io_callback(tpool::aiocb*) On an UBSAN clang-15 build, if running with UBSAN option halt_on_error=1 (the issue doesn't show up without it), MTR fails during mysqld --bootstrap with UBSAN error: call to function io_callback(tpool::aiocb*) through pointer to incorrect function type 'void (*)(void *)' This patch corrects the parameter type of io_callback to match its expected type defined by callback_func, i.e. (void*). Reviewed By: ============ --- storage/innobase/os/os0file.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 4ef6799e9a6..ce4eafafcd5 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -3560,8 +3560,9 @@ os_file_get_status( extern void fil_aio_callback(const IORequest &request); -static void io_callback(tpool::aiocb* cb) +static void io_callback(void *_cb) { + tpool::aiocb* cb= static_cast(_cb); const IORequest request(*static_cast (static_cast(cb->m_userdata))); if (cb->m_err != DB_SUCCESS) From dd13243b0d22558f827130969b1164ee9b102488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Thu, 13 Jun 2024 19:42:18 +0300 Subject: [PATCH 2/2] MDEV-33161 fixup: CMAKE_CXX_FLAGS=-DEXTRA_DEBUG --- sql/sql_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_test.cc b/sql/sql_test.cc index b625341fe5e..7a9e83bafdd 100644 --- a/sql/sql_test.cc +++ b/sql/sql_test.cc @@ -87,9 +87,9 @@ print_where(COND *cond,const char *info, enum_query_type query_type) #ifdef EXTRA_DEBUG /* This is for debugging purposes */ -static my_bool print_cached_tables_callback(TDC_element *element, - void *arg __attribute__((unused))) +static my_bool print_cached_tables_callback(void *el, void*) { + TDC_element *element= static_cast(el); TABLE *entry; mysql_mutex_lock(&element->LOCK_table_share);