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

[vm] TSAN race in dart::Thread::SetStackLimit #46596

Closed
dcharkes opened this issue Jul 13, 2021 · 1 comment
Closed

[vm] TSAN race in dart::Thread::SetStackLimit #46596

dcharkes opened this issue Jul 13, 2021 · 1 comment
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening

Comments

@dcharkes
Copy link
Contributor

dcharkes commented Jul 13, 2021

Commit: https://dart-review.googlesource.com/c/sdk/+/206566 - test fails on this commit, not commit before.

The log only shows 1 failure, but the results feed show 500+ failures, but all without logs.

https://logs.chromium.org/logs/dart/buildbucket/cr-buildbucket.appspot.com/8841849306443178576/+/u/test_results/new_test_failures__logs_

/===========================================================================\
| vm/dart_2/spawn_infinite_loop_test/1 broke (Pass -> Crash, expected Pass) |
\===========================================================================/

--- Command "vm_compile_to_kernel" (took 03.000180s):
DART_CONFIGURATION=ReleaseTSANX64 /b/s/w/ir/pkg/vm/tool/gen_kernel --aot --platform=out/ReleaseTSANX64/vm_platform_strong.dill -o /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.dill /b/s/w/ir/runtime/tests/vm/dart_2/spawn_infinite_loop_test.dart --packages=/b/s/w/ir/.packages -Ddart.vm.product=false

exit code:
0

--- Command "precompiler" (took 01:07.000145s):
DART_CONFIGURATION=ReleaseTSANX64 out/ReleaseTSANX64/gen_snapshot --snapshot-kind=app-aot-assembly --assembly=/b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.S --no-enable-isolate-groups --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.dill

exit code:
0

--- Command "remove_kernel_file" (took 7ms):
DART_CONFIGURATION=ReleaseTSANX64 rm /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.dill

exit code:
0

--- Command "assemble" (took 01.000112s):
DART_CONFIGURATION=ReleaseTSANX64 gcc -m64 -shared -nostdlib -o /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.aotsnapshot /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.S

exit code:
0

--- Command "remove_assembly" (took 22ms):
DART_CONFIGURATION=ReleaseTSANX64 rm /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.S

exit code:
0

--- Command "vm" (took 03.000397s):
DART_CONFIGURATION=ReleaseTSANX64 out/ReleaseTSANX64/dart_precompiled_runtime --no-enable-isolate-groups --ignore-unrecognized-flags --packages=/b/s/w/ir/.packages /b/s/w/ir/out/ReleaseTSANX64/generated_compilations/dartkp-tsan-linux-release-x64/runtime_tests_vm_dart_2_spawn_infinite_loop_test.dart_1/out.aotsnapshot

exit code:
-6

