[MDEV-24332] TSAN: Data race in os_file_pread from os/os0file.cc Created: 2020-12-02  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Major
Reporter: Roel Van de Paar Assignee: Marko Mäkelä
Resolution: Unresolved Votes: 0
Labels: affects-tests, not-10.1, not-10.2, tsan

Issue Links:
Blocks
is blocked by MDEV-21212 buf_page_get_gen -> buf_pool->stat.n_... Closed
Relates
relates to MDEV-24329 TSAN: Data race in srv_mon_default_on... Open

 Description   

Simply starting or shutting down the server (both optimized and debug) generates various data races in os_file_pread:

10.5.9 1435f35bdabd078f0c4e744ab4bdfd8d4acca3ea (Optimized)

... startup ...
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3310 in os_file_pread
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 in os_file_pread
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3313 in os_file_pread
... shutdown ...
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3310 in os_file_pread
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 in os_file_pread
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3313 in os_file_pread

10.5.9 1435f35bdabd078f0c4e744ab4bdfd8d4acca3ea (Optimized)

WARNING: ThreadSanitizer: data race (pid=2702489)
  Read of size 8 at 0x5574f389be70 by thread T7:
    #0 os_file_pread /test/10.5_opt_san/storage/innobase/os/os0file.cc:3310 (mariadbd+0x140eaac)
    #1 os_file_read_page /test/10.5_opt_san/storage/innobase/os/os0file.cc:3345 (mariadbd+0x140eaac)
    #2 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:3730 (mariadbd+0x140ffbf)
    #3 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:4117 (mariadbd+0x140ffbf)
    #4 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.5_opt_san/storage/innobase/fil/fil0fil.cc:3431 (mariadbd+0x1634a88)
    #5 buf_read_page_low /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:344 (mariadbd+0x15d2183)
    #6 buf_read_page_background(fil_space_t*, page_id_t, unsigned long, bool) /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:510 (mariadbd+0x15d2183)
    #7 buf_load /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:677 (mariadbd+0x15c2622)
    #8 buf_dump_load_func /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:758 (mariadbd+0x15c31e1)
    #9 tpool::task::execute() /test/10.5_opt_san/tpool/task.cc:52 (mariadbd+0x16f48df)
    #10 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.5_opt_san/tpool/tpool_generic.cc:546 (mariadbd+0x16f1b54)
    #11 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+0x16f2a47)
    #12 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+0x16f2a47)
    #13 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+0x16f2a47)
    #14 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+0x16f2a47)
    #15 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+0x16f2a47)
    #16 <null> <null> (libstdc++.so.6+0xd6d83)
 
  Previous write of size 8 at 0x5574f389be70 by main thread:
    #0 srv_mon_default_on() /test/10.5_opt_san/storage/innobase/srv/srv0mon.cc:2099 (mariadbd+0x14decc1)
    #1 innodb_init /test/10.5_opt_san/storage/innobase/handler/ha_innodb.cc:3961 (mariadbd+0x136065c)
    #2 ha_initialize_handlerton(st_plugin_int*) /test/10.5_opt_san/sql/handler.cc:645 (mariadbd+0xcf9547)
    #3 plugin_initialize /test/10.5_opt_san/sql/sql_plugin.cc:1459 (mariadbd+0x8d3f74)
    #4 plugin_init(int*, char**, int) /test/10.5_opt_san/sql/sql_plugin.cc:1751 (mariadbd+0x8d5cc3)
    #5 init_server_components /test/10.5_opt_san/sql/mysqld.cc:4913 (mariadbd+0x72043d)
    #6 mysqld_main(int, char**) /test/10.5_opt_san/sql/mysqld.cc:5496 (mariadbd+0x725bf4)
    #7 main /test/10.5_opt_san/sql/main.cc:25 (mariadbd+0x6b8455)
 
  Location is global 'monitor_set_tbl' of size 32 at 0x5574f389be60 (mariadbd+0x000002b2ae70)
 
  Thread T7 (tid=2702743, running) created by thread T1 at:
    #0 pthread_create <null> (libtsan.so.0+0x5ea99)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd7048)
    #2 tpool::thread_pool_generic::maybe_wake_or_create_thread() /test/10.5_opt_san/tpool/tpool_generic.cc:802 (mariadbd+0x16f2787)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.5_opt_san/tpool/tpool_generic.cc:821 (mariadbd+0x16f2787)
    #4 tpool::thread_pool_generic::timer_generic::submit_task(void*) /test/10.5_opt_san/tpool/tpool_generic.cc:335 (mariadbd+0x16f28c9)
    #5 process_timers /test/10.5_opt_san/mysys/thr_timer.c:271 (mariadbd+0x17b289b)
    #6 timer_handler /test/10.5_opt_san/mysys/thr_timer.c:315 (mariadbd+0x17b289b)
    #7 <null> <null> (libtsan.so.0+0x2d1af)
 
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3310 in os_file_pread

