Description:
Running e.g. main.alter_table with ThreadSanitizer gives:
WARNING: ThreadSanitizer: data race (pid=31643)
Write of size 8 at 0x000004b1d088 by thread T29:
#0 my_timer_microseconds /export/home/repo/mysql-ubsan/mysys/my_rdtsc.cc:239 (mysqld+0x00000263ca10)
#1 get_timer_raw_value_and_function(enum_timer_name, unsigned long long (**)()) /export/home/repo/mysql-ubsan/storage/perfschema/pfs_timer.cc:265 (mysqld+0x000002549adf)
#2 pfs_start_idle_wait_v1 /export/home/repo/mysql-ubsan/storage/perfschema/pfs.cc:4086 (mysqld+0x0000025140f5)
#3 inline_mysql_start_idle_wait(PSI_idle_locker_state_v1*, char const*, int) /export/home/repo/mysql-ubsan/include/mysql/psi/mysql_idle.h:79 (mysqld+0x000001880575)
#4 net_before_header_psi(st_net*, void*, unsigned long) /export/home/repo/mysql-ubsan/sql/conn_handler/init_net_server_extension.cc:60 (mysqld+0x00000188032d)
#5 net_read_packet_header(st_net*) /export/home/repo/mysql-ubsan/sql/net_serv.cc:850 (mysqld+0x000001ed9206)
#6 net_read_packet(st_net*, unsigned long*) /export/home/repo/mysql-ubsan/sql/net_serv.cc:917 (mysqld+0x000001ed8cdc)
#7 my_net_read /export/home/repo/mysql-ubsan/sql/net_serv.cc:990 (mysqld+0x000001ed88b7)
#8 Protocol_classic::read_packet() /export/home/repo/mysql-ubsan/sql/protocol_classic.cc:1250 (mysqld+0x000001f0c8b1)
#9 Protocol_classic::get_command(COM_DATA*, enum_server_command*) /export/home/repo/mysql-ubsan/sql/protocol_classic.cc:1401 (mysqld+0x000001f0cef3)
#10 do_command(THD*) /export/home/repo/mysql-ubsan/sql/sql_parse.cc:1043 (mysqld+0x00000157ffff)
#11 handle_connection(void*) /export/home/repo/mysql-ubsan/sql/conn_handler/connection_handler_per_thread.cc:323 (mysqld+0x00000187ad63)
#12 pfs_spawn_thread(void*) /export/home/repo/mysql-ubsan/storage/perfschema/pfs.cc:2363 (mysqld+0x0000025103f7)
Previous write of size 8 at 0x000004b1d088 by thread T28:
#0 my_timer_microseconds /export/home/repo/mysql-ubsan/mysys/my_rdtsc.cc:239 (mysqld+0x00000263ca10)
#1 get_timer_raw_value_and_function(enum_timer_name, unsigned long long (**)()) /export/home/repo/mysql-ubsan/storage/perfschema/pfs_timer.cc:265 (mysqld+0x000002549adf)
#2 pfs_start_idle_wait_v1 /export/home/repo/mysql-ubsan/storage/perfschema/pfs.cc:4086 (mysqld+0x0000025140f5)
#3 inline_mysql_start_idle_wait(PSI_idle_locker_state_v1*, char const*, int) /export/home/repo/mysql-ubsan/include/mysql/psi/mysql_idle.h:79 (mysqld+0x000001880575)
#4 net_before_header_psi(st_net*, void*, unsigned long) /export/home/repo/mysql-ubsan/sql/conn_handler/init_net_server_extension.cc:60 (mysqld+0x00000188032d)
#5 net_read_packet_header(st_net*) /export/home/repo/mysql-ubsan/sql/net_serv.cc:850 (mysqld+0x000001ed9206)
#6 net_read_packet(st_net*, unsigned long*) /export/home/repo/mysql-ubsan/sql/net_serv.cc:917 (mysqld+0x000001ed8cdc)
#7 my_net_read /export/home/repo/mysql-ubsan/sql/net_serv.cc:990 (mysqld+0x000001ed88b7)
#8 Protocol_classic::read_packet() /export/home/repo/mysql-ubsan/sql/protocol_classic.cc:1250 (mysqld+0x000001f0c8b1)
#9 Protocol_classic::get_command(COM_DATA*, enum_server_command*) /export/home/repo/mysql-ubsan/sql/protocol_classic.cc:1401 (mysqld+0x000001f0cef3)
#10 do_command(THD*) /export/home/repo/mysql-ubsan/sql/sql_parse.cc:1043 (mysqld+0x00000157ffff)
#11 handle_connection(void*) /export/home/repo/mysql-ubsan/sql/conn_handler/connection_handler_per_thread.cc:323 (mysqld+0x00000187ad63)
#12 pfs_spawn_thread(void*) /export/home/repo/mysql-ubsan/storage/perfschema/pfs.cc:2363 (mysqld+0x0000025103f7)
How to repeat:
main.alter_table with ThreadSanitizer