Comments (3)
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.
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.
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)
- websocket client shutdown issue on windows 7
- Poco::URI: don't lowercase host part if it's a Unix domain socket
- Poco::Thread setName
- Thread destructor HOT 1
- client certificate verification against hostname question HOT 1
- Upgrade bundled libexpat to 2.6.1
- Upgrade bundled PCRE2 to 10.43
- Bump CI action versions
- ProcessRunner does not detect launch errors
- DateTimeFormat RFC1036 Sunday name is short (should be long)
- Add Poco::Util::Timer::idle() method to check if timer has any tasks scheduled
- Poco::BasicMemoryStreamBuf is missing seekpos()
- PocoDoc: search support
- websockets server: 401 unauthorized
- Upgrade bundled libexpat to 2.6.2
- Poco::Optional iterator to enable "for-each" syntax HOT 2
- Couldn't establish an encrypted FTP data connection with FTP(S)ClientSession HOT 2
- Optional and Nullable Improvements HOT 1
- GitHub runner: Linux thread sanitizer tests fail with "unexpected memory mapping"
- ODBC Unicode wrappers do not check for null length pointers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from poco.