10.5.9 1435f35bdabd078f0c4e744ab4bdfd8d4acca3ea (Optimized)

WARNING: ThreadSanitizer: data race (pid=2702489)
  Atomic write of size 8 at 0x5574f389eef8 by thread T7:
    #0 __tsan_atomic64_fetch_add <null> (libtsan.so.0+0x7f2d9)
    #1 os_file_pread /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 (mariadbd+0x140ec02)
    #2 os_file_read_page /test/10.5_opt_san/storage/innobase/os/os0file.cc:3345 (mariadbd+0x140ec02)
    #3 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:3730 (mariadbd+0x140ffbf)
    #4 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:4117 (mariadbd+0x140ffbf)
    #5 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.5_opt_san/storage/innobase/fil/fil0fil.cc:3431 (mariadbd+0x1634a88)
    #6 buf_read_page_low /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:344 (mariadbd+0x15d2183)
    #7 buf_read_page_background(fil_space_t*, page_id_t, unsigned long, bool) /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:510 (mariadbd+0x15d2183)
    #8 buf_load /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:677 (mariadbd+0x15c2622)
    #9 buf_dump_load_func /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:758 (mariadbd+0x15c31e1)
    #10 tpool::task::execute() /test/10.5_opt_san/tpool/task.cc:52 (mariadbd+0x16f48df)
    #11 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.5_opt_san/tpool/tpool_generic.cc:546 (mariadbd+0x16f1b54)
    #12 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+0x16f2a47)
    #13 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+0x16f2a47)
    #14 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+0x16f2a47)
    #15 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+0x16f2a47)
    #16 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+0x16f2a47)
    #17 <null> <null> (libstdc++.so.6+0xd6d83)
 
  Previous write of size 8 at 0x5574f389eef8 by main thread:
    #0 memset <null> (libtsan.so.0+0x3792f)
    #1 memset /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71 (mariadbd+0x1360588)
    #2 innodb_init /test/10.5_opt_san/storage/innobase/handler/ha_innodb.cc:3950 (mariadbd+0x1360588)
    #3 ha_initialize_handlerton(st_plugin_int*) /test/10.5_opt_san/sql/handler.cc:645 (mariadbd+0xcf9547)
    #4 plugin_initialize /test/10.5_opt_san/sql/sql_plugin.cc:1459 (mariadbd+0x8d3f74)
    #5 plugin_init(int*, char**, int) /test/10.5_opt_san/sql/sql_plugin.cc:1751 (mariadbd+0x8d5cc3)
    #6 init_server_components /test/10.5_opt_san/sql/mysqld.cc:4913 (mariadbd+0x72043d)
    #7 mysqld_main(int, char**) /test/10.5_opt_san/sql/mysqld.cc:5496 (mariadbd+0x725bf4)
    #8 main /test/10.5_opt_san/sql/main.cc:25 (mariadbd+0x6b8455)
 
  Location is global 'innodb_counter_value' of size 24480 at 0x5574f389be80 (mariadbd+0x000002b2def8)
 
  Thread T7 (tid=2702743, running) created by thread T1 at:
    #0 pthread_create <null> (libtsan.so.0+0x5ea99)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd7048)
    #2 tpool::thread_pool_generic::maybe_wake_or_create_thread() /test/10.5_opt_san/tpool/tpool_generic.cc:802 (mariadbd+0x16f2787)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.5_opt_san/tpool/tpool_generic.cc:821 (mariadbd+0x16f2787)
    #4 tpool::thread_pool_generic::timer_generic::submit_task(void*) /test/10.5_opt_san/tpool/tpool_generic.cc:335 (mariadbd+0x16f28c9)
    #5 process_timers /test/10.5_opt_san/mysys/thr_timer.c:271 (mariadbd+0x17b289b)
    #6 timer_handler /test/10.5_opt_san/mysys/thr_timer.c:315 (mariadbd+0x17b289b)
    #7 <null> <null> (libtsan.so.0+0x2d1af)
 
SUMMARY: ThreadSanitizer: data race (/usr/lib/x86_64-linux-gnu/libtsan.so.0+0x7f2d9) in __tsan_atomic64_fetch_add

^ Discussing SUMARY's: This is one of the :3311 reports (on both startup and shutdown). Then, there is an actual :3311 one on shutdown. IOW, there is 3 in total: 2x __tsan_atomic64_fetch_add (startup+shutdown) and 1x :3311, as follows:

