Git Product home page Git Product logo

Comments (3)

bas524 avatar bas524 commented on April 28, 2024

Describe the bug

Data race due to use of naked pointers.

To Reproduce

Thread sanitizer

Expected behavior

Clean run

Logs


WARNING: ThreadSanitizer: data race on vptr (ctor/dtor vs virtual call) (pid=69547)

  Write of size 8 at 0x00010b11a730 by main thread:

    #0 Poco::RefCountedObject::~RefCountedObject() RefCountedObject.cpp:27 (libPocoFoundationd.100.dylib:arm64+0x1a09f8)

    #1 Poco::Notification::~Notification() Notification.cpp:29 (libPocoFoundationd.100.dylib:arm64+0x103b80)

    #2 Poco::NewActionNotification::~NewActionNotification() ActiveThreadPool.cpp:37 (libPocoFoundationd.100.dylib:arm64+0x1b004)

    #3 Poco::NewActionNotification::~NewActionNotification() ActiveThreadPool.cpp:37 (libPocoFoundationd.100.dylib:arm64+0x1ad78)

    #4 Poco::NewActionNotification::~NewActionNotification() ActiveThreadPool.cpp:37 (libPocoFoundationd.100.dylib:arm64+0x1adc0)

    #5 Poco::RefCountedObject::release() const RefCountedObject.h:82 (testrunnerd:arm64+0x100008908)

    #6 Poco::AutoPtr<Poco::NewActionNotification>::~AutoPtr() AutoPtr.h:95 (libPocoFoundationd.100.dylib:arm64+0x1656c)

    #7 Poco::ActiveThread::start(Poco::Thread::Priority, Poco::Runnable&) ActiveThreadPool.cpp:118 (libPocoFoundationd.100.dylib:arm64+0x162f0)

    #8 Poco::ActiveThreadPool::start(Poco::Runnable&) ActiveThreadPool.cpp:255 (libPocoFoundationd.100.dylib:arm64+0x17cc0)

    #9 Poco::ActiveStarter<Poco::AbstractEvent<int, Poco::FIFOStrategy<int, Poco::AbstractDelegate<int>>, Poco::AbstractDelegate<int>, Poco::FastMutex>>::start(Poco::AbstractEvent<int, Poco::FIFOStrategy<int, Poco::AbstractDelegate<int>>, Poco::AbstractDelegate<int>, Poco::FastMutex>*, Poco::AutoPtr<Poco::ActiveRunnableBase>) ActiveStarter.h:39 (testrunnerd:arm64+0x1002da8a4)

    #10 CppUnit::TestRunner::run(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (std::exception const&)> const&) TestRunner.cpp:142 (libCppUnitd.1.dylib:arm64+0x12668)

    #11 main Driver.cpp:17 (testrunnerd:arm64+0x1000b4dac)



  Previous read of size 8 at 0x00010b11a730 by thread T50:

    #0 Poco::ActiveThread::run() ActiveThreadPool.cpp:166 (libPocoFoundationd.100.dylib:arm64+0x16c18)

    #1 Poco::(anonymous namespace)::RunnableHolder::run() Thread.cpp:56 (libPocoFoundationd.100.dylib:arm64+0x1e8618)

    #2 Poco::ThreadImpl::runnableEntry(void*) Thread_POSIX.cpp:407 (libPocoFoundationd.100.dylib:arm64+0x1e611c)



  Location is heap block of size 48 at 0x00010b11a730 allocated by main thread:

    #0 operator new(unsigned long) <null>:123127876 (libclang_rt.tsan_osx_dynamic.dylib:arm64e+0x83de0)

    #1 Poco::AutoPtr<Poco::NewActionNotification> Poco::makeAuto<Poco::NewActionNotification, Poco::Thread::Priority&, Poco::Runnable&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&>(Poco::Thread::Priority&, Poco::Runnable&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&) AutoPtr.h:399 (libPocoFoundationd.100.dylib:arm64+0x163bc)

    #2 Poco::ActiveThread::start(Poco::Thread::Priority, Poco::Runnable&) ActiveThreadPool.cpp:118 (libPocoFoundationd.100.dylib:arm64+0x162b8)

    #3 Poco::ActiveThreadPool::start(Poco::Runnable&) ActiveThreadPool.cpp:255 (libPocoFoundationd.100.dylib:arm64+0x17cc0)

    #4 Poco::ActiveStarter<Poco::AbstractEvent<int, Poco::FIFOStrategy<int, Poco::AbstractDelegate<int>>, Poco::AbstractDelegate<int>, Poco::FastMutex>>::start(Poco::AbstractEvent<int, Poco::FIFOStrategy<int, Poco::AbstractDelegate<int>>, Poco::AbstractDelegate<int>, Poco::FastMutex>*, Poco::AutoPtr<Poco::ActiveRunnableBase>) ActiveStarter.h:39 (testrunnerd:arm64+0x1002da8a4)

    #5 CppUnit::TestRunner::run(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>> const&, std::__1::function<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> (std::exception const&)> const&) TestRunner.cpp:142 (libCppUnitd.1.dylib:arm64+0x12668)

    #6 main Driver.cpp:17 (testrunnerd:arm64+0x1000b4dac)

Please add relevant environment information:

osx, clang TSAN build

@bas524 this is a good contribution, but please - whenever possible, make use of smart pointers, there's a good reason why they exist. and run the code through sanitizers on multiple platforms/compilers

Thank you. I'll try to fix it. Mistakes make our life more interesting 😁

from poco.

aleks-f avatar aleks-f commented on April 28, 2024

Thank you. I'll try to fix it. Mistakes make our life more interesting 😁

it is fixed already, I was just communicating for the future.

from poco.

bas524 avatar bas524 commented on April 28, 2024

Thank you. I'll try to fix it. Mistakes make our life more interesting 😁

it is fixed already, I was just communicating for the future.

Oh, ok. I understand.

from poco.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.