-
Notifications
You must be signed in to change notification settings - Fork 199
TSAN error reported in WithBoundScheduler.EventWaitUntilTimeTaken/0 #133
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Reproduction steps:
git clone https://github.com/google/marl.git
cd marl
git submodule update --init
mkdir build
cd build
cmake .. -GNinja -DMARL_TSAN=1 -DMARL_BUILD_TESTS=1
ninja
./marl-unittests --gtest_filter=SchedulerParams/WithBoundScheduler.EventWaitUntilTimeTaken/0 --gtest_repeat=-1EventWaitUntilTimeTaken for a single threaded worker appears to fail after repeated runs of the same test:
[ RUN ] SchedulerParams/WithBoundScheduler.EventWaitUntilTimeTaken/0
ThreadSanitizer:DEADLYSIGNAL
==79999==ERROR: ThreadSanitizer: SEGV on unknown address 0x0000000007f0 (pc 0x7f7a2bfb4f0e bp 0x600001000000 sp 0x7f75ff043610 T79999)
==79999==The signal is caused by a READ memory access.
==79999==Hint: address points to the zero page.
#0 <null> <null> (libtsan.so.0+0x8cf0e)
#1 <null> <null> (libtsan.so.0+0xa3b74)
#2 __tsan_read8 <null> (libtsan.so.0+0x918f7)
#3 marl::Scheduler::WaitingFibers::Timeout::operator<(marl::Scheduler::WaitingFibers::Timeout const&) const ../src/scheduler.cpp:354 (marl-unittests+0x13eadd)
#4 std::less<marl::Scheduler::WaitingFibers::Timeout>::operator()(marl::Scheduler::WaitingFibers::Timeout const&, marl::Scheduler::WaitingFibers::Timeout const&) const /usr/include/c++/8/bits/stl_function.h:386 (marl-unittests+0x13eadd)
#5 std::_Rb_tree<marl::Scheduler::WaitingFibers::Timeout, marl::Scheduler::WaitingFibers::Timeout, std::_Identity<marl::Scheduler::WaitingFibers::Timeout>, std::less<marl::Scheduler::WaitingFibers::Timeout>, std::allocator<marl::Scheduler::WaitingFibers::Timeout> >::_M_get_insert_unique_pos(marl::Scheduler::WaitingFibers::Timeout const&) /usr/include/c++/8/bits/stl_tree.h:2061 (marl-unittests+0x13eadd)
#6 std::pair<std::_Rb_tree_iterator<marl::Scheduler::WaitingFibers::Timeout>, bool> std::_Rb_tree<marl::Scheduler::WaitingFibers::Timeout, marl::Scheduler::WaitingFibers::Timeout, std::_Identity<marl::Scheduler::WaitingFibers::Timeout>, std::less<marl::Scheduler::WaitingFibers::Timeout>, std::allocator<marl::Scheduler::WaitingFibers::Timeout> >::_M_emplace_unique<marl::Scheduler::WaitingFibers::Timeout>(marl::Scheduler::WaitingFibers::Timeout&&) /usr/include/c++/8/bits/stl_tree.h:2379 (marl-unittests+0x13eadd)
#7 std::pair<std::_Rb_tree_const_iterator<marl::Scheduler::WaitingFibers::Timeout>, bool> std::set<marl::Scheduler::WaitingFibers::Timeout, std::less<marl::Scheduler::WaitingFibers::Timeout>, std::allocator<marl::Scheduler::WaitingFibers::Timeout> >::emplace<marl::Scheduler::WaitingFibers::Timeout>(marl::Scheduler::WaitingFibers::Timeout&&) /usr/include/c++/8/bits/stl_set.h:463 (marl-unittests+0x13cc4d)
#8 marl::Scheduler::WaitingFibers::add(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, marl::Scheduler::Fiber*) ../src/scheduler.cpp:332 (marl-unittests+0x13cc4d)
#9 marl::Scheduler::Worker::suspend(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const*) ../src/scheduler.cpp:470 (marl-unittests+0x13cc4d)
#10 marl::Scheduler::Worker::wait(marl::lock&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const*, std::function<bool ()> const&) ../src/scheduler.cpp:446 (marl-unittests+0x13d1e9)
#11 bool marl::Scheduler::Fiber::wait<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(marl::lock&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, std::function<bool ()> const&) ../include/marl/scheduler.h:486 (marl-unittests+0xb0600)
#12 bool marl::ConditionVariable::wait_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, marl::Event::Shared::wait_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)::{lambda()#1}>(marl::lock&, std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, marl::Event::Shared::wait_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&)::{lambda()#1}&&) ../include/marl/conditionvariable.h:171 (marl-unittests+0xb0600)
#13 bool marl::Event::Shared::wait_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) ../include/marl/event.h:170 (marl-unittests+0xa85d6)
#14 bool marl::Event::wait_until<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >(std::chrono::time_point<std::chrono::_V2::system_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&) const ../include/marl/event.h:205 (marl-unittests+0xa85d6)
#15 operator() ../src/event_test.cpp:186 (marl-unittests+0xa85d6)
#16 _M_invoke /usr/include/c++/8/bits/std_function.h:297 (marl-unittests+0xa85d6)
#17 std::function<void ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687 (marl-unittests+0x13d36c)
#18 marl::Task::operator()() const ../include/marl/task.h:94 (marl-unittests+0x132715)
#19 marl::Scheduler::Worker::runUntilIdle() ../src/scheduler.cpp:702 (marl-unittests+0x132715)
#20 marl::Scheduler::Worker::runUntilShutdown() ../src/scheduler.cpp:587 (marl-unittests+0x13886f)
#21 marl::Scheduler::Worker::run() ../src/scheduler.cpp:580 (marl-unittests+0x13bc5a)
#22 operator() ../src/scheduler.cpp:717 (marl-unittests+0x13c06d)
#23 _M_invoke /usr/include/c++/8/bits/std_function.h:297 (marl-unittests+0x13c06d)
#24 std::function<void ()>::operator()() const /usr/include/c++/8/bits/std_function.h:687 (marl-unittests+0xc2e25)
#25 marl::OSFiber::run(marl::OSFiber*) ../src/osfiber_asm.h:129 (marl-unittests+0xc2e25)
#26 marl_fiber_trampoline ../src/osfiber_x64.c:20 (marl-unittests+0x141c1a)
ThreadSanitizer can not provide additional info.
SUMMARY: ThreadSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libtsan.so.0+0x8cf0e)
==79999==ABORTING
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working