10.5.9 1435f35bdabd078f0c4e744ab4bdfd8d4acca3ea (Optimized)

WARNING: ThreadSanitizer: data race (pid=2769340)
  Read of size 8 at 0x55aa3d60ef00 by thread T7:
    #0 os_file_pread /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 (mariadbd+0x140ec12)
    #1 os_file_read_page /test/10.5_opt_san/storage/innobase/os/os0file.cc:3345 (mariadbd+0x140ec12)
    #2 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:3730 (mariadbd+0x140ffbf)
    #3 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:4117 (mariadbd+0x140ffbf)
    #4 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.5_opt_san/storage/innobase/fil/fil0fil.cc:3431 (mariadbd+0x1634a88)
    #5 buf_read_page_low /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:344 (mariadbd+0x15d2183)
    #6 buf_read_page_background(fil_space_t*, page_id_t, unsigned long, bool) /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:510 (mariadbd+0x15d2183)
    #7 buf_load /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:677 (mariadbd+0x15c2622)
    #8 buf_dump_load_func /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:758 (mariadbd+0x15c31e1)
    #9 tpool::task::execute() /test/10.5_opt_san/tpool/task.cc:52 (mariadbd+0x16f48df)
    #10 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.5_opt_san/tpool/tpool_generic.cc:546 (mariadbd+0x16f1b54)
    #11 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+0x16f2a47)
    #12 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+0x16f2a47)
    #13 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+0x16f2a47)
    #14 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+0x16f2a47)
    #15 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+0x16f2a47)
    #16 <null> <null> (libstdc++.so.6+0xd6d83)
 
  Previous write of size 8 at 0x55aa3d60ef00 by main thread:
    #0 memset <null> (libtsan.so.0+0x3792f)
    #1 memset /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71 (mariadbd+0x1360588)
    #2 innodb_init /test/10.5_opt_san/storage/innobase/handler/ha_innodb.cc:3950 (mariadbd+0x1360588)
    #3 ha_initialize_handlerton(st_plugin_int*) /test/10.5_opt_san/sql/handler.cc:645 (mariadbd+0xcf9547)
    #4 plugin_initialize /test/10.5_opt_san/sql/sql_plugin.cc:1459 (mariadbd+0x8d3f74)
    #5 plugin_init(int*, char**, int) /test/10.5_opt_san/sql/sql_plugin.cc:1751 (mariadbd+0x8d5cc3)
    #6 init_server_components /test/10.5_opt_san/sql/mysqld.cc:4913 (mariadbd+0x72043d)
    #7 mysqld_main(int, char**) /test/10.5_opt_san/sql/mysqld.cc:5496 (mariadbd+0x725bf4)
    #8 main /test/10.5_opt_san/sql/main.cc:25 (mariadbd+0x6b8455)
 
  Location is global 'innodb_counter_value' of size 24480 at 0x55aa3d60be80 (mariadbd+0x000002b2df00)
 
  Thread T7 (tid=2769355, running) created by thread T1 at:
    #0 pthread_create <null> (libtsan.so.0+0x5ea99)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd7048)
    #2 tpool::thread_pool_generic::maybe_wake_or_create_thread() /test/10.5_opt_san/tpool/tpool_generic.cc:802 (mariadbd+0x16f2787)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.5_opt_san/tpool/tpool_generic.cc:821 (mariadbd+0x16f2787)
    #4 tpool::thread_pool_generic::timer_generic::submit_task(void*) /test/10.5_opt_san/tpool/tpool_generic.cc:335 (mariadbd+0x16f28c9)
    #5 process_timers /test/10.5_opt_san/mysys/thr_timer.c:271 (mariadbd+0x17b289b)
    #6 timer_handler /test/10.5_opt_san/mysys/thr_timer.c:315 (mariadbd+0x17b289b)
    #7 <null> <null> (libtsan.so.0+0x2d1af)
 
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 in os_file_pread

10.5.9 1435f35bdabd078f0c4e744ab4bdfd8d4acca3ea (Optimized)

