First of all wanted to thank you for this great project, very useful. However, I've been running TSAN with Clang-18 on code that uses metall, and getting lots of data race warnings from the metall allocator. For instance,
WARNING: ThreadSanitizer: data race (pid=23601)
Read of size 8 at 0x7b4c00022be8 by thread T96 (mutexes: write M0):
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::size() const metall/include/metall/kernel/chunk_directory.hpp:249:37
#1 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::all_slots_marked(unsigned int) const metall/include/metall/kernel/chunk_directory.hpp:212:21
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object_from_global_without_bin_lock(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:409:5
#3 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_objects_from_global(unsigned char, unsigned long, long*) metall/include/metall/kernel/segment_allocator.hpp:392:13
#4 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:375:5
#5 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:150:31
#6 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#7 metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#8 metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#9 std::allocator_traits<metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#10 std::_Vector_base<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#11 std::vector<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_default_append(unsigned long) /include/c++/13.2.0/bits/vector.tcc:663:34
#12 std::vector<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::resize(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:1013:4
Previous write of size 8 at 0x7b4c00022be8 by thread T57 (mutexes: write M1):
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::priv_insert_large_chunk(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:605:30
#1 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::insert(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:106:27
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_large_object(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:483:58
#3 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:151:31
#4 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#5 metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#6 metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#7 std::allocator_traits<metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#8 std::_Vector_base<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#9 std::vector<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_default_append(unsigned long) /include/c++/13.2.0/bits/vector.tcc:663:34
#10 std::vector<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::resize(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:1013:4
SUMMARY: ThreadSanitizer: data race metall/include/metall/kernel/chunk_directory.hpp:249:37 in metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::size() const
WARNING: ThreadSanitizer: data race (pid=23601)
Write of size 8 at 0x7b4c00022be8 by thread T76 (mutexes: write M0, write M1):
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::priv_insert_small_chunk(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:562:30
#1 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::insert(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:104:27
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_insert_new_small_object_chunk(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:471:38
#3 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object_from_global_without_bin_lock(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:402:10
#4 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_objects_from_global(unsigned char, unsigned long, long*) metall/include/metall/kernel/segment_allocator.hpp:392:13
#5 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:375:5
#6 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:150:31
#7 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#8 metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#9 metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#10 std::allocator_traits<metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#11 std::_Vector_base<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#12 void std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_range_initialize<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>>(std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::forward_iterator_tag) /include/c++/13.2.0/bits/stl_vector.h:1689:14
#13 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::vector<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, void>(std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&) /include/c++/13.2.0/bits/stl_vector.h:708:4
#14 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::__make_from_tuple_impl<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>, 0ul, 1ul, 2ul>(std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>&&, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>) /include/c++/13.2.0/tuple:2309:14
#15 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::make_from_tuple<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>>(std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>&&) /include/c++/13.2.0/tuple:2324:14
#16 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::make_obj_using_allocator<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>>(metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&) /include/c++/13.2.0/bits/uses_allocator_args.h:232:14
Previous read of size 8 at 0x7b4c00022be8 by thread T44:
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::size() const metall/include/metall/kernel/chunk_directory.hpp:249:37
#1 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::size() const metall/include/metall/kernel/segment_allocator.hpp:237:53
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:153:5
#3 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#4 metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#5 metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#6 std::allocator_traits<metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#7 std::_Vector_base<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#8 void std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_range_initialize<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>>(std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::forward_iterator_tag) /include/c++/13.2.0/bits/stl_vector.h:1689:14
#9 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::vector<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, void>(std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&) /include/c++/13.2.0/bits/stl_vector.h:708:4
#10 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::__make_from_tuple_impl<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>, 0ul, 1ul, 2ul>(std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>&&, std::integer_sequence<unsigned long, 0ul, 1ul, 2ul>) /include/c++/13.2.0/tuple:2309:14
#11 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::make_from_tuple<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>>(std::tuple<std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>&&) /include/c++/13.2.0/tuple:2324:14
#12 std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>> std::make_obj_using_allocator<std::vector<unsigned long, metall::stl_allocator<unsigned long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>>(metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&, std::move_iterator<__gnu_cxx::__normal_iterator<unsigned long*, std::vector<unsigned long, std::allocator<unsigned long>>>>&&) /include/c++/13.2.0/bits/uses_allocator_args.h:232:14
SUMMARY: ThreadSanitizer: data race metall/include/metall/kernel/chunk_directory.hpp:562:30 in metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::priv_insert_small_chunk(unsigned char)
WARNING: ThreadSanitizer: data race (pid=23601)
Write of size 8 at 0x7b4c00022b60 by thread T135 (mutexes: write M0, write M1):
#0 metall::kernel::mmap_segment_storage<long, unsigned long>::priv_extend(unsigned long) metall/include/metall/kernel/segment_storage/mmap_segment_storage.hpp:424:30
#1 metall::kernel::mmap_segment_storage<long, unsigned long>::extend(unsigned long) metall/include/metall/kernel/segment_storage/mmap_segment_storage.hpp:172:12
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_extend_segment(unsigned int, unsigned long) metall/include/metall/kernel/segment_allocator.hpp:502:29
#3 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_insert_new_small_object_chunk(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:472:10
#4 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object_from_global_without_bin_lock(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:402:10
#5 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_objects_from_global(unsigned char, unsigned long, long*) metall/include/metall/kernel/segment_allocator.hpp:392:13
#6 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_small_object(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:375:5
#7 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:150:31
#8 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#9 metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#10 metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#11 std::allocator_traits<metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#12 std::_Vector_base<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#13 std::vector<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_default_append(unsigned long) /include/c++/13.2.0/bits/vector.tcc:663:34
#14 std::vector<long, metall::stl_allocator<long, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::resize(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:1013:4
Previous read of size 8 at 0x7b4c00022b60 by main thread (mutexes: write M2):
#0 metall::kernel::mmap_segment_storage<long, unsigned long>::size() const metall/include/metall/kernel/segment_storage/mmap_segment_storage.hpp:199:35
#1 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:96:3
#2 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* metall::kernel::manager_kernel<unsigned int, 2097152ul>::priv_generic_construct<test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>>(boost::interprocess::ipcdetail::char_ptr_holder<char>, unsigned long, bool, boost::interprocess::ipcdetail::in_place_interface&) metall/include/metall/kernel/manager_kernel_impl.ipp:834:11
#3 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* metall::kernel::manager_kernel<unsigned int, 2097152ul>::generic_construct<test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>>(boost::interprocess::ipcdetail::char_ptr_holder<char>, unsigned long, bool, bool, boost::interprocess::ipcdetail::in_place_interface&) metall/include/metall/kernel/manager_kernel_impl.ipp:429:10
#4 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* boost::interprocess::ipcdetail::named_proxy<metall::kernel::manager_kernel<unsigned int, 2097152ul>, test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, false>::operator()<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>(metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&) const boost/interprocess/detail/named_proxy.hpp:132:10
SUMMARY: ThreadSanitizer: data race metall/include/metall/kernel/segment_storage/mmap_segment_storage.hpp:424:30 in metall::kernel::mmap_segment_storage<long, unsigned long>::priv_extend(unsigned long)
WARNING: ThreadSanitizer: data race (pid=23601)
Write of size 8 at 0x7b4c00025ce8 by thread T78 (mutexes: write M0):
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::priv_insert_large_chunk(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:605:30
#1 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::insert(unsigned char) metall/include/metall/kernel/chunk_directory.hpp:106:27
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::priv_allocate_large_object(unsigned char) metall/include/metall/kernel/segment_allocator.hpp:483:58
#3 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:151:31
#4 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#5 metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::priv_allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:176:51
#6 metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>::allocate(unsigned long) const metall/include/metall/stl_allocator.hpp:120:54
#7 std::allocator_traits<metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::allocate(metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>&, unsigned long) /include/c++/13.2.0/bits/alloc_traits.h:333:20
#8 std::_Vector_base<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_allocate(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:378:20
#9 std::vector<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::_M_default_append(unsigned long) /include/c++/13.2.0/bits/vector.tcc:663:34
#10 std::vector<float, metall::stl_allocator<float, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>::resize(unsigned long) /include/c++/13.2.0/bits/stl_vector.h:1013:4
Previous read of size 8 at 0x7b4c00025ce8 by main thread (mutexes: write M1):
#0 metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::size() const metall/include/metall/kernel/chunk_directory.hpp:249:37
#1 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::size() const metall/include/metall/kernel/segment_allocator.hpp:237:53
#2 metall::kernel::segment_allocator<unsigned int, unsigned long, long, 2097152ul, 281474976710656ul, metall::kernel::mmap_segment_storage<long, unsigned long>>::allocate(unsigned long) metall/include/metall/kernel/segment_allocator.hpp:153:5
#3 metall::kernel::manager_kernel<unsigned int, 2097152ul>::allocate(unsigned long) metall/include/metall/kernel/manager_kernel_impl.ipp:91:50
#4 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* metall::kernel::manager_kernel<unsigned int, 2097152ul>::priv_generic_construct<test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>>(boost::interprocess::ipcdetail::char_ptr_holder<char>, unsigned long, bool, boost::interprocess::ipcdetail::in_place_interface&) metall/include/metall/kernel/manager_kernel_impl.ipp:834:11
#5 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* metall::kernel::manager_kernel<unsigned int, 2097152ul>::generic_construct<test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>>(boost::interprocess::ipcdetail::char_ptr_holder<char>, unsigned long, bool, bool, boost::interprocess::ipcdetail::in_place_interface&) metall/include/metall/kernel/manager_kernel_impl.ipp:429:10
#6 test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>* boost::interprocess::ipcdetail::named_proxy<metall::kernel::manager_kernel<unsigned int, 2097152ul>, test_object<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>>>, false>::operator()<metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&>(metall::stl_allocator<std::byte, metall::kernel::manager_kernel<unsigned int, 2097152ul>> const&) const boost/interprocess/detail/named_proxy.hpp:132:10
SUMMARY: ThreadSanitizer: data race metall/include/metall/kernel/chunk_directory.hpp:605:30 in metall::kernel::chunk_directory<unsigned int, 2097152ul, 281474976710656ul>::priv_insert_large_chunk(unsigned char)