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 data race Object::Clone() vs Function::set_optimized_call_site_count() #59594

Open
aam opened this issue Nov 22, 2024 · 1 comment
Open
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening

Comments

@aam
Copy link
Contributor

aam commented Nov 22, 2024

from logs

==================
WARNING: ThreadSanitizer: data race (pid=1170050)
  Read of size 8 at 0x7fd3b529e6f0 by thread T19:
    #0 __tsan_memmove ../../../../../../llvm-llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_memintrinsics.cpp:40:3 (dart+0x22e749e)
    #1 dart::Object::Clone(dart::Object const&, dart::Heap::Space, bool) out/ReleaseTSANX64/../../runtime/vm/object.cc:3028:5 (dart+0x27a6ef1)
    #2 dart::Function::CreateDynamicInvocationForwarder(dart::String const&) const out/ReleaseTSANX64/../../runtime/vm/object.cc:4349:16 (dart+0x27b4bcc)
    #3 dart::Function::GetDynamicInvocationForwarder(dart::String const&) const out/ReleaseTSANX64/../../runtime/vm/object.cc:4429:12 (dart+0x27b52dc)
    #4 dart::ResolveDynamicAnyArgsWithCustomLookup(dart::Zone*, dart::Class const&, dart::String const&, bool, std::_LIBCPP_ABI_NAMESPACE::function<dart::FunctionPtr (dart::Class&, dart::String const&)>) out/ReleaseTSANX64/../../runtime/vm/resolver.cc:70:27 (dart+0x28a01c9)
    #5 dart::ResolveDynamicForReceiverClassWithCustomLookup(dart::Class const&, dart::String const&, dart::ArgumentsDescriptor const&, bool, std::_LIBCPP_ABI_NAMESPACE::function<dart::FunctionPtr (dart::Class&, dart::String const&)>) out/ReleaseTSANX64/../../runtime/vm/resolver.cc:112:13 (dart+0x289fb5b)
    #6 dart::Resolver::ResolveDynamicForReceiverClass(dart::Class const&, dart::String const&, dart::ArgumentsDescriptor const&, bool) out/ReleaseTSANX64/../../runtime/vm/resolver.cc:153:10 (dart+0x289fa4a)
    #7 dart::Resolve(dart::Thread*, dart::Zone*, dart::GrowableArray<dart::Instance const*> const&, dart::Class const&, dart::String const&, dart::Array const&) out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:1874:23 (dart+0x28a99ab)
    #8 dart::PatchableCallHandler::ResolveTargetFunction(dart::Object const&) out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2673:10 (dart+0x28a99ab)
    #9 dart::PatchableCallHandler::ResolveSwitchAndReturn(dart::Object const&) out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2681:31 (dart+0x28a9b7e)
    #10 dart::DRT_HelperSwitchableCallMiss(dart::Isolate*, dart::Thread*, dart::Zone*, dart::NativeArguments) out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2864:11 (dart+0x28aa80e)
    #11 dart::DRT_SwitchableCallMiss(dart::NativeArguments) out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2832:1 (dart+0x28aa80e)
    #12 <null> <null> (0x7fd3bfc82fda)
    #13 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&) out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:38:10 (dart+0x26e6b61)
    #14 dart::DartLibraryCalls::HandleMessage(long, dart::Instance const&) out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:718:28 (dart+0x26e6b61)
    #15 dart::IsolateMessageHandler::HandleMessage(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::Message, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::Message>>) out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1456:15 (dart+0x271f2f1)
    #16 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:229:16 (dart+0x27607a2)
    #17 dart::MessageHandler::TaskCallback() out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:443:18 (dart+0x2760e51)
    #18 dart::MessageHandlerTask::Run() out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:31:15 (dart+0x2761523)
    #19 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:203:15 (dart+0x29053fe)
    #20 dart::ThreadPool::Worker::Main(unsigned long) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:363:9 (dart+0x290595a)
    #21 dart::ThreadStart(void*) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:97:5 (dart+0x2876826)

  Previous atomic write of size 2 at 0x7fd3b529e6f6 by thread T15:
    #0 void std::_LIBCPP_ABI_NAMESPACE::__cxx_atomic_store[abi:v15000]<unsigned short>(std::_LIBCPP_ABI_NAMESPACE::__cxx_atomic_base_impl<unsigned short>*, unsigned short, std::_LIBCPP_ABI_NAMESPACE::memory_order) out/ReleaseTSANX64/../../third_party/libcxx/include/atomic:945:5 (dart+0x2acf540)
    #1 std::_LIBCPP_ABI_NAMESPACE::__atomic_base<unsigned short, false>::store[abi:v15000](unsigned short, std::_LIBCPP_ABI_NAMESPACE::memory_order) out/ReleaseTSANX64/../../third_party/libcxx/include/atomic:1580:10 (dart+0x2acf540)
    #2 void dart::Object::StoreNonPointer<unsigned short, unsigned short, (std::_LIBCPP_ABI_NAMESPACE::memory_order)0>(unsigned short const*, unsigned short) const out/ReleaseTSANX64/../../runtime/vm/object.h:851:11 (dart+0x2acf540)
    #3 dart::Function::set_optimized_call_site_count(unsigned short) const out/ReleaseTSANX64/../../runtime/vm/object.h:3547:3 (dart+0x2acf540)
    #4 dart::Function::SetOptimizedCallSiteCountClamped(unsigned long) const out/ReleaseTSANX64/../../runtime/vm/object.h:3586:5 (dart+0x2acf540)
    #5 dart::FlowGraphInliner::CollectGraphInfo(dart::FlowGraph*, long, bool, long*, long*) out/ReleaseTSANX64/../../runtime/vm/compiler/backend/inliner.cc:2446:14 (dart+0x2acf540)
    #6 dart::CompilerPass_FinalizeGraph::DoBody(dart::CompilerPassState*) const out/ReleaseTSANX64/../../runtime/vm/compiler/compiler_pass.cc:547:1 (dart+0x2b5ef1a)
    #7 dart::CompilerPass::Run(dart::CompilerPassState*) const out/ReleaseTSANX64/../../runtime/vm/compiler/compiler_pass.cc:230:18 (dart+0x2b5ce12)
    #8 dart::CompilerPass::RunPipeline(dart::CompilerPass::PipelineMode, dart::CompilerPassState*, bool) out/ReleaseTSANX64/../../runtime/vm/compiler/compiler_pass.cc:367:3 (dart+0x2b5d7be)
    #9 dart::CompileParsedFunctionHelper::Compile(dart::CompilationPipeline*) out/ReleaseTSANX64/../../runtime/vm/compiler/jit/compiler.cc:574:22 (dart+0x291fab8)
    #10 dart::CompileFunctionHelper(dart::CompilationPipeline*, dart::Function const&, bool, long) out/ReleaseTSANX64/../../runtime/vm/compiler/jit/compiler.cc:719:46 (dart+0x2920813)
    #11 dart::Compiler::CompileFunction(dart::Thread*, dart::Function const&) out/ReleaseTSANX64/../../runtime/vm/compiler/jit/compiler.cc:850:10 (dart+0x292020a)
    #12 dart::Function::EnsureHasCodeNoThrow() const out/ReleaseTSANX64/../../runtime/vm/object.cc:11625:28 (dart+0x27d575b)
    #13 dart::Function::EnsureHasCode() const out/ReleaseTSANX64/../../runtime/vm/object.cc:11600:47 (dart+0x27d5602)
    #14 dart::DRT_HelperCompileFunction(dart::Isolate*, dart::Thread*, dart::Zone*, dart::NativeArguments) out/ReleaseTSANX64/../../runtime/vm/compiler/jit/compiler.cc:226:12 (dart+0x291e2aa)
    #15 dart::DRT_CompileFunction(dart::NativeArguments) out/ReleaseTSANX64/../../runtime/vm/compiler/jit/compiler.cc:212:1 (dart+0x291e2aa)
    #16 <null> <null> (0x7fd3bfc82fda)
    #17 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&) out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:38:10 (dart+0x26e6b61)
    #18 dart::DartLibraryCalls::HandleMessage(long, dart::Instance const&) out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:718:28 (dart+0x26e6b61)
    #19 dart::IsolateMessageHandler::HandleMessage(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::Message, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::Message>>) out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1456:15 (dart+0x271f2f1)
    #20 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:229:16 (dart+0x27607a2)
    #21 dart::MessageHandler::TaskCallback() out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:443:18 (dart+0x2760e51)
    #22 dart::MessageHandlerTask::Run() out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:31:15 (dart+0x2761523)
    #23 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:203:15 (dart+0x29053fe)
    #24 dart::ThreadPool::Worker::Main(unsigned long) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:363:9 (dart+0x290595a)
    #25 dart::ThreadStart(void*) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:97:5 (dart+0x2876826)

  Thread T19 'DartWorker' (tid=1170070, running) created by thread T13 at:
    #0 pthread_create ../../../../../../llvm-llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1041:3 (dart+0x22eb991)
    #1 dart::OSThread::TryStart(char const*, void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:116:12 (dart+0x28766f5)
    #2 dart::OSThread::Start(char const*, void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/os_thread.cc:343:16 (dart+0x287650f)
    #3 dart::ThreadPool::Worker::StartThread() out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:333:3 (dart+0x2904c0a)
    #4 dart::ThreadPool::RunImpl(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::ThreadPool::Task, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::ThreadPool::Task>>) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:130:17 (dart+0x2904c0a)
    #5 bool dart::ThreadPool::Run<dart::MessageHandlerTask, dart::MessageHandler*>(dart::MessageHandler*&&) out/ReleaseTSANX64/../../runtime/vm/thread_pool.h:47:12 (dart+0x2760216)
    #6 dart::MessageHandler::Run(dart::ThreadPool*, dart::MessageHandler::MessageStatus (*)(unsigned long), void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:111:24 (dart+0x2760216)
    #7 dart::Isolate::Run() out/ReleaseTSANX64/../../runtime/vm/isolate.cc:2409:22 (dart+0x2722dbc)
    #8 Dart_RunLoopAsync out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:2075:12 (dart+0x2c957ae)
    #9 dart::SpawnIsolateTask::Run(dart::Isolate*) out/ReleaseTSANX64/../../runtime/lib/isolate.cc:908:10 (dart+0x2650c9b)
    #10 dart::SpawnIsolateTask::RunLightweight(char const*) out/ReleaseTSANX64/../../runtime/lib/isolate.cc:873:5 (dart+0x26506f4)
    #11 dart::SpawnIsolateTask::Run() out/ReleaseTSANX64/../../runtime/lib/isolate.cc:789:7 (dart+0x26503da)
    #12 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:203:15 (dart+0x29053fe)
    #13 dart::ThreadPool::Worker::Main(unsigned long) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:363:9 (dart+0x290595a)
    #14 dart::ThreadStart(void*) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:97:5 (dart+0x2876826)

  Thread T15 'DartWorker' (tid=1170066, running) created by thread T14 at:
    #0 pthread_create ../../../../../../llvm-llvm-project/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1041:3 (dart+0x22eb991)
    #1 dart::OSThread::TryStart(char const*, void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:116:12 (dart+0x28766f5)
    #2 dart::OSThread::Start(char const*, void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/os_thread.cc:343:16 (dart+0x287650f)
    #3 dart::ThreadPool::Worker::StartThread() out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:333:3 (dart+0x2904c0a)
    #4 dart::ThreadPool::RunImpl(std::_LIBCPP_ABI_NAMESPACE::unique_ptr<dart::ThreadPool::Task, std::_LIBCPP_ABI_NAMESPACE::default_delete<dart::ThreadPool::Task>>) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:130:17 (dart+0x2904c0a)
    #5 bool dart::ThreadPool::Run<dart::MessageHandlerTask, dart::MessageHandler*>(dart::MessageHandler*&&) out/ReleaseTSANX64/../../runtime/vm/thread_pool.h:47:12 (dart+0x2760216)
    #6 dart::MessageHandler::Run(dart::ThreadPool*, dart::MessageHandler::MessageStatus (*)(unsigned long), void (*)(unsigned long), unsigned long) out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:111:24 (dart+0x2760216)
    #7 dart::Isolate::Run() out/ReleaseTSANX64/../../runtime/vm/isolate.cc:2409:22 (dart+0x2722dbc)
    #8 Dart_RunLoopAsync out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:2075:12 (dart+0x2c957ae)
    #9 dart::SpawnIsolateTask::Run(dart::Isolate*) out/ReleaseTSANX64/../../runtime/lib/isolate.cc:908:10 (dart+0x2650c9b)
    #10 dart::SpawnIsolateTask::RunLightweight(char const*) out/ReleaseTSANX64/../../runtime/lib/isolate.cc:873:5 (dart+0x26506f4)
    #11 dart::SpawnIsolateTask::Run() out/ReleaseTSANX64/../../runtime/lib/isolate.cc:789:7 (dart+0x26503da)
    #12 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:203:15 (dart+0x29053fe)
    #13 dart::ThreadPool::Worker::Main(unsigned long) out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:363:9 (dart+0x290595a)
    #14 dart::ThreadStart(void*) out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:97:5 (dart+0x2876826)

SUMMARY: ThreadSanitizer: data race out/ReleaseTSANX64/../../runtime/vm/object.cc:3028:5 in dart::Object::Clone(dart::Object const&, dart::Heap::Space, bool)
==================
=> Running "out/ReleaseTSANX64/dart --disable-dart-dev -Drepeat=4 -Dshard=99 -Dshards=200 runtime/tests/concurrency/generated_stress_test.dart.jit.dill" failed with -6
@aam aam added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening labels Nov 22, 2024
@aam aam changed the title tsan data race Object::Clone() vs :Function::set_optimized_call_site_count() tsan data race Object::Clone() vs Function::set_optimized_call_site_count() Nov 22, 2024
@aam
Copy link
Contributor Author

aam commented Nov 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. gardening
Projects
None yet
Development

No branches or pull requests

1 participant