WARNING: ThreadSanitizer: data race (pid=2769113)
  Read of size 8 at 0x557e07d6df00 by thread T7:
    #0 os_file_pread /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 (mariadbd+0x140ec12)
    #1 os_file_read_page /test/10.5_opt_san/storage/innobase/os/os0file.cc:3345 (mariadbd+0x140ec12)
    #2 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:3730 (mariadbd+0x140ffbf)
    #3 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.5_opt_san/storage/innobase/os/os0file.cc:4117 (mariadbd+0x140ffbf)
    #4 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.5_opt_san/storage/innobase/fil/fil0fil.cc:3431 (mariadbd+0x1634a88)
    #5 buf_read_page_low /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:344 (mariadbd+0x15d2183)
    #6 buf_read_page_background(fil_space_t*, page_id_t, unsigned long, bool) /test/10.5_opt_san/storage/innobase/buf/buf0rea.cc:510 (mariadbd+0x15d2183)
    #7 buf_load /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:677 (mariadbd+0x15c2622)
    #8 buf_dump_load_func /test/10.5_opt_san/storage/innobase/buf/buf0dump.cc:758 (mariadbd+0x15c31e1)
    #9 tpool::task::execute() /test/10.5_opt_san/tpool/task.cc:52 (mariadbd+0x16f48df)
    #10 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.5_opt_san/tpool/tpool_generic.cc:546 (mariadbd+0x16f1b54)
    #11 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+0x16f2a47)
    #12 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+0x16f2a47)
    #13 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+0x16f2a47)
    #14 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+0x16f2a47)
    #15 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+0x16f2a47)
    #16 <null> <null> (libstdc++.so.6+0xd6d83)
 
  Previous write of size 8 at 0x557e07d6df00 by main thread:
    #0 memset <null> (libtsan.so.0+0x3792f)
    #1 memset /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71 (mariadbd+0x1360588)
    #2 innodb_init /test/10.5_opt_san/storage/innobase/handler/ha_innodb.cc:3950 (mariadbd+0x1360588)
    #3 ha_initialize_handlerton(st_plugin_int*) /test/10.5_opt_san/sql/handler.cc:645 (mariadbd+0xcf9547)
    #4 plugin_initialize /test/10.5_opt_san/sql/sql_plugin.cc:1459 (mariadbd+0x8d3f74)
    #5 plugin_init(int*, char**, int) /test/10.5_opt_san/sql/sql_plugin.cc:1751 (mariadbd+0x8d5cc3)
    #6 init_server_components /test/10.5_opt_san/sql/mysqld.cc:4913 (mariadbd+0x72043d)
    #7 mysqld_main(int, char**) /test/10.5_opt_san/sql/mysqld.cc:5496 (mariadbd+0x725bf4)
    #8 main /test/10.5_opt_san/sql/main.cc:25 (mariadbd+0x6b8455)
 
  Location is global 'innodb_counter_value' of size 24480 at 0x557e07d6ae80 (mariadbd+0x000002b2df00)
 
  Thread T7 (tid=2769128, running) created by thread T1 at:
    #0 pthread_create <null> (libtsan.so.0+0x5ea99)
    #1 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) <null> (libstdc++.so.6+0xd7048)
    #2 tpool::thread_pool_generic::maybe_wake_or_create_thread() /test/10.5_opt_san/tpool/tpool_generic.cc:802 (mariadbd+0x16f2787)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.5_opt_san/tpool/tpool_generic.cc:821 (mariadbd+0x16f2787)
    #4 tpool::thread_pool_generic::timer_generic::submit_task(void*) /test/10.5_opt_san/tpool/tpool_generic.cc:335 (mariadbd+0x16f28c9)
    #5 process_timers /test/10.5_opt_san/mysys/thr_timer.c:271 (mariadbd+0x17b289b)
    #6 timer_handler /test/10.5_opt_san/mysys/thr_timer.c:315 (mariadbd+0x17b289b)
    #7 <null> <null> (libtsan.so.0+0x2d1af)
 
SUMMARY: ThreadSanitizer: data race /test/10.5_opt_san/storage/innobase/os/os0file.cc:3311 in os_file_pread

{
  ut_ad(type.is_read());
  ++os_n_file_reads;
 
  const bool monitor = MONITOR_IS_ON(MONITOR_OS_PENDING_READS);       <------------- 3310
  MONITOR_ATOMIC_INC_LOW(MONITOR_OS_PENDING_READS, monitor);          <------------- 3311
  ssize_t n_bytes = os_file_io(type, file, buf, n, offset, err);
  MONITOR_ATOMIC_DEC_LOW(MONITOR_OS_PENDING_READS, monitor);          <------------- 3313
 
  return(n_bytes);
}

Setup:

Compiled with GCC >=7.5.0 (I use GCC 9.3.0) and:
    -DWITH_TSAN=ON -DWSREP_LIB_WITH_TSAN=ON -DMUTEXTYPE=sys
Set before execution:
    export TSAN_OPTIONS=suppress_equal_stacks=1:suppress_equal_addresses=1:history_size=7:verbosity=1:exitcode=0

Bug confirmed present in:
MariaDB: 10.3.28 (dbg), 10.4.18 (dbg), [_10.4.18 (opt)_], 10.5.9 (dbg), 10.5.9 (opt), 10.6.0 (dbg), 10.6.0 (opt)