stderr:
==================
WARNING: ThreadSanitizer: data race (pid=19752)
  Write of size 8 at 0x7b780001f878 by thread T6 (mutexes: write M223063936881262120):
    #0 dart::Thread::SetStackLimit(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread.cc:400 (dart_precompiled_runtime+0x9f0414)
    #1 dart::ScopedIsolateStackLimits::~ScopedIsolateStackLimits() ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:66 (dart_precompiled_runtime+0x820009)
    #2 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:149 (dart_precompiled_runtime+0x820009)
    #3 dart::Exceptions::PropagateError(dart::Error const&) ../../out/ReleaseTSANX64/../../runtime/vm/exceptions.cc:943 (dart_precompiled_runtime+0x840e1f)
    #4 dart::ThrowIfError(dart::Object const&) ../../out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:413 (dart_precompiled_runtime+0x9b0e6e)
    #5 dart::DRT_HelperStackOverflow(dart::Isolate*, dart::Thread*, dart::Zone*, dart::NativeArguments) ../../out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2851 (dart_precompiled_runtime+0x9b0e6e)
    #6 dart::DRT_StackOverflow(dart::NativeArguments) ../../out/ReleaseTSANX64/../../runtime/vm/runtime_entry.cc:2795 (dart_precompiled_runtime+0x9b0e6e)
    #7 Precompiled_Stub_CallToRuntime /b/s/w/it6v33o07b/ccKIQn5D.o:? (out.aotsnapshot+0x5ec1)
    #8 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:147 (dart_precompiled_runtime+0x81fffa)
    #9 dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:37 (dart_precompiled_runtime+0x8241a7)
    #10 dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:818 (dart_precompiled_runtime+0x8241a7)
    #11 dart::IsolateMessageHandler::HandleMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1442 (dart_precompiled_runtime+0x8584ec)
    #12 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:233 (dart_precompiled_runtime+0x86ae7e)
    #13 dart::MessageHandler::TaskCallback() ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:443 (dart_precompiled_runtime+0x86b82f)
    #14 dart::MessageHandlerTask::Run() ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:31 (dart_precompiled_runtime+0x86c363)
    #15 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:158 (dart_precompiled_runtime+0x9f6baa)
    #16 dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:323 (dart_precompiled_runtime+0x9f7645)
    #17 dart::ThreadStart(void*) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:153 (dart_precompiled_runtime+0x93b8bd)

  Previous read of size 8 at 0x7b780001f878 by main thread (mutexes: write M26, write M27, write M208989792908636384):
    #0 unsigned long std::__2::__cxx_atomic_load<unsigned long>(std::__2::__cxx_atomic_base_impl<unsigned long> const volatile*, std::__2::memory_order) ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/atomic:1000 (dart_precompiled_runtime+0x9f04ea)
    #1 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/atomic:1611 (dart_precompiled_runtime+0x9f04ea)
    #2 <null> ../../out/ReleaseTSANX64/../../runtime/platform/atomic.h:25 (dart_precompiled_runtime+0x9f04ea)
    #3 dart::Thread::ScheduleInterrupts(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread.cc:410 (dart_precompiled_runtime+0x9f04ea)
    #4 dart::IsolateMessageHandler::MessageNotify(dart::Message::Priority) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1952 (dart_precompiled_runtime+0x857a67)
    #5 dart::IsolateMessageHandler::MessageNotify(dart::Message::Priority) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1285 (dart_precompiled_runtime+0x857a67)
    #6 dart::MessageHandler::PostMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >, bool) ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:171 (dart_precompiled_runtime+0x86abfc)
    #7 dart::PortMap::PostMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >, bool) ../../out/ReleaseTSANX64/../../runtime/vm/port.cc:200 (dart_precompiled_runtime+0x93de46)
    #8 dart::IsolateKillerVisitor::VisitIsolate(dart::Isolate*) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3514 (dart_precompiled_runtime+0x8607e5)
    #9 dart::IsolateKillerVisitor::VisitIsolate(dart::Isolate*) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3536 (dart_precompiled_runtime+0x8607e5)
    #10 dart::Isolate::VisitIsolates(dart::IsolateVisitor*)::$_3::operator()(dart::IsolateGroup*) const::{lambda(dart::Isolate*)#1}::operator()(dart::Isolate*) const ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3408 (dart_precompiled_runtime+0x86223f)
    #11 _ZNSt3__28__invokeIRZZN4dart7Isolate13VisitIsolatesEPNS1_14IsolateVisitorEENK3$_3clEPNS1_12IsolateGroupEEUlPS2_E_JS8_EEEDTclclsr3std3__2E7forwardIT_Efp_Espclsr3std3__2E7forwardIT0_Efp0_EEEOSB_DpOSC_ ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/type_traits:3956 (dart_precompiled_runtime+0x86223f)
    #12 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/__functional_base:349 (dart_precompiled_runtime+0x86223f)
    #13 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:1633 (dart_precompiled_runtime+0x86223f)
    #14 void std::__2::__function::__policy_invoker<void (dart::Isolate*)>::__call_impl<std::__2::__function::__default_alloc_func<dart::Isolate::VisitIsolates(dart::IsolateVisitor*)::$_3::operator()(dart::IsolateGroup*) const::{lambda(dart::Isolate*)#1}, void (dart::Isolate*)> >(std::__2::__function::__policy_storage const*, dart::Isolate*) ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2114 (dart_precompiled_runtime+0x86223f)
    #15 dart::IsolateGroup::ForEachIsolate(std::__2::function<void (dart::Isolate*)>, bool) ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2246 (dart_precompiled_runtime+0x854756)
    #16 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2585 (dart_precompiled_runtime+0x854756)
    #17 <null> ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:2743 (dart_precompiled_runtime+0x854756)
    #18 dart::Isolate::VisitIsolates(dart::IsolateVisitor*)::$_3::operator()(dart::IsolateGroup*) const ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3407 (dart_precompiled_runtime+0x8621cc)
    #19 _ZNSt3__28__invokeIRZN4dart7Isolate13VisitIsolatesEPNS1_14IsolateVisitorEE3$_3JPNS1_12IsolateGroupEEEEDTclclsr3std3__2E7forwardIT_Efp_Espclsr3std3__2E7forwardIT0_Efp0_EEEOS9_DpOSA_ ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/type_traits:3956 (dart_precompiled_runtime+0x8621cc)
    #20 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/__functional_base:349 (dart_precompiled_runtime+0x8621cc)
    #21 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:1633 (dart_precompiled_runtime+0x8621cc)
    #22 void std::__2::__function::__policy_invoker<void (dart::IsolateGroup*)>::__call_impl<std::__2::__function::__default_alloc_func<dart::Isolate::VisitIsolates(dart::IsolateVisitor*)::$_3, void (dart::IsolateGroup*)> >(std::__2::__function::__policy_storage const*, dart::IsolateGroup*) ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2114 (dart_precompiled_runtime+0x8621cc)
    #23 dart::IsolateGroup::ForEach(std::__2::function<void (dart::IsolateGroup*)>) ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2246 (dart_precompiled_runtime+0x853911)
    #24 <null> ../../out/ReleaseTSANX64/../../buildtools/linux-x64/clang/bin/../include/c++/v1/functional:2585 (dart_precompiled_runtime+0x853911)
    #25 dart::IsolateGroup::ForEach(std::__2::function<void (dart::IsolateGroup*)>) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:800 (dart_precompiled_runtime+0x853911)
    #26 dart::Isolate::KillAllIsolates(dart::Isolate::LibMsgId) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3406 (dart_precompiled_runtime+0x85c304)
    #27 <null> ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3555 (dart_precompiled_runtime+0x85c304)
    #28 dart::Dart::Cleanup() ../../out/ReleaseTSANX64/../../runtime/vm/dart.cc:535 (dart_precompiled_runtime+0x815ed3)
    #29 Dart_Cleanup ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:1215 (dart_precompiled_runtime+0xe5a41e)
    #30 dart::bin::main(int, char**) ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1316 (dart_precompiled_runtime+0x61506a)
    #31 main ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1347 (dart_precompiled_runtime+0x615a0e)

  Location is heap block of size 3008 at 0x7b780001f800 allocated by thread T5:
    #0 operator new(unsigned long) ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_new_delete.cpp:64 (dart_precompiled_runtime+0x60baf6)
    #1 dart::ThreadRegistry::GetFreeThreadLocked(bool) ../../out/ReleaseTSANX64/../../runtime/vm/thread_registry.cc:129 (dart_precompiled_runtime+0x9f7829)
    #2 dart::ThreadRegistry::GetFreeThreadLocked(bool) ../../out/ReleaseTSANX64/../../runtime/vm/thread_registry.cc:30 (dart_precompiled_runtime+0x9f7829)
    #3 dart::IsolateGroup::ScheduleThreadLocked(dart::MonitorLocker*, dart::Thread*, bool, bool, bool) ??:? (dart_precompiled_runtime+0x852f0a)
    #4 dart::Isolate::ScheduleThread(bool, bool, bool) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:3622 (dart_precompiled_runtime+0x85ff7b)
    #5 dart::Thread::EnterIsolate(dart::Isolate*, bool) ../../out/ReleaseTSANX64/../../runtime/vm/thread.cc:283 (dart_precompiled_runtime+0x9ef6b2)
    #6 dart::Isolate::InitIsolate(char const*, dart::IsolateGroup*, Dart_IsolateFlags const&, bool) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1848 (dart_precompiled_runtime+0x85a98b)
    #7 dart::Dart::CreateIsolate(char const*, Dart_IsolateFlags const&, dart::IsolateGroup*) ../../out/ReleaseTSANX64/../../runtime/vm/dart.cc:689 (dart_precompiled_runtime+0x8165bb)
    #8 dart::CreateIsolate(dart::IsolateGroup*, bool, char const*, void*, char**) ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:1281 (dart_precompiled_runtime+0xe5ae78)
    #9 Dart_CreateIsolateGroup ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:1399 (dart_precompiled_runtime+0xe5b33a)
    #10 dart::bin::CreateIsolateGroupAndSetupHelper(bool, char const*, char const*, char const*, Dart_IsolateFlags*, void*, char**, int*) ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:798 (dart_precompiled_runtime+0x614401)
    #11 dart::bin::CreateIsolateGroupAndSetup(char const*, char const*, char const*, char const*, Dart_IsolateFlags*, void*, char**) ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:851 (dart_precompiled_runtime+0x615232)
    #12 dart::SpawnIsolateTask::RunHeavyweight(char const*) ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:624 (dart_precompiled_runtime+0x7d25ff)
    #13 dart::SpawnIsolateTask::Run() ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:605 (dart_precompiled_runtime+0x7d2521)
    #14 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:158 (dart_precompiled_runtime+0x9f6baa)
    #15 dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:323 (dart_precompiled_runtime+0x9f7645)
    #16 dart::ThreadStart(void*) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:153 (dart_precompiled_runtime+0x93b8bd)

  Mutex M223063936881262120 is already destroyed.

  Mutex M26 (0x7b18000002a0) created at:
    #0 pthread_mutex_init ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1268 (dart_precompiled_runtime+0x59d50d)
    #1 Monitor ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:371 (dart_precompiled_runtime+0x93bf26)
    #2 dart::Isolate::InitVM() ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1810 (dart_precompiled_runtime+0x85a809)
    #3 dart::Dart::Init(unsigned char const*, unsigned char const*, _Dart_Isolate* (*)(char const*, char const*, char const*, char const*, Dart_IsolateFlags*, void*, char**), bool (*)(void**, char**), void (*)(void*, void*), void (*)(void*, void*), void (*)(void*), void (*)(), void* (*)(char const*, bool), void (*)(unsigned char**, long*, void*), void (*)(void const*, long, void*), void (*)(void*), bool (*)(unsigned char*, long), _Dart_Handle* (*)(), bool, Dart_CodeObserver*) ../../out/ReleaseTSANX64/../../runtime/vm/dart.cc:244 (dart_precompiled_runtime+0x815429)
    #4 Dart_Initialize ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:1203 (dart_precompiled_runtime+0xe5a39c)
    #5 dart::bin::main(int, char**) ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1271 (dart_precompiled_runtime+0x614efd)
    #6 main ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1347 (dart_precompiled_runtime+0x615a0e)

  Mutex M27 (0x7b0c000025b0) created at:
    #0 pthread_mutex_init ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:1268 (dart_precompiled_runtime+0x59d50d)
    #1 Mutex ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:300 (dart_precompiled_runtime+0x93bcf7)
    #2 dart::PortMap::Init() ../../out/ReleaseTSANX64/../../runtime/vm/port.cc:252 (dart_precompiled_runtime+0x93e438)
    #3 dart::Dart::Init(unsigned char const*, unsigned char const*, _Dart_Isolate* (*)(char const*, char const*, char const*, char const*, Dart_IsolateFlags*, void*, char**), bool (*)(void**, char**), void (*)(void*, void*), void (*)(void*, void*), void (*)(void*), void (*)(), void* (*)(char const*, bool), void (*)(unsigned char**, long*, void*), void (*)(void const*, long, void*), void (*)(void*), bool (*)(unsigned char*, long), _Dart_Handle* (*)(), bool, Dart_CodeObserver*) ../../out/ReleaseTSANX64/../../runtime/vm/dart.cc:245 (dart_precompiled_runtime+0x81542e)
    #4 Dart_Initialize ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:1203 (dart_precompiled_runtime+0xe5a39c)
    #5 dart::bin::main(int, char**) ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1271 (dart_precompiled_runtime+0x614efd)
    #6 main ../../out/ReleaseTSANX64/../../runtime/bin/main.cc:1347 (dart_precompiled_runtime+0x615a0e)

  Mutex M208989792908636384 is already destroyed.

  Thread T6 'DartWorker' (tid=19760, running) created by thread T5 at:
    #0 pthread_create ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:975 (dart_precompiled_runtime+0x59bd1b)
    #1 dart::OSThread::Start(char const*, void (*)(unsigned long), unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:172 (dart_precompiled_runtime+0x93b74c)
    #2 dart::ThreadPool::RunImpl(std::__2::unique_ptr<dart::ThreadPool::Task, std::__2::default_delete<dart::ThreadPool::Task> >) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:296 (dart_precompiled_runtime+0x9f623f)
    #3 dart::ThreadPool::RunImpl(std::__2::unique_ptr<dart::ThreadPool::Task, std::__2::default_delete<dart::ThreadPool::Task> >) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:94 (dart_precompiled_runtime+0x9f623f)
    #4 dart::MessageHandler::Run(dart::ThreadPool*, dart::MessageHandler::MessageStatus (*)(unsigned long), void (*)(unsigned long), unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.h:46 (dart_precompiled_runtime+0x86aa98)
    #5 dart::MessageHandler::Run(dart::ThreadPool*, dart::MessageHandler::MessageStatus (*)(unsigned long), void (*)(unsigned long), unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:121 (dart_precompiled_runtime+0x86aa98)
    #6 dart::Isolate::Run() ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:2384 (dart_precompiled_runtime+0x85c1cc)
    #7 Dart_RunLoopAsync ../../out/ReleaseTSANX64/../../runtime/vm/dart_api_impl.cc:2058 (dart_precompiled_runtime+0xe5e79a)
    #8 dart::SpawnIsolateTask::Run(dart::Isolate*) ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:702 (dart_precompiled_runtime+0x7d2c72)
    #9 dart::SpawnIsolateTask::RunHeavyweight(char const*) ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:636 (dart_precompiled_runtime+0x7d263f)
    #10 dart::SpawnIsolateTask::Run() ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:605 (dart_precompiled_runtime+0x7d2521)
    #11 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:158 (dart_precompiled_runtime+0x9f6baa)
    #12 dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:323 (dart_precompiled_runtime+0x9f7645)
    #13 dart::ThreadStart(void*) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:153 (dart_precompiled_runtime+0x93b8bd)

  Thread T5 'DartWorker' (tid=19759, finished) created by thread T3 at:
    #0 pthread_create ../staging/llvm_build/tools/clang/stage2-bins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp:975 (dart_precompiled_runtime+0x59bd1b)
    #1 dart::OSThread::Start(char const*, void (*)(unsigned long), unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:172 (dart_precompiled_runtime+0x93b74c)
    #2 dart::ThreadPool::RunImpl(std::__2::unique_ptr<dart::ThreadPool::Task, std::__2::default_delete<dart::ThreadPool::Task> >) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:296 (dart_precompiled_runtime+0x9f623f)
    #3 dart::ThreadPool::RunImpl(std::__2::unique_ptr<dart::ThreadPool::Task, std::__2::default_delete<dart::ThreadPool::Task> >) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:94 (dart_precompiled_runtime+0x9f623f)
    #4 dart::BootstrapNatives::DN_Isolate_spawnFunction(dart::Thread*, dart::Zone*, dart::NativeArguments*) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.h:46 (dart_precompiled_runtime+0x7cfb22)
    #5 dart::DN_HelperIsolate_spawnFunction(dart::Isolate*, dart::Thread*, dart::Zone*, dart::NativeArguments*) ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:875 (dart_precompiled_runtime+0x7cfb22)
    #6 dart::BootstrapNatives::DN_Isolate_spawnFunction(dart::Thread*, dart::Zone*, dart::NativeArguments*) ../../out/ReleaseTSANX64/../../runtime/lib/isolate.cc:822 (dart_precompiled_runtime+0x7cfb22)
    #7 dart::NativeEntry::BootstrapNativeCallWrapper(_Dart_NativeArguments*, void (*)(_Dart_NativeArguments*)) ../../out/ReleaseTSANX64/../../runtime/vm/native_entry.cc:140 (dart_precompiled_runtime+0x86dc0e)
    #8 dart::NativeEntry::LinkNativeCall(_Dart_NativeArguments*) ../../out/ReleaseTSANX64/../../runtime/vm/native_entry.cc:322 (dart_precompiled_runtime+0x86e04b)
    #9 dart::NativeEntry::BootstrapNativeCallWrapper(_Dart_NativeArguments*, void (*)(_Dart_NativeArguments*)) ../../out/ReleaseTSANX64/../../runtime/vm/native_entry.cc:125 (dart_precompiled_runtime+0x86dc85)
    #10 Precompiled_Stub_CallBootstrapNative /b/s/w/it6v33o07b/ccKIQn5D.o:? (out.aotsnapshot+0x5e1e)
    #11 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:147 (dart_precompiled_runtime+0x81fffa)
    #12 dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:37 (dart_precompiled_runtime+0x8241a7)
    #13 dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&) ../../out/ReleaseTSANX64/../../runtime/vm/dart_entry.cc:818 (dart_precompiled_runtime+0x8241a7)
    #14 dart::IsolateMessageHandler::HandleMessage(std::__2::unique_ptr<dart::Message, std::__2::default_delete<dart::Message> >) ../../out/ReleaseTSANX64/../../runtime/vm/isolate.cc:1442 (dart_precompiled_runtime+0x8584ec)
    #15 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool) ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:233 (dart_precompiled_runtime+0x86ae7e)
    #16 dart::MessageHandler::TaskCallback() ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:443 (dart_precompiled_runtime+0x86b82f)
    #17 dart::MessageHandlerTask::Run() ../../out/ReleaseTSANX64/../../runtime/vm/message_handler.cc:31 (dart_precompiled_runtime+0x86c363)
    #18 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:158 (dart_precompiled_runtime+0x9f6baa)
    #19 dart::ThreadPool::Worker::Main(unsigned long) ../../out/ReleaseTSANX64/../../runtime/vm/thread_pool.cc:323 (dart_precompiled_runtime+0x9f7645)
    #20 dart::ThreadStart(void*) ../../out/ReleaseTSANX64/../../runtime/vm/os_thread_linux.cc:153 (dart_precompiled_runtime+0x93b8bd)

