10000 Potential data race in Poco::SharedPtr reported by TSAN · Issue #2207 · pocoproject/poco · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Potential data race in Poco::SharedPtr reported by TSAN #2207
Closed
@jbulow

Description

@jbulow

I see the following report from clang's thread sanitizer:

WARNING: ThreadSanitizer: data race (pid=18496)
Atomic write of size 4 at 0x7b040001c1f0 by thread T3 (mutexes: write M35319715098537976, write M42356589516556368, write M224752683662668696, write M1065241059421923688):
#0 __tsan_atomic32_fetch_sub /home/jonasbu/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_interface_atomic.cc:643 (nsp_servers+0x4aacec)
#1 Poco::AtomicCounter::operator--() /artifacts/external/poco/deliverables/interface/Poco/AtomicCounter.h:314:9 (libcsc.so+0x203172)
#2 Poco::ReferenceCounter::release() /artifacts/external/poco/deliverables/interface/Poco/SharedPtr.h:47:10 (libcsc.so+0x203088)
#3 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::release() /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:393:22 (libPocoFoundationd.so.49+0x2e1e80)
#4 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::~SharedPtr() /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:148:4 (libPocoFoundationd.so.49+0x2e1ba8)
#5 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::assign(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable > const&) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:172:3 (libPocoFoundationd.so.49+0x2e200a)
#6 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::operator=(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable > const&) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:194:10 (libPocoFoundationd.so.49+0x2e1458)
#7 Poco::ThreadImpl::startImpl(Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/src/Thread_POSIX.cpp:205:26 (libPocoFoundationd.so.49+0x2de7be)
#8 Poco::Thread::start(Poco::Runnable&) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/src/Thread.cpp:130:2 (libPocoFoundationd.so.49+0x2e03c7)

...

Previous write of size 8 at 0x7b040001c1f0 by thread T156:
#0 operator new(unsigned long) /home/jonasbu/llvm/projects/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc:57 (nsp_servers+0x4d1e53)
#1 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::SharedPtr(Poco::Runnable*) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:124:13 (libPocoFoundationd.so.49+0x2e1a8a)
#2 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::assign(Poco::Runnable*) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:160:14 (libPocoFoundationd.so.49+0x2e233f)
#3 Poco::SharedPtr<Poco::Runnable, Poco::ReferenceCounter, Poco::ReleasePolicyPoco::Runnable >::operator=(Poco::Runnable*) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/include/Poco/SharedPtr.h:189:10 (libPocoFoundationd.so.49+0x2e14c8)
#4 Poco::ThreadImpl::runnableEntry(void*) /artifacts/external/poco/source/poco-1.7.9-all/Foundation/src/Thread_POSIX.cpp:364:25 (libPocoFoundationd.so.49+0x2df014)

Is it a real issue or a false positive? Using shared pointers from std or boost does not have this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0