Bug confirmed not present in:
MariaDB: 10.1.49 (dbg), 10.1.49 (opt), 10.2.37 (dbg), 10.2.37 (opt), 10.3.28 (opt)

Note: 10.3.28 (opt) has no issues.
Note: 10.6.0 (dbg) has only a single issue on os/os0file.cc:3313.
Note: 10.4.0 (opt) has no issues, but has another one on os0file.cc:4987:

10.4.18 7effcb8ed6a9fd75452535490af425270d6416bf (Optimized)

WARNING: ThreadSanitizer: data race (pid=2704859)
  Write of size 8 at 0x55c8c5b7e810 by main thread:
    #0 srv_mon_default_on() /test/10.4_opt_san/storage/innobase/srv/srv0mon.cc:2190 (mysqld+0x11a6f81)
    #1 innodb_init /test/10.4_opt_san/storage/innobase/handler/ha_innodb.cc:4262 (mysqld+0x1035644)
    #2 ha_initialize_handlerton(st_plugin_int*) /test/10.4_opt_san/sql/handler.cc:574 (mysqld+0xc665d5)
    #3 plugin_initialize /test/10.4_opt_san/sql/sql_plugin.cc:1438 (mysqld+0x81b304)
    #4 plugin_init(int*, char**, int) /test/10.4_opt_san/sql/sql_plugin.cc:1720 (mysqld+0x81d125)
    #5 init_server_components /test/10.4_opt_san/sql/mysqld.cc:5218 (mysqld+0x66f974)
    #6 mysqld_main(int, char**) /test/10.4_opt_san/sql/mysqld.cc:5747 (mysqld+0x6767d4)
    #7 main /test/10.4_opt_san/sql/main.cc:25 (mysqld+0x63a245)
 
  Previous read of size 8 at 0x55c8c5b7e810 by thread T25:
    #0 os_file_pread /test/10.4_opt_san/storage/innobase/os/os0file.cc:4987 (mysqld+0x10e16bc)
    #1 os_file_read_page /test/10.4_opt_san/storage/innobase/os/os0file.cc:5023 (mysqld+0x10e16bc)
    #2 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.4_opt_san/storage/innobase/os/os0file.cc:5414 (mysqld+0x10e1efd)
    #3 os_aio_func(IORequest&, unsigned long, char const*, pfs_os_file_t, void*, unsigned long, unsigned long, bool, fil_node_t*, void*) /test/10.4_opt_san/storage/innobase/os/os0file.cc:6594 (mysqld+0x10e1efd)
    #4 pfs_os_aio_func /test/10.4_opt_san/storage/innobase/include/os0file.ic:253 (mysqld+0x12ebfcb)
    #5 fil_io(IORequest const&, bool, page_id_t, unsigned long, unsigned long, unsigned long, void*, void*, bool) /test/10.4_opt_san/storage/innobase/fil/fil0fil.cc:4271 (mysqld+0x12ebfcb)
    #6 buf_read_page_low /test/10.4_opt_san/storage/innobase/buf/buf0rea.cc:181 (mysqld+0x1283a2d)
    #7 buf_read_page_background(page_id_t, unsigned long, bool) /test/10.4_opt_san/storage/innobase/buf/buf0rea.cc:418 (mysqld+0x128416d)
    #8 buf_load /test/10.4_opt_san/storage/innobase/buf/buf0dump.cc:718 (mysqld+0x126f0cb)
    #9 buf_dump_thread /test/10.4_opt_san/storage/innobase/buf/buf0dump.cc:824 (mysqld+0x126fa52)
    #10 <null> <null> (libtsan.so.0+0x2d1af)
 
  Location is global 'monitor_set_tbl' of size 40 at 0x55c8c5b7e800 (mysqld+0x0000020a8810)
 
  Thread T25 (tid=2705107, running) created by main thread at:
    #0 pthread_create <null> (libtsan.so.0+0x5ea99)
    #1 os_thread_create_func(void* (*)(void*), void*, unsigned long*) /test/10.4_opt_san/storage/innobase/os/os0thread.cc:138 (mysqld+0x10e75b1)
    #2 srv_start(bool) /test/10.4_opt_san/storage/innobase/srv/srv0start.cc:2380 (mysqld+0x5f1ff7)
    #3 innodb_init /test/10.4_opt_san/storage/innobase/handler/ha_innodb.cc:4214 (mysqld+0x10352a0)
    #4 ha_initialize_handlerton(st_plugin_int*) /test/10.4_opt_san/sql/handler.cc:574 (mysqld+0xc665d5)
    #5 plugin_initialize /test/10.4_opt_san/sql/sql_plugin.cc:1438 (mysqld+0x81b304)
    #6 plugin_init(int*, char**, int) /test/10.4_opt_san/sql/sql_plugin.cc:1720 (mysqld+0x81d125)
    #7 init_server_components /test/10.4_opt_san/sql/mysqld.cc:5218 (mysqld+0x66f974)
    #8 mysqld_main(int, char**) /test/10.4_opt_san/sql/mysqld.cc:5747 (mysqld+0x6767d4)
    #9 main /test/10.4_opt_san/sql/main.cc:25 (mysqld+0x63a245)
 
