diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-08-29 18:22:15 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-08-29 18:22:15 +0200 |
commit | 0ae7909c89bdc0a4ba1aedcb3f1462c059c0ac3c (patch) | |
tree | dbedf9fb3b8936754c256da45da127595bbd83f2 /vcl/qa | |
parent | a486a379ba868ec0198755ad75a5312bf693ad5c (diff) |
Avoid "ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call)"
...during CppunitTest_vcl_timer:
> WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) (pid=3753)
> Write of size 8 at 0x7ffa5fa31348 by main thread:
> #0 ~Thread include/osl/thread.hxx:66 (libtest_vcl_timer.so+0xcbae)
> #1 ~WatchDog vcl/qa/cppunit/timer.cxx:32 (libtest_vcl_timer.so+0xaa08)
> #2 at_exit_wrapper(void*) compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:361 (cppunittester+0x44c823)
>
> Previous read of size 8 at 0x7ffa5fa31348 by thread T2:
> #0 threadFunc include/osl/thread.hxx:185 (libtest_vcl_timer.so+0xcc54)
> #1 osl_thread_start_Impl(void*) sal/osl/unx/thread.cxx:237 (libuno_sal.so.3+0xeb5c5)
>
> As if synchronized via sleep:
> #0 nanosleep compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:343 (cppunittester+0x474d47)
> #1 osl_waitThread sal/osl/unx/thread.cxx:520 (libuno_sal.so.3+0xea531)
> #2 osl::Thread::wait(TimeValue const&) include/osl/thread.hxx:143 (libtest_vcl_timer.so+0xcd68)
> #3 SlowCallbackTimer::Invoke() vcl/qa/cppunit/timer.cxx:372 (libtest_vcl_timer.so+0xdb0a)
> #4 Scheduler::ProcessTaskScheduling() vcl/source/app/scheduler.cxx:381 (libvcllo.so+0x1074fff)
> #5 Scheduler::CallbackTaskScheduling() vcl/source/app/scheduler.cxx:204 (libvcllo.so+0x1073ba5)
> #6 SalTimer::CallCallback() vcl/inc/saltimer.hxx:54 (libvcllo.so+0x138548f)
> #7 SvpSalInstance::CheckTimeout(bool) vcl/headless/svpinst.cxx:242 (libvcllo.so+0x1382742)
> #8 SvpSalInstance::DoYield(bool, bool, unsigned long) vcl/headless/svpinst.cxx:349 (libvcllo.so+0x1383403)
> #9 ImplYield(bool, bool, unsigned long) vcl/source/app/svapp.cxx:470 (libvcllo.so+0x10c344e)
> #10 Application::Yield() vcl/source/app/svapp.cxx:540 (libvcllo.so+0x10bad80)
> #11 TimerTest::testSlowTimerCallback() vcl/qa/cppunit/timer.cxx:385 (libtest_vcl_timer.so+0x8506)
> #12 void std::__invoke_impl<void, void (TimerTest::* const&)(), TimerTest*&>(std::__invoke_memfun_deref, void (TimerTest::* const&)(), TimerTest*&) /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:227 (libtest_vcl_timer.so+0x15e2e)
> #13 std::result_of<void (TimerTest::* const&(TimerTest*&))()>::type std::__invoke<void (TimerTest::* const&)(), TimerTest*&>(void (TimerTest::* const&)(), TimerTest*&) /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:250 (libtest_vcl_timer.so+0x15d1d)
> #14 _ZNKSt12_Mem_fn_baseIM9TimerTestFvvELb1EEclIJRPS0_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOS7_ /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:604 (libtest_vcl_timer.so+0x15bfb)
> #15 void std::_Bind<std::_Mem_fn<void (TimerTest::*)()> (TimerTest*)>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:933 (libtest_vcl_timer.so+0x15b5b)
> #16 void std::_Bind<std::_Mem_fn<void (TimerTest::*)()> (TimerTest*)>::operator()<, void>() /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:991 (libtest_vcl_timer.so+0x15a26)
> #17 std::_Function_handler<void (), std::_Bind<std::_Mem_fn<void (TimerTest::*)()> (TimerTest*)> >::_M_invoke(std::_Any_data const&) /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:1731 (libtest_vcl_timer.so+0x1530a)
> #18 std::function<void ()>::operator()() const /usr/lib/gcc/x86_64-redhat-linux/6.4.1/../../../../include/c++/6.4.1/functional:2127 (libtest_vcl_timer.so+0x1616e)
> #19 CppUnit::TestCaller<TimerTest>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175 (libtest_vcl_timer.so+0x14a5c)
> #20 CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32 (libcppunit-1.14.so.0+0xd61d2)
> #21 (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:39 (libvclbootstrapprotector.so+0x1114)
> #22 CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20 (libcppunit-1.14.so.0+0xc7614)
> #23 (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89 (unobootstrapprotector.so+0x2204)
> #24 CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20 (libcppunit-1.14.so.0+0xc7614)
> #25 (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:63 (unoexceptionprotector.so+0x23e9)
> #26 CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20 (libcppunit-1.14.so.0+0xc7614)
> #27 CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15 (libcppunit-1.14.so.0+0xa57ad)
> #28 CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20 (libcppunit-1.14.so.0+0xc7614)
> #29 CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:86 (libcppunit-1.14.so.0+0xc4a96)
> #30 CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:182 (libcppunit-1.14.so.0+0xf4714)
> #31 CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91 (libcppunit-1.14.so.0+0xd5750)
> #32 CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64 (libcppunit-1.14.so.0+0xd6d5a)
> #33 CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23 (libcppunit-1.14.so.0+0xd6a2e)
> #34 CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64 (libcppunit-1.14.so.0+0xd6d5a)
> #35 CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23 (libcppunit-1.14.so.0+0xd6a2e)
> #36 CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47 (libcppunit-1.14.so.0+0x10282c)
> #37 CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:149 (libcppunit-1.14.so.0+0xf4223)
> #38 CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96 (libcppunit-1.14.so.0+0x102c76)
> #39 (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:316 (cppunittester+0x4bd1e8)
> #40 sal_main() sal/cppunittester/cppunittester.cxx:466 (cppunittester+0x4bbe1e)
> #41 main sal/cppunittester/cppunittester.cxx:373 (cppunittester+0x4bb695)
>
> Location is global '<null>' at 0x000000000000 (libtest_vcl_timer.so+0x00000021d348)
>
> Thread T2 (tid=3925, running) created by main thread at:
> #0 pthread_create compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:887 (cppunittester+0x451186)
> #1 osl_thread_create_Impl(void (*)(void*), void*, short) sal/osl/unx/thread.cxx:286 (libuno_sal.so.3+0xe93ee)
> #2 osl_createSuspendedThread sal/osl/unx/thread.cxx:337 (libuno_sal.so.3+0xe974d)
> #3 osl::Thread::create() include/osl/thread.hxx:73 (libtest_vcl_timer.so+0xc349)
> #4 WatchDog vcl/qa/cppunit/timer.cxx:40 (libtest_vcl_timer.so+0xa99f)
> #5 __cxx_global_var_init.1 vcl/qa/cppunit/timer.cxx:51 (libtest_vcl_timer.so+0x6fd1)
> #6 _GLOBAL__sub_I_timer.cxx vcl/qa/cppunit/timer.cxx:? (libtest_vcl_timer.so+0x70af)
> #7 call_init /usr/src/debug/glibc-2.24-61-g605e6f9/elf/dl-init.c:72 (ld-linux-x86-64.so.2+0x10d99)
> #8 CppUnit::DynamicLibraryManager::doLoadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/UnixDynamicLibraryManager.cpp:16 (libcppunit-1.14.so.0+0x10ee31)
> #9 CppUnit::DynamicLibraryManager::loadLibrary(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/DynamicLibraryManager.cpp:49 (libcppunit-1.14.so.0+0xa5f6d)
> #10 DynamicLibraryManager workdir/UnpackedTarball/cppunit/src/cppunit/DynamicLibraryManager.cpp:13 (libcppunit-1.14.so.0+0xa5eb9)
> #11 CppUnit::PlugInManager::load(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CppUnit::PlugInParameters const&) workdir/UnpackedTarball/cppunit/src/cppunit/PlugInManager.cpp:34 (libcppunit-1.14.so.0+0xba57c)
> #12 (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:259 (cppunittester+0x4bc55b)
> #13 sal_main() sal/cppunittester/cppunittester.cxx:466 (cppunittester+0x4bbe1e)
> #14 main sal/cppunittester/cppunittester.cxx:373 (cppunittester+0x4bb695)
Change-Id: I80f83d2e54f3bae61c1a896a5f9be9f0b5bce582
Diffstat (limited to 'vcl/qa')
-rw-r--r-- | vcl/qa/cppunit/timer.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx index dd03c20bbc1f..28f4284f1430 100644 --- a/vcl/qa/cppunit/timer.cxx +++ b/vcl/qa/cppunit/timer.cxx @@ -48,7 +48,7 @@ public: } }; -static WatchDog aWatchDog( 120 ); // random high number in secs +static WatchDog * aWatchDog = new WatchDog( 120 ); // random high number in secs class TimerTest : public test::BootstrapFixture { |