Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-34365

UBSAN runtime error: call to function io_callback(tpool::aiocb*)

    XMLWordPrintable

Details

    Description

      On an UBSAN clang-15 build, if running with UBSAN option halt_on_error=1, MTR fails during mysqld --bootstrap, e.g.

      UBSAN_OPTIONS=print_stacktrace=1:halt_on_error=1 ./mysql-test/mtr --suite=main
      

      with error

      ./tpool/task_group.cc:55:9: runtime error: call to function io_callback(tpool::aiocb*) through pointer to incorrect function type 'void (*)(void *)'
      ./storage/innobase/os/os0file.cc:3564: note: io_callback(tpool::aiocb*) defined here
          #0 0x55fa3fa9cef0 in tpool::task_group::execute(tpool::task*) ./tpool/task_group.cc:55:9
          #1 0x55fa3fa9db2f in tpool::task::execute() ./tpool/task.cc:47:16
          #2 0x55fa3fa88ee5 in tpool::thread_pool_generic::worker_main(tpool::worker_data*) ./tpool/tpool_generic.cc:599:11
          #3 0x55fa3fa974ce in void std::__invoke_impl<void, void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>(std::__invoke_memfun_deref, void (tpool::thread_pool_generic::*&&)(tpool::worker_data*), tpool::thread_pool_generic*&&, tpool::worker_data*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:74:14
          #4 0x55fa3fa971e2 in std::__invoke_result<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>::type std::__invoke<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>(void (tpool::thread_pool_generic::*&&)(tpool::worker_data*), tpool::thread_pool_generic*&&, tpool::worker_data*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/invoke.h:96:14
          #5 0x55fa3fa9713d in void std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:259:13
          #6 0x55fa3fa97026 in std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>>::operator()() /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:266:11
          #7 0x55fa3fa96b14 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*>>>::_M_run() /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/std_thread.h:211:13
          #8 0x7fc4f28dc252  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xdc252) (BuildId: e37fe1a879783838de78cbc8c80621fa685d58a2)
          #9 0x7fc4f2494ac2 in start_thread nptl/pthread_create.c:442:8
          #10 0x7fc4f252684f  misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
       
      SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ./tpool/task_group.cc:55:9 in
      

      Interestingly, without halt_on_error=1, I don't see the error at all.

      Attachments

        Activity

          People

            bnestere Brandon Nesterenko
            bnestere Brandon Nesterenko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.