Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TSan] Bitfield data race in scan_relocations #594

Closed
ishitatsuyuki opened this issue Jul 30, 2022 · 2 comments
Closed

[TSan] Bitfield data race in scan_relocations #594

ishitatsuyuki opened this issue Jul 30, 2022 · 2 comments

Comments

@ishitatsuyuki
Copy link
Contributor

It appears that there are some kind of data race happening with the symbol bitfields during relocation processing. (I'm guessing that these are not directly aliasing, but indirectly through the storage sharing of bitfields)

Reproducible on the Threadripper 3990X build server with make test-tsan -j128. The offending test has always been canonical-plt in my attempts.

Lines are from 467294e.

Summarized stacks:

Read of size 2 at 0x7b14000054fd by main thread:
    #0 mold::elf::InputSection<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/arch-x86-64.cc:689:45 (mold+0x220614)
    #1 mold::elf::ObjectFile<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-files.cc:1087:13 (mold+0x474b07)
    #2 void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)::operator()(mold::elf::ObjectFile<mold::elf::X86_64>*) const /home/ishitatsuyuki/mold/elf/passes.cc:883:11 (mold+0xa6484d)
Previous write of size 2 at 0x7b14000054fd by thread T15:
    #0 mold::elf::InputSection<mold::elf::X86_64>::dispatch(mold::elf::Context<mold::elf::X86_64>&, mold::elf::InputSection<mold::elf::X86_64>::Action (*) [4], long, mold::elf::ElfRel<mold::elf::X86_64> const&, mold::elf::Symbol<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-sections.cc:182:22 (mold+0x55bdc3) 
    #1 mold::elf::InputSection<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/arch-x86-64.cc:642:7 (mold+0x2202e1)
    #2 mold::elf::ObjectFile<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-files.cc:1087:13 (mold+0x474b07)
Full log
WARNING: ThreadSanitizer: data race (pid=935417)
  Read of size 2 at 0x7b14000054fd by main thread:
    #0 mold::elf::InputSection<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/arch-x86-64.cc:689:45 (mold+0x220614) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #1 mold::elf::ObjectFile<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-files.cc:1087:13 (mold+0x474b07) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #2 void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)::operator()(mold::elf::ObjectFile<mold::elf::X86_64>*) const /home/ishitatsuyuki/mold/elf/passes.cc:883:11 (mold+0xa6484d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #3 decltype((fp(std::forward<mold::elf::X86_64>(fp0))) , ((void)())) tbb::detail::d2::parallel_for_each_operator_selector<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)>::call<mold::elf::ObjectFile<mold::elf::X86_64>*&, tbb::detail::d2::feeder_impl<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*> >(void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*) const&, mold::elf::X86_64&&, tbb::detail::d2::feeder_impl<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>*) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:95:9 (mold+0xa647f1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #4 tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>::operator()(tbb::detail::d1::blocked_range<unsigned long>) const /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:400:13 (mold+0xa6476f) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #5 tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>::run_body(tbb::detail::d1::blocked_range<unsigned long>&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:119:9 (mold+0xa6459c) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #6 void tbb::detail::d1::dynamic_grainsize_mode<tbb::detail::d1::adaptive_mode<tbb::detail::d1::auto_partition_type> >::work_balance<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>, tbb::detail::d1::blocked_range<unsigned long> >(mold::elf::X86_64&, tbb::detail::d1::blocked_range<unsigned long>&, tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/partitioner.h:447:19 (mold+0xa64005) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #7 void tbb::detail::d1::partition_type_base<tbb::detail::d1::auto_partition_type>::execute<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>, tbb::detail::d1::blocked_range<unsigned long> >(mold::elf::X86_64&, tbb::detail::d1::blocked_range<unsigned long>&, tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/partitioner.h:288:16 (mold+0xa63de7) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #8 tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>::execute(tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:172:18 (mold+0xa63b11) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #9 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::external_waiter>(tbb::detail::d1::task*, tbb::detail::r1::external_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:322:32 (mold+0xea04da) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #10 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::external_waiter>(tbb::detail::d1::task*, tbb::detail::r1::external_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:463:16 (mold+0xe9e7d0) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #11 tbb::detail::r1::task_dispatcher::execute_and_wait(tbb::detail::d1::task*, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:168:18 (mold+0xe9e7d0)
    #12 tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:121:5 (mold+0xe9e688) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #13 tbb::detail::d1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/detail/_task.h:191:5 (mold+0x150425) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #14 tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>::run(tbb::detail::d1::blocked_range<unsigned long> const&, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*> const&, tbb::detail::d1::auto_partitioner const&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:114:13 (mold+0xa63800) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #15 void tbb::detail::d1::parallel_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*> >(mold::elf::X86_64 const&, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*> const&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:271:5 (mold+0xa63672) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #16 tbb::detail::d2::for_each_root_task<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*, std::random_access_iterator_tag>::execute(tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:555:9 (mold+0xa634fb) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #17 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::external_waiter>(tbb::detail::d1::task*, tbb::detail::r1::external_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:322:32 (mold+0xea04da) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #18 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::external_waiter>(tbb::detail::d1::task*, tbb::detail::r1::external_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:463:16 (mold+0xe9e7d0) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #19 tbb::detail::r1::task_dispatcher::execute_and_wait(tbb::detail::d1::task*, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:168:18 (mold+0xe9e7d0)
    #20 tbb::detail::r1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:121:5 (mold+0xe9e688) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #21 tbb::detail::d1::execute_and_wait(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&, tbb::detail::d1::wait_context&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/detail/_task.h:191:5 (mold+0x150425) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #22 void tbb::detail::d2::run_parallel_for_each<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)>(mold::elf::X86_64, mold::elf::X86_64, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*) const&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:603:9 (mold+0xa63107) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #23 void tbb::detail::d2::parallel_for_each<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)>(mold::elf::X86_64, mold::elf::X86_64, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*) const&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:635:5 (mold+0xa62fe2) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #24 void tbb::detail::d2::parallel_for_each<std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)>(mold::elf::X86_64&, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*) const&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:641:5 (mold+0x988903) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #25 void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/passes.cc:882:3 (mold+0x987a74) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #26 int mold::elf::elf_main<mold::elf::X86_64>(int, char**) /home/ishitatsuyuki/mold/elf/main.cc:583:3 (mold+0x5bce79) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #27 mold::elf::main(int, char**) /home/ishitatsuyuki/mold/elf/main.cc:762:10 (mold+0x5bbd91) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #28 main /home/ishitatsuyuki/mold/main.cc:87:10 (mold+0x15b903) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)

  Previous write of size 2 at 0x7b14000054fd by thread T15:
    #0 mold::elf::InputSection<mold::elf::X86_64>::dispatch(mold::elf::Context<mold::elf::X86_64>&, mold::elf::InputSection<mold::elf::X86_64>::Action (*) [4], long, mold::elf::ElfRel<mold::elf::X86_64> const&, mold::elf::Symbol<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-sections.cc:182:22 (mold+0x55bdc3) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #1 mold::elf::InputSection<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/arch-x86-64.cc:642:7 (mold+0x2202e1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #2 mold::elf::ObjectFile<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-files.cc:1087:13 (mold+0x474b07) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #3 void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)::operator()(mold::elf::ObjectFile<mold::elf::X86_64>*) const /home/ishitatsuyuki/mold/elf/passes.cc:883:11 (mold+0xa6484d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #4 decltype((fp(std::forward<mold::elf::X86_64>(fp0))) , ((void)())) tbb::detail::d2::parallel_for_each_operator_selector<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*)>::call<mold::elf::ObjectFile<mold::elf::X86_64>*&, tbb::detail::d2::feeder_impl<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*> >(void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*) const&, mold::elf::X86_64&&, tbb::detail::d2::feeder_impl<void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>*) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:95:9 (mold+0xa647f1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #5 tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>::operator()(tbb::detail::d1::blocked_range<unsigned long>) const /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for_each.h:400:13 (mold+0xa6476f) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #6 tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>::run_body(tbb::detail::d1::blocked_range<unsigned long>&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:119:9 (mold+0xa6459c) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #7 void tbb::detail::d1::dynamic_grainsize_mode<tbb::detail::d1::adaptive_mode<tbb::detail::d1::auto_partition_type> >::work_balance<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>, tbb::detail::d1::blocked_range<unsigned long> >(mold::elf::X86_64&, tbb::detail::d1::blocked_range<unsigned long>&, tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/partitioner.h:447:19 (mold+0xa64005) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #8 void tbb::detail::d1::partition_type_base<tbb::detail::d1::auto_partition_type>::execute<tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>, tbb::detail::d1::blocked_range<unsigned long> >(mold::elf::X86_64&, tbb::detail::d1::blocked_range<unsigned long>&, tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/partitioner.h:288:16 (mold+0xa63de7) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #9 tbb::detail::d1::start_for<tbb::detail::d1::blocked_range<unsigned long>, tbb::detail::d2::parallel_for_body_wrapper<__gnu_cxx::__normal_iterator<mold::elf::ObjectFile<mold::elf::X86_64>**, std::vector<mold::elf::ObjectFile<mold::elf::X86_64>*, std::allocator<mold::elf::ObjectFile<mold::elf::X86_64>*> > >, void mold::elf::scan_rels<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&)::'lambda'(mold::elf::ObjectFile<mold::elf::X86_64>*), mold::elf::ObjectFile<mold::elf::X86_64>*>, tbb::detail::d1::auto_partitioner const>::execute(tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/parallel_for.h:172:18 (mold+0xa63b11) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #10 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::outermost_worker_waiter>(tbb::detail::d1::task*, tbb::detail::r1::outermost_worker_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:322:32 (mold+0xe8323a) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #11 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::outermost_worker_waiter>(tbb::detail::d1::task*, tbb::detail::r1::outermost_worker_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:463:16 (mold+0xe7d1a1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #12 tbb::detail::r1::arena::process(tbb::detail::r1::thread_data&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/arena.cpp:138:43 (mold+0xe7d1a1)
    #13 tbb::detail::r1::market::process(rml::job&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/market.cpp:597:16 (mold+0xe97662) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #14 tbb::detail::r1::rml::private_worker::run() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:267:23 (mold+0xe9ac21) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #15 tbb::detail::r1::rml::private_worker::thread_routine(void*) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:221:11 (mold+0xe9aa75) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)

  Location is heap block of size 80 at 0x7b14000054b0 allocated by thread T1:
    #0 malloc <null> (mold+0xbf9d1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #1 tbb::detail::r1::allocate_memory(unsigned long) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/allocator.cpp:215:20 (mold+0xe7c5ca) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #2 tbb::detail::d1::tbb_allocator<tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node>::allocate(unsigned long) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/tbb_allocator.h:60:32 (mold+0x28d542) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #3 std::allocator_traits<tbb::detail::d1::tbb_allocator<tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node> >::allocate(tbb::detail::d1::tbb_allocator<tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node>&, unsigned long) /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/alloc_traits.h:318:20 (mold+0x28d2f5) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #4 tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::create_node<std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> >(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64>&&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:664:26 (mold+0x28d1d8) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #5 tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::allocate_node_move_construct(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:681:16 (mold+0x286d3d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #6 tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::allocate_node_helper<std::basic_string_view<char, std::char_traits<char> >, tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* (*)(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*)>(std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*, tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* (*)(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*), std::integral_constant<bool, true>) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:1273:16 (mold+0x2871c2) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #7 bool tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::lookup<true, std::basic_string_view<char, std::char_traits<char> >, tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* (*)(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*)>(std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*, tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::const_accessor*, bool, tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node* (*)(tbb::detail::d1::tbb_allocator<tbb::detail::d2::hash_map_base<tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > >, tbb::detail::d1::spin_rw_mutex>::bucket>&, std::basic_string_view<char, std::char_traits<char> > const&, mold::elf::Symbol<mold::elf::X86_64> const*), tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::node*) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:1304:33 (mold+0x286857) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #8 bool tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::generic_move_insert<tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::const_accessor&>(tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::const_accessor&, std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> >&&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:1380:16 (mold+0x28658d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #9 tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::insert(tbb::detail::d2::concurrent_hash_map<std::basic_string_view<char, std::char_traits<char> >, mold::elf::Symbol<mold::elf::X86_64>, HashCmp, tbb::detail::d1::tbb_allocator<std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> > > >::const_accessor&, std::pair<std::basic_string_view<char, std::char_traits<char> > const, mold::elf::Symbol<mold::elf::X86_64> >&&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/concurrent_hash_map.h:1196:16 (mold+0x28607d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #10 mold::elf::Symbol<mold::elf::X86_64>* mold::elf::get_symbol<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >) /home/ishitatsuyuki/mold/elf/mold.h:1959:18 (mold+0x285f94) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #11 mold::elf::Symbol<mold::elf::X86_64>* mold::elf::get_symbol<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::basic_string_view<char, std::char_traits<char> >) /home/ishitatsuyuki/mold/elf/mold.h:1965:10 (mold+0x23ccb9) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #12 mold::elf::SharedFile<mold::elf::X86_64>::parse(mold::elf::Context<mold::elf::X86_64>&) /home/ishitatsuyuki/mold/elf/input-files.cc:1378:31 (mold+0x47a727) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #13 mold::elf::SharedFile<mold::elf::X86_64>* mold::elf::new_shared_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*)::'lambda'()::operator()() const /home/ishitatsuyuki/mold/elf/main.cc:66:35 (mold+0x5f3d2e) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #14 tbb::detail::d1::task* tbb::detail::d2::(anonymous namespace)::task_ptr_or_nullptr<mold::elf::SharedFile<mold::elf::X86_64>* mold::elf::new_shared_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*)::'lambda'() const&>(mold::elf::X86_64&&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/task_group.h:135:9 (mold+0x5f3c1d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #15 tbb::detail::d1::function_task<mold::elf::SharedFile<mold::elf::X86_64>* mold::elf::new_shared_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*)::'lambda'()>::execute(tbb::detail::d1::execution_data&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/task_group.h:466:21 (mold+0x5f3b69) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #16 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<false, tbb::detail::r1::outermost_worker_waiter>(tbb::detail::d1::task*, tbb::detail::r1::outermost_worker_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:322:32 (mold+0xe8323a) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #17 tbb::detail::d1::task* tbb::detail::r1::task_dispatcher::local_wait_for_all<tbb::detail::r1::outermost_worker_waiter>(tbb::detail::d1::task*, tbb::detail::r1::outermost_worker_waiter&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.h:463:16 (mold+0xe7d1a1) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #18 tbb::detail::r1::arena::process(tbb::detail::r1::thread_data&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/arena.cpp:138:43 (mold+0xe7d1a1)
    #19 tbb::detail::r1::market::process(rml::job&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/market.cpp:597:16 (mold+0xe97662) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #20 tbb::detail::r1::rml::private_worker::run() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:267:23 (mold+0xe9ac21) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #21 tbb::detail::r1::rml::private_worker::thread_routine(void*) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:221:11 (mold+0xe9aa75) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)

  Thread T15 (tid=935763, running) created by thread T10 at:
    #0 pthread_create <null> (mold+0xc118d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #1 tbb::detail::r1::rml::internal::thread_monitor::launch(void* (*)(void*), void*, unsigned long) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/rml_thread_monitor.h:212:20 (mold+0xe9bcd2) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #2 tbb::detail::r1::rml::private_worker::wake_or_launch() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:299:21 (mold+0xe9b924) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #3 tbb::detail::r1::rml::private_server::wake_some(int) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:407:13 (mold+0xe9b7a4) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #4 tbb::detail::r1::rml::private_server::propagate_chain_reaction() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:159:13 (mold+0xe9aacf) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #5 tbb::detail::r1::rml::private_worker::run() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:258:15 (mold+0xe9aacf)
    #6 tbb::detail::r1::rml::private_worker::thread_routine(void*) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:221:11 (mold+0xe9aa75) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)

  Thread T1 (tid=935425, running) created by main thread at:
    #0 pthread_create <null> (mold+0xc118d) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #1 tbb::detail::r1::rml::internal::thread_monitor::launch(void* (*)(void*), void*, unsigned long) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/rml_thread_monitor.h:212:20 (mold+0xe9bcd2) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #2 tbb::detail::r1::rml::private_worker::wake_or_launch() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:299:21 (mold+0xe9b924) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #3 tbb::detail::r1::rml::private_server::wake_some(int) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:407:13 (mold+0xe9b7a4) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #4 tbb::detail::r1::rml::private_server::adjust_job_count_estimate(int) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/private_server.cpp:418:9 (mold+0xe9b812) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #5 tbb::detail::r1::market::adjust_demand(tbb::detail::r1::arena&, int, bool) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/market.cpp:586:16 (mold+0xe975d0) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #6 void tbb::detail::r1::arena::advertise_new_work<(tbb::detail::r1::arena::new_work_type)0>() /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/arena.h:547:24 (mold+0xe9dcb9) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #7 tbb::detail::r1::spawn_and_notify(tbb::detail::d1::task&, tbb::detail::r1::arena_slot*, tbb::detail::r1::arena*) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:26:8 (mold+0xe9dcb9)
    #8 tbb::detail::r1::spawn(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/src/tbb/task_dispatcher.cpp:39:5 (mold+0xe9dcb9)
    #9 tbb::detail::d1::spawn(tbb::detail::d1::task&, tbb::detail::d1::task_group_context&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/detail/_task.h:182:5 (mold+0x151473) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #10 void tbb::detail::d1::task_group::run<mold::elf::ObjectFile<mold::elf::X86_64>* mold::elf::new_object_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)::'lambda'()>(mold::elf::X86_64&&) /home/ishitatsuyuki/mold/third-party/tbb/include/tbb/../oneapi/tbb/task_group.h:629:9 (mold+0x5f3262) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #11 mold::elf::ObjectFile<mold::elf::X86_64>* mold::elf::new_object_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) /home/ishitatsuyuki/mold/elf/main.cc:32:10 (mold+0x5b910b) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #12 void mold::elf::read_file<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, mold::MappedFile<mold::elf::Context<mold::elf::X86_64> >*) /home/ishitatsuyuki/mold/elf/main.cc:80:24 (mold+0x5f6df9) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #13 void mold::elf::read_input_files<mold::elf::X86_64>(mold::elf::Context<mold::elf::X86_64>&, std::span<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, 18446744073709551615ul>) /home/ishitatsuyuki/mold/elf/main.cc:250:7 (mold+0x5c4e6e) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #14 int mold::elf::elf_main<mold::elf::X86_64>(int, char**) /home/ishitatsuyuki/mold/elf/main.cc:446:3 (mold+0x5bc5cf) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #15 mold::elf::main(int, char**) /home/ishitatsuyuki/mold/elf/main.cc:762:10 (mold+0x5bbd91) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)
    #16 main /home/ishitatsuyuki/mold/main.cc:87:10 (mold+0x15b903) (BuildId: fed095d90b73da9541bbece1d80e015764bcb585)

SUMMARY: ThreadSanitizer: data race /home/ishitatsuyuki/mold/elf/arch-x86-64.cc:689:45 in mold::elf::InputSection<mold::elf::X86_64>::scan_relocations(mold::elf::Context<mold::elf::X86_64>&)
@rui314
Copy link
Owner

rui314 commented Jul 30, 2022

I believe it's because we read from sym.is_imported in get_sym_type and write to sym.is_canonical in dispatch. They are bitfields sharing the same byte. I have a few different ideas to fix the issue. Let me try them tomorrow.

@rui314 rui314 closed this as completed in bc81472 Jul 31, 2022
@ishitatsuyuki
Copy link
Contributor Author

Thanks, the fix looks nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants