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

TSAN: data race in aio_linux.cc during innodb_init (affects most TSAN testing)

    XMLWordPrintable

    Details

      Description

      This data race is seen on startup. It is blocking (likely very many) other TSAN issues from being analyzed.

      10.8.0 5566cbadb03856aba9c236b131f544490cd2bee4 (Debug, TSAN)

      WARNING: ThreadSanitizer: data race (pid=1951015)
        Read of size 8 at 0x7f4f6da38fa0 by thread T3:
          #0 tpool::aio_linux::getevent_thread_routine(tpool::aio_linux*) /test/10.8_dbg_san/tpool/aio_linux.cc:132 (mariadbd+0x1a50dcd)
          #1 void std::__invoke_impl<void, void (*)(tpool::aio_linux*), tpool::aio_linux*>(std::__invoke_other, void (*&&)(tpool::aio_linux*), tpool::aio_linux*&&) /usr/include/c++/9/bits/invoke.h:60 (mariadbd+0x1a50b8f)
          #2 std::__invoke_result<void (*)(tpool::aio_linux*), tpool::aio_linux*>::type std::__invoke<void (*)(tpool::aio_linux*), tpool::aio_linux*>(void (*&&)(tpool::aio_linux*), tpool::aio_linux*&&) /usr/include/c++/9/bits/invoke.h:95 (mariadbd+0x1a50b8f)
          #3 void std::thread::_Invoker<std::tuple<void (*)(tpool::aio_linux*), tpool::aio_linux*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/include/c++/9/thread:244 (mariadbd+0x1a50b8f)
          #4 std::thread::_Invoker<std::tuple<void (*)(tpool::aio_linux*), tpool::aio_linux*> >::operator()() /usr/include/c++/9/thread:251 (mariadbd+0x1a50b8f)
          #5 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(tpool::aio_linux*), tpool::aio_linux*> > >::_M_run() /usr/include/c++/9/thread:195 (mariadbd+0x1a50b8f)
          #6 <null> <null> (libstdc++.so.6+0xd6de3)
       
        Previous write of size 8 at 0x7f4f6da38fa0 by thread T6:
          #0 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.8_dbg_san/storage/innobase/os/os0file.cc:3891 (mariadbd+0x160eb1e)
          #1 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.8_dbg_san/storage/innobase/fil/fil0fil.cc:2839 (mariadbd+0x19799c9)
          #2 buf_read_page_low /test/10.8_dbg_san/storage/innobase/buf/buf0rea.cc:333 (mariadbd+0x18e8e87)
          #3 buf_read_page_background(fil_space_t*, page_id_t, unsigned long) /test/10.8_dbg_san/storage/innobase/buf/buf0rea.cc:499 (mariadbd+0x18ea755)
          #4 buf_load /test/10.8_dbg_san/storage/innobase/buf/buf0dump.cc:686 (mariadbd+0x18c4dd0)
          #5 buf_dump_load_func /test/10.8_dbg_san/storage/innobase/buf/buf0dump.cc:771 (mariadbd+0x18c56f9)
          #6 tpool::task::execute() /test/10.8_dbg_san/tpool/task.cc:37 (mariadbd+0x1a5003f)
          #7 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.8_dbg_san/tpool/tpool_generic.cc:549 (mariadbd+0x1a4dbf2)
          #8 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/include/c++/9/bits/invoke.h:73 (mariadbd+0x1a4e2a1)
          #9 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/include/c++/9/bits/invoke.h:95 (mariadbd+0x1a4e2a1)
          #10 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/include/c++/9/thread:244 (mariadbd+0x1a4e2a1)
          #11 std::thread::_Invoker<std::tuple<void (tpool::thread_pool_generic::*)(tpool::worker_data*), tpool::thread_pool_generic*, tpool::worker_data*> >::operator()() /usr/include/c++/9/thread:251 (mariadbd+0x1a4e2a1)
          #12 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/include/c++/9/thread:195 (mariadbd+0x1a4e2a1)
          #13 <null> <null> (libstdc++.so.6+0xd6de3)
        Location is heap block of size 196608 at 0x7f4f6da09000 allocated by main thread:
          #0 operator new(unsigned long) ../../../../src/libsanitizer/tsan/tsan_new_delete.cpp:64 (libtsan.so.0+0x8c032)
          #1 tpool::cache<tpool::aiocb>::cache(unsigned long, tpool::cache_notification_mode) /usr/include/c++/9/ext/new_allocator.h:114 (mariadbd+0x160f18e)
          #2 io_slots::io_slots(int, int) /test/10.8_dbg_san/storage/innobase/os/os0file.cc:96 (mariadbd+0x160f18e)
          #3 os_aio_init() /test/10.8_dbg_san/storage/innobase/os/os0file.cc:3750 (mariadbd+0x160f18e)
          #4 srv_start(bool) /test/10.8_dbg_san/storage/innobase/srv/srv0start.cc:1191 (mariadbd+0x179a992)
          #5 innodb_init /test/10.8_dbg_san/storage/innobase/handler/ha_innodb.cc:4206 (mariadbd+0x14dc555)
          #6 ha_initialize_handlerton(st_plugin_int*) /test/10.8_dbg_san/sql/handler.cc:649 (mariadbd+0xe312be)
          #7 plugin_initialize /test/10.8_dbg_san/sql/sql_plugin.cc:1462 (mariadbd+0x8fec57)
          #8 plugin_init(int*, char**, int) /test/10.8_dbg_san/sql/sql_plugin.cc:1755 (mariadbd+0x902556)
          #9 init_server_components /test/10.8_dbg_san/sql/mysqld.cc:5080 (mariadbd+0x673370)
          #10 mysqld_main(int, char**) /test/10.8_dbg_san/sql/mysqld.cc:5695 (mariadbd+0x67d962)
          #11 main /test/10.8_dbg_san/sql/main.cc:34 (mariadbd+0x668dcb)
       
        Thread T3 (tid=1952469, running) created by main thread at:
          #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:962 (libtsan.so.0+0x5ea79)
          #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd70a8)
          #2 tpool::thread_pool_generic::create_native_aio(int) /test/10.8_dbg_san/tpool/tpool_generic.cc:285 (mariadbd+0x1a4e37e)
          #3 tpool::thread_pool::configure_aio(bool, int) /test/10.8_dbg_san/tpool/tpool.h:215 (mariadbd+0x16103fb)
          #4 os_aio_init() /test/10.8_dbg_san/storage/innobase/os/os0file.cc:3759 (mariadbd+0x16103fb)
          #5 srv_start(bool) /test/10.8_dbg_san/storage/innobase/srv/srv0start.cc:1191 (mariadbd+0x179a992)
          #6 innodb_init /test/10.8_dbg_san/storage/innobase/handler/ha_innodb.cc:4206 (mariadbd+0x14dc555)
          #7 ha_initialize_handlerton(st_plugin_int*) /test/10.8_dbg_san/sql/handler.cc:649 (mariadbd+0xe312be)
          #8 plugin_initialize /test/10.8_dbg_san/sql/sql_plugin.cc:1462 (mariadbd+0x8fec57)
          #9 plugin_init(int*, char**, int) /test/10.8_dbg_san/sql/sql_plugin.cc:1755 (mariadbd+0x902556)
          #10 init_server_components /test/10.8_dbg_san/sql/mysqld.cc:5080 (mariadbd+0x673370)
          #11 mysqld_main(int, char**) /test/10.8_dbg_san/sql/mysqld.cc:5695 (mariadbd+0x67d962)
          #12 main /test/10.8_dbg_san/sql/main.cc:34 (mariadbd+0x668dcb)
       
        Thread T6 (tid=1953658, running) created by main thread at:
          #0 pthread_create ../../../../src/libsanitizer/tsan/tsan_interceptors_posix.cpp:962 (libtsan.so.0+0x5ea79)
          #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd70a8)
          #2 tpool::thread_pool_generic::maybe_wake_or_create_thread() /test/10.8_dbg_san/tpool/tpool_generic.cc:806 (mariadbd+0x1a4ce90)
          #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.8_dbg_san/tpool/tpool_generic.cc:825 (mariadbd+0x1a4de3a)
          #4 buf_do_load_dump /test/10.8_dbg_san/storage/innobase/buf/buf0dump.cc:825 (mariadbd+0x18c30c1)
          #5 buf_load_at_startup() /test/10.8_dbg_san/storage/innobase/buf/buf0dump.cc:819 (mariadbd+0x18c31f4)
          #6 srv_start(bool) /test/10.8_dbg_san/storage/innobase/srv/srv0start.cc:1876 (mariadbd+0x179e639)
          #7 innodb_init /test/10.8_dbg_san/storage/innobase/handler/ha_innodb.cc:4206 (mariadbd+0x14dc555)
          #8 ha_initialize_handlerton(st_plugin_int*) /test/10.8_dbg_san/sql/handler.cc:649 (mariadbd+0xe312be)
          #9 plugin_initialize /test/10.8_dbg_san/sql/sql_plugin.cc:1462 (mariadbd+0x8fec57)
          #10 plugin_init(int*, char**, int) /test/10.8_dbg_san/sql/sql_plugin.cc:1755 (mariadbd+0x902556)
          #11 init_server_components /test/10.8_dbg_san/sql/mysqld.cc:5080 (mariadbd+0x673370)
          #12 mysqld_main(int, char**) /test/10.8_dbg_san/sql/mysqld.cc:5695 (mariadbd+0x67d962)
          #13 main /test/10.8_dbg_san/sql/main.cc:34 (mariadbd+0x668dcb)
       
      SUMMARY: ThreadSanitizer: data race /test/10.8_dbg_san/tpool/aio_linux.cc:132 in tpool::aio_linux::getevent_thread_routine(tpool::aio_linux*)
      

        Attachments

          Activity

            People

            Assignee:
            marko Marko Mäkelä
            Reporter:
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Git Integration

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