From d3a7e46bb46d1347c6d2738590d177e463376f56 Mon Sep 17 00:00:00 2001 From: Brandon Nesterenko Date: Tue, 11 Jun 2024 08:21:28 -0600 Subject: [PATCH] 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)