SUMMARY: ThreadSanitizer: data race /test/10.4_opt_san/storage/innobase/srv/srv0mon.cc:2190 in srv_mon_default_on()

Which is MDEV-24329. But note the first frame:

    #0 os_file_pread /test/10.4_opt_san/storage/innobase/os/os0file.cc:4987 (mysqld+0x10e16bc)



 Comments   
Comment by Roel Van de Paar [ 2021-09-29 ]

10.7.1 8dd4794c4e11b8790fadf0c203bcd118e7b755e8 (Optimized)

WARNING: ThreadSanitizer: data race (pid=381269)
  Atomic write of size 8 at 0x55d85be7e698 by thread T6:
    #0 __tsan_atomic64_fetch_add ../../../../src/libsanitizer/tsan/tsan_interface_atomic.cpp:620 (libtsan.so.0+0x7f2e9)
    #1 os_file_pread /test/10.7_opt_san/storage/innobase/os/os0file.cc:3016 (mariadbd+0x14456a2)
    #2 os_file_read_page /test/10.7_opt_san/storage/innobase/os/os0file.cc:3050 (mariadbd+0x14456a2)
    #3 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.7_opt_san/storage/innobase/os/os0file.cc:3454 (mariadbd+0x144595f)
    #4 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.7_opt_san/storage/innobase/os/os0file.cc:3868 (mariadbd+0x144595f)
    #5 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.7_opt_san/storage/innobase/fil/fil0fil.cc:2812 (mariadbd+0x1642910)
    #6 buf_read_page_low /test/10.7_opt_san/storage/innobase/buf/buf0rea.cc:334 (mariadbd+0x15e840c)
    #7 buf_read_page(page_id_t, unsigned long) /test/10.7_opt_san/storage/innobase/buf/buf0rea.cc:480 (mariadbd+0x15e840c)
    #8 buf_page_get_low(page_id_t, unsigned long, unsigned long, buf_block_t*, unsigned long, mtr_t*, dberr_t*, bool) /test/10.7_opt_san/storage/innobase/buf/buf0buf.cc:2642 (mariadbd+0x15cec4c)
    #9 buf_page_get_gen(page_id_t, unsigned long, unsigned long, buf_block_t*, unsigned long, mtr_t*, dberr_t*, bool) /test/10.7_opt_san/storage/innobase/buf/buf0buf.cc:3084 (mariadbd+0x15d02d4)
    #10 ibuf_bitmap_get_map_page /test/10.7_opt_san/storage/innobase/ibuf/ibuf0ibuf.cc:671 (mariadbd+0x13f8c9c)
    #11 ibuf_page_low(page_id_t, unsigned long, mtr_t*) /test/10.7_opt_san/storage/innobase/ibuf/ibuf0ibuf.cc:974 (mariadbd+0x13f8c9c)
    #12 buf_read_page_low /test/10.7_opt_san/storage/innobase/buf/buf0rea.cc:289 (mariadbd+0x15e8617)
    #13 buf_read_page_background(fil_space_t*, page_id_t, unsigned long) /test/10.7_opt_san/storage/innobase/buf/buf0rea.cc:500 (mariadbd+0x15e8617)
    #14 buf_load /test/10.7_opt_san/storage/innobase/buf/buf0dump.cc:686 (mariadbd+0x15d9bb2)
    #15 buf_dump_load_func /test/10.7_opt_san/storage/innobase/buf/buf0dump.cc:771 (mariadbd+0x15da7e1)
    #16 tpool::task::execute() /test/10.7_opt_san/tpool/task.cc:37 (mariadbd+0x16ef7ff)
    #17 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.7_opt_san/tpool/tpool_generic.cc:549 (mariadbd+0x16eca74)
    #18 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+0x16ed967)
    #19 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+0x16ed967)
    #20 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+0x16ed967)
    #21 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+0x16ed967)
    #22 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+0x16ed967)
    #23 <null> <null> (libstdc++.so.6+0xd6de3)
 
  Previous write of size 8 at 0x55d85be7e698 by main thread:
    #0 memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:795 (libtsan.so.0+0x3790f)
    #1 memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:793 (libtsan.so.0+0x3790f)
    #2 memset /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71 (mariadbd+0x1398db5)
    #3 innodb_init /test/10.7_opt_san/storage/innobase/handler/ha_innodb.cc:4216 (mariadbd+0x1398db5)
    #4 ha_initialize_handlerton(st_plugin_int*) /test/10.7_opt_san/sql/handler.cc:659 (mariadbd+0xde36f7)
    #5 plugin_initialize /test/10.7_opt_san/sql/sql_plugin.cc:1463 (mariadbd+0x96f83d)
    #6 plugin_init(int*, char**, int) /test/10.7_opt_san/sql/sql_plugin.cc:1756 (mariadbd+0x971403)
    #7 init_server_components /test/10.7_opt_san/sql/mysqld.cc:5066 (mariadbd+0x741a3b)
    #8 mysqld_main(int, char**) /test/10.7_opt_san/sql/mysqld.cc:5682 (mariadbd+0x74baf1)
    #9 main /test/10.7_opt_san/sql/main.cc:34 (mariadbd+0x6e05f5)
 
  Location is global 'innodb_counter_value' of size 22560 at 0x55d85be7b860 (mariadbd+0x000002b78698)
 
  Thread T6 (tid=381352, running) created by thread T1 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.7_opt_san/tpool/tpool_generic.cc:806 (mariadbd+0x16ed6a7)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.7_opt_san/tpool/tpool_generic.cc:825 (mariadbd+0x16ed6a7)
    #4 tpool::thread_pool_generic::timer_generic::submit_task(void*) /test/10.7_opt_san/tpool/tpool_generic.cc:338 (mariadbd+0x16ed7e9)
    #5 process_timers /test/10.7_opt_san/mysys/thr_timer.c:271 (mariadbd+0x17a878c)
    #6 timer_handler /test/10.7_opt_san/mysys/thr_timer.c:315 (mariadbd+0x17a878c)
 
