==493==ERROR: AddressSanitizer: heap-use-after-free on address 0x60e00000dbf0 at pc 0x0000031c2215 bp 0x7f4d8d27c7e0 sp 0x7f4d8d27bf90 READ of size 11 at 0x60e00000dbf0 thread T28 ==493==AddressSanitizer: while reporting a bug found another one. Ignoring. ==493==AddressSanitizer: while reporting a bug found another one. Ignoring. #0 0x31c2214 in __asan_memcpy ../../.././libsanitizer/asan/asan_interceptors.cc:367 #1 0x58ed8bb in set_thread_resource_group(PFS_thread*, char const*, int, void*) mysql-8.0.20/storage/perfschema/pfs.cc:3244 #2 0x58ed9ef in pfs_set_thread_resource_group_by_id_vc(PSI_thread*, unsigned long long, char const*, int, void*) mysql-8.0.20/storage/perfschema/pfs.cc:3276 #3 0x5948f43 in impl_pfs_set_thread_resource_group_by_id(PSI_thread*, unsigned long long, char const*, int, void*) mysql-8.0.20/storage/perfschema/service_pfs_resource_group.cc:61 #4 0x32c4e5d in resourcegroups::Resource_group_mgr::set_res_grp_in_pfs(char const*, int, unsigned long long) mysql-8.0.20/sql/resourcegroups/resource_group_mgr.h:232 #5 0x32c0609 in resourcegroups::thread_create_callback(PSI_thread_attrs_v3 const*) mysql-8.0.20/sql/resourcegroups/resource_group_mgr.cc:79 #6 0x5947ade in pfs_notify_thread_create(PSI_thread*) mysql-8.0.20/storage/perfschema/service_pfs_notification.cc:354 #7 0x58dc307 in pfs_spawn_thread mysql-8.0.20/storage/perfschema/pfs.cc:2842 #8 0x7f4dace36e24 in start_thread (/lib64/libpthread.so.0+0x7e24) #9 0x7f4dab0d235c in clone (/lib64/libc.so.6+0xf835c) 0x60e00000dbf0 is located 16 bytes inside of 160-byte region [0x60e00000dbe0,0x60e00000dc80) freed by thread T0 here: #0 0x31cf4f2 in operator delete(void*, unsigned long) ../../.././libsanitizer/asan/asan_new_delete.cc:108 #1 0x32c7f47 in std::default_delete::operator()(resourcegroups::Resource_group*) const (mysql-8.0.20/mysql_install/bin/mysqld+0x32c7f47) #2 0x32c7f97 in std::unique_ptr >::~unique_ptr() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c7f97) #3 0x32c8f8a in std::pair, std::allocator > const, std::unique_ptr > >::~pair() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c8f8a) #4 0x32c8fce in Malloc_allocator, std::allocator > const, std::unique_ptr > > >::destroy(std::pair, std::allocator > const, std::unique_ptr > >*) (mysql-8.0.20/mysql_install/bin/mysqld+0x32c8fce) #5 0x32c8fd9 in std::enable_if, std::allocator > const, std::unique_ptr > > > >::__destroy_helper, std::allocator > const, std::unique_ptr > > >::type>::value, void>::type std::allocator_traits, std::allocator > const, std::unique_ptr > > > >::_S_destroy, std::allocator > const, std::unique_ptr > > >(Malloc_allocator, std::allocator > const, std::unique_ptr > > >&, std::pair, std::allocator > const, std::unique_ptr > >*) (mysql-8.0.20/mysql_install/bin/mysqld+0x32c8fd9) #6 0x32c8fe4 in void std::allocator_traits, std::allocator > const, std::unique_ptr > > > >::destroy, std::allocator > const, std::unique_ptr > > >(Malloc_allocator, std::allocator > const, std::unique_ptr > > >&, std::pair, std::allocator > const, std::unique_ptr > >*) (mysql-8.0.20/mysql_install/bin/mysqld+0x32c8fe4) #7 0x32c90ac in std::__detail::_Hashtable_alloc, std::allocator > const, std::unique_ptr > >, true> > >::_M_deallocate_node(std::__detail::_Hash_node, std::allocator > const, std::unique_ptr > >, true>*) (mysql-8.0.20/mysql_install/bin/mysqld+0x32c90ac) #8 0x32c9145 in std::__detail::_Hashtable_alloc, std::allocator > const, std::unique_ptr > >, true> > >::_M_deallocate_nodes(std::__detail::_Hash_node, std::allocator > const, std::unique_ptr > >, true>*) (mysql-8.0.20/mysql_install/bin/mysqld+0x32c9145) #9 0x32c9176 in std::_Hashtable, std::allocator >, std::pair, std::allocator > const, std::unique_ptr > >, Malloc_allocator, std::allocator > const, std::unique_ptr > > >, std::__detail::_Select1st, Collation_key_equal, Collation_hasher, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::clear() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c9176) #10 0x32c921c in std::_Hashtable, std::allocator >, std::pair, std::allocator > const, std::unique_ptr > >, Malloc_allocator, std::allocator > const, std::unique_ptr > > >, std::__detail::_Select1st, Collation_key_equal, Collation_hasher, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits >::~_Hashtable() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c921c) #11 0x32c9234 in std::unordered_map, std::allocator >, std::unique_ptr >, Collation_hasher, Collation_key_equal, Malloc_allocator, std::allocator > const, std::unique_ptr > > > >::~unordered_map() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c9234) #12 0x32c9240 in collation_unordered_map, std::allocator >, std::unique_ptr > >::~collation_unordered_map() (mysql-8.0.20/mysql_install/bin/mysqld+0x32c9240) #13 0x32c0f0b in resourcegroups::Resource_group_mgr::deinit() mysql-8.0.20/sql/resourcegroups/resource_group_mgr.cc:277 #14 0x321f0aa in resourcegroups::Resource_group_mgr::disable_resource_group() (mysql-8.0.20/mysql_install/bin/mysqld+0x321f0aa) #15 0x32159af in init_server_components mysql-8.0.20/sql/mysqld.cc:5637 #16 0x321a1fb in mysqld_main(int, char**) mysql-8.0.20/sql/mysqld.cc:6685 #17 0x31fc478 in main mysql-8.0.20/sql/main.cc:25 #18 0x7f4daaffbc04 in __libc_start_main (/lib64/libc.so.6+0x21c04) previously allocated by thread T0 here: #0 0x31ced0a in operator new(unsigned long, std::nothrow_t const&) ../../.././libsanitizer/asan/asan_new_delete.cc:65 #1 0x32c1d9f in resourcegroups::Resource_group_mgr::init() mysql-8.0.20/sql/resourcegroups/resource_group_mgr.cc:380 #2 0x321be33 in mysqld_main(int, char**) mysql-8.0.20/sql/mysqld.cc:6456 #3 0x31fc478 in main mysql-8.0.20/sql/main.cc:25 #4 0x7f4daaffbc04 in __libc_start_main (/lib64/libc.so.6+0x21c04) Thread T28 created by T0 here: #0 0x316fcc4 in __interceptor_pthread_create ../../.././libsanitizer/asan/asan_interceptors.cc:179 #1 0x4ebc148 in my_thread_create(my_thread_handle*, pthread_attr_t const*, void* (*)(void*), void*) mysql-8.0.20/mysys/my_thread.cc:59 #2 0x58df5f1 in pfs_spawn_thread_vc(unsigned int, my_thread_handle*, pthread_attr_t const*, void* (*)(void*), void*) mysql-8.0.20/storage/perfschema/pfs.cc:2904 #3 0x5af2d92 in inline_mysql_thread_create mysql-8.0.20/include/mysql/psi/mysql_thread.h:140 #4 0x5af2e8e in ngs::thread_create(unsigned int, my_thread_handle*, void* (*)(void*), void*) mysql-8.0.20/plugin/x/ngs/src/thread.cc:43 #5 0x5ae7230 in ngs::Scheduler_dynamic::create_thread() mysql-8.0.20/plugin/x/ngs/src/scheduler.cc:284 #6 0x5ae73d0 in ngs::Scheduler_dynamic::create_min_num_workers() mysql-8.0.20/plugin/x/ngs/src/scheduler.cc:75 #7 0x5ae753c in ngs::Scheduler_dynamic::launch() mysql-8.0.20/plugin/x/ngs/src/scheduler.cc:66 #8 0x5a0e7a2 in ngs::Server::prepare() mysql-8.0.20/plugin/x/src/server/server.cc:163 #9 0x5a03b0d in modules::Module_mysqlx::initialize(void*) mysql-8.0.20/plugin/x/src/module_mysqlx.cc:176 #10 0x348cd26 in plugin_initialize mysql-8.0.20/sql/sql_plugin.cc:1290 #11 0x3494291 in plugin_init_initialize_and_reap mysql-8.0.20/sql/sql_plugin.cc:1430 #12 0x349cb82 in plugin_register_dynamic_and_init_all(int*, char**, int) mysql-8.0.20/sql/sql_plugin.cc:1748 #13 0x3215850 in init_server_components mysql-8.0.20/sql/mysqld.cc:5619 #14 0x321a1fb in mysqld_main(int, char**) mysql-8.0.20/sql/mysqld.cc:6685 #15 0x31fc478 in main mysql-8.0.20/sql/main.cc:25 #16 0x7f4daaffbc04 in __libc_start_main (/lib64/libc.so.6+0x21c04) SUMMARY: AddressSanitizer: heap-use-after-free ../../.././libsanitizer/asan/asan_interceptors.cc:367 __asan_memcpy Shadow bytes around the buggy address: 0x0c1c7fff9b20: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd 0x0c1c7fff9b30: fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa fa 0x0c1c7fff9b40: fa fa fa fa fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff9b50: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa 0x0c1c7fff9b60: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd =>0x0c1c7fff9b70: fd fd fd fd fa fa fa fa fa fa fa fa fd fd[fd]fd 0x0c1c7fff9b80: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x0c1c7fff9b90: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x0c1c7fff9ba0: 00 00 00 00 00 00 00 00 00 00 04 fa fa fa fa fa 0x0c1c7fff9bb0: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 0x0c1c7fff9bc0: 00 00 00 00 00 00 00 00 fa fa fa fa fa fa fa fa Shadow byte legend (one shadow byte represents 8 application bytes): Addressable: 00 Partially addressable: 01 02 03 04 05 06 07 Heap left redzone: fa Heap right redzone: fb Freed heap region: fd Stack left redzone: f1 Stack mid redzone: f2 Stack right redzone: f3 Stack partial redzone: f4 Stack after return: f5 Stack use after scope: f8 Global redzone: f9 Global init order: f6 Poisoned by user: f7 Container overflow: fc Array cookie: ac Intra object redzone: bb ASan internal: fe ==493==ABORTING