SUMMARY: ThreadSanitizer: data race ../../out/ReleaseTSANX64/../../runtime/vm/thread.cc:400 in dart::Thread::SetStackLimit(unsigned long)
==================
ThreadSanitizer: reported 1 warnings

--- Re-run this test:
python3 tools/test.py -n dartkp-tsan-linux-release-x64 vm/dart_2/spawn_infinite_loop_test/1
@dcharkes dcharkes added area-vm Use area-vm for VM related issues, including code coverage, FFI, and the AOT and JIT backends. gardening labels Jul 13, 2021
dart-bot pushed a commit that referenced this issue Jul 13, 2021
…ke interrupts lock-free."

This reverts commit 4d789f6.

Reason for revert: TSAN races
#46596

Original change's description:
> [vm] Don't block OOB messages during field initialization; make interrupts lock-free.
>
> TEST=ci
> Change-Id: I51d0f51995e197ab71c059f17d22259eea19c286
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206566
> Commit-Queue: Ryan Macnak <rmacnak@google.com>
> Reviewed-by: Ben Konyi <bkonyi@google.com>

TBR=bkonyi@google.com,rmacnak@google.com

Change-Id: I777f5a0bbeb3cd60e03aff46183b19ab4e286664
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206545
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
@dcharkes
Copy link
Contributor Author

Also reverting this fixes the reload bots time outs:

Pass -> Timeout (expected Pass)
standalone_2/io/http_basic_test/0

dart-bot pushed a commit that referenced this issue Jul 14, 2021
…make interrupts lock-free.

 - Account for initialization-in-progress sentinel when checking static field types for reload.
 - Don't read the true stack limit when setting or clearing interrupts.

TEST=ci
Bug: #46596
Change-Id: I80adb4d7d69f01125b7eae8215b5da4d2e467bda
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206662
Reviewed-by: Ben Konyi <bkonyi@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
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, FFI, and the AOT and JIT backends. gardening
Projects
None yet
Development

No branches or pull requests

2 participants