SUMMARY: ThreadSanitizer: data race /test/10.7_opt_san/storage/innobase/os/os0file.cc:3016 in os_file_pread

Codeline:

MONITOR_ATOMIC_INC_LOW(MONITOR_OS_PENDING_READS, monitor);

Comment by Roel Van de Paar [ 2021-11-28 ]

This bug continues to show and block much of TSAN testing. Please fix asap.

Comment by Roel Van de Paar [ 2021-11-28 ]

10.8.0 5566cbadb03856aba9c236b131f544490cd2bee4

WARNING: ThreadSanitizer: data race (pid=2136229)
  Atomic write of size 8 at 0x5594eb418df8 by thread T5:
    #0 __tsan_atomic64_fetch_add ../../../../src/libsanitizer/tsan/tsan_interface_atomic.cpp:620 (libtsan.so.0+0x7f2e9)
    #1 os_file_pread /test/10.8_opt_san/storage/innobase/os/os0file.cc:3016 (mariadbd+0x148d6a2)
    #2 os_file_read_page /test/10.8_opt_san/storage/innobase/os/os0file.cc:3050 (mariadbd+0x148d6a2)
    #3 os_file_read_func(IORequest const&, int, void*, unsigned long, unsigned long) /test/10.8_opt_san/storage/innobase/os/os0file.cc:3454 (mariadbd+0x148d95f)
    #4 os_aio(IORequest const&, void*, unsigned long, unsigned long) /test/10.8_opt_san/storage/innobase/os/os0file.cc:3868 (mariadbd+0x148d95f)
    #5 fil_space_t::io(IORequest const&, unsigned long, unsigned long, void*, buf_page_t*) /test/10.8_opt_san/storage/innobase/fil/fil0fil.cc:2839 (mariadbd+0x168ec10)
    #6 buf_read_page_low /test/10.8_opt_san/storage/innobase/buf/buf0rea.cc:333 (mariadbd+0x163483c)
    #7 buf_read_page(page_id_t, unsigned long) /test/10.8_opt_san/storage/innobase/buf/buf0rea.cc:479 (mariadbd+0x163483c)
    #8 buf_page_get_low(page_id_t, unsigned long, unsigned long, buf_block_t*, unsigned long, mtr_t*, dberr_t*, bool) /test/10.8_opt_san/storage/innobase/buf/buf0buf.cc:2611 (mariadbd+0x161a58e)
    #9 buf_page_get_gen(page_id_t, unsigned long, unsigned long, buf_block_t*, unsigned long, mtr_t*, dberr_t*, bool) /test/10.8_opt_san/storage/innobase/buf/buf0buf.cc:3033 (mariadbd+0x161bbc4)
    #10 ibuf_bitmap_get_map_page /test/10.8_opt_san/storage/innobase/ibuf/ibuf0ibuf.cc:669 (mariadbd+0x143fb2c)
    #11 ibuf_page_low(page_id_t, unsigned long, mtr_t*) /test/10.8_opt_san/storage/innobase/ibuf/ibuf0ibuf.cc:972 (mariadbd+0x143fb2c)
    #12 buf_read_page_low /test/10.8_opt_san/storage/innobase/buf/buf0rea.cc:288 (mariadbd+0x1634a47)
    #13 buf_read_page_background(fil_space_t*, page_id_t, unsigned long) /test/10.8_opt_san/storage/innobase/buf/buf0rea.cc:499 (mariadbd+0x1634a47)
    #14 buf_load /test/10.8_opt_san/storage/innobase/buf/buf0dump.cc:686 (mariadbd+0x1625622)
    #15 buf_dump_load_func /test/10.8_opt_san/storage/innobase/buf/buf0dump.cc:771 (mariadbd+0x1626251)
    #16 tpool::task::execute() /test/10.8_opt_san/tpool/task.cc:37 (mariadbd+0x173cd8f)
    #17 tpool::thread_pool_generic::worker_main(tpool::worker_data*) /test/10.8_opt_san/tpool/tpool_generic.cc:549 (mariadbd+0x173a004)
    #18 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+0x173aef7)
    #19 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+0x173aef7)
    #20 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+0x173aef7)
    #21 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+0x173aef7)
    #22 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+0x173aef7)
    #23 <null> <null> (libstdc++.so.6+0xd6de3)
 
  Previous write of size 8 at 0x5594eb418df8 by main thread:
    #0 memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:795 (libtsan.so.0+0x3790f)
    #1 memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:793 (libtsan.so.0+0x3790f)
    #2 memset /usr/include/x86_64-linux-gnu/bits/string_fortified.h:71 (mariadbd+0x13e2785)
    #3 innodb_init /test/10.8_opt_san/storage/innobase/handler/ha_innodb.cc:4231 (mariadbd+0x13e2785)
    #4 ha_initialize_handlerton(st_plugin_int*) /test/10.8_opt_san/sql/handler.cc:649 (mariadbd+0xe06677)
    #5 plugin_initialize /test/10.8_opt_san/sql/sql_plugin.cc:1462 (mariadbd+0x98c3fd)
    #6 plugin_init(int*, char**, int) /test/10.8_opt_san/sql/sql_plugin.cc:1755 (mariadbd+0x98dfbb)
    #7 init_server_components /test/10.8_opt_san/sql/mysqld.cc:5080 (mariadbd+0x756ad4)
    #8 mysqld_main(int, char**) /test/10.8_opt_san/sql/mysqld.cc:5695 (mariadbd+0x760c41)
    #9 main /test/10.8_opt_san/sql/main.cc:34 (mariadbd+0x6f5135)
 
  Location is global 'innodb_counter_value' of size 22560 at 0x5594eb415fc0 (mariadbd+0x000002be8df8)
 
  Thread T5 (tid=2136524, 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_opt_san/tpool/tpool_generic.cc:806 (mariadbd+0x173ac37)
    #3 tpool::thread_pool_generic::submit_task(tpool::task*) /test/10.8_opt_san/tpool/tpool_generic.cc:825 (mariadbd+0x173ac37)
    #4 srv_start(bool) /test/10.8_opt_san/storage/innobase/srv/srv0start.cc:1788 (mariadbd+0x6b6340)
    #5 innodb_init /test/10.8_opt_san/storage/innobase/handler/ha_innodb.cc:4206 (mariadbd+0x13e2648)
    #6 ha_initialize_handlerton(st_plugin_int*) /test/10.8_opt_san/sql/handler.cc:649 (mariadbd+0xe06677)
    #7 plugin_initialize /test/10.8_opt_san/sql/sql_plugin.cc:1462 (mariadbd+0x98c3fd)
    #8 plugin_init(int*, char**, int) /test/10.8_opt_san/sql/sql_plugin.cc:1755 (mariadbd+0x98dfbb)
    #9 init_server_components /test/10.8_opt_san/sql/mysqld.cc:5080 (mariadbd+0x756ad4)
    #10 mysqld_main(int, char**) /test/10.8_opt_san/sql/mysqld.cc:5695 (mariadbd+0x760c41)
    #11 main /test/10.8_opt_san/sql/main.cc:34 (mariadbd+0x6f5135)
 
SUMMARY: ThreadSanitizer: data race /test/10.8_opt_san/storage/innobase/os/os0file.cc:3016 in os_file_pread

Generated at Thu Feb 08 09:29:11 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.