Skip to content

NotificationCenter data race #4307

@aleks-f

Description

@aleks-f

Describe the bug
All observers container access is protected by mutex, except access by destructor destroying the container.

To Reproduce
Thread sanitizer

Expected behavior
Clean destruction

Logs

WARNING: ThreadSanitizer: data race (pid=70947)
  Write of size 8 at 0x0001070011c8 by main thread:
// ...
    #11 Poco::NotificationCenter::~NotificationCenter() NotificationCenter.cpp:31 (libPocoFoundationd.100.dylib:arm64+0x104418)
    #12 Poco::TaskManager::~TaskManager() TaskManager.cpp:52 (libPocoFoundationd.100.dylib:arm64+0x1cb4a0)
// ...
Previous read of size 8 at 0x0001070011c8 by thread T11 (mutexes: write M0):
// ...
#8 Poco::NotificationCenter::postNotification(Poco::AutoPtr<Poco::Notification>) NotificationCenter.cpp:72 (libPocoFoundationd.100.dylib:arm64+0x1050bc)
// ..

Please add relevant environment information:
osx clang

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions