Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NotificationCenter data race #4307

Closed
aleks-f opened this issue Nov 28, 2023 · 0 comments
Closed

NotificationCenter data race #4307

aleks-f opened this issue Nov 28, 2023 · 0 comments
Assignees

Comments

@aleks-f
Copy link
Member

aleks-f commented Nov 28, 2023

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

@aleks-f aleks-f added the bug label Nov 28, 2023
@aleks-f aleks-f self-assigned this Nov 28, 2023
@aleks-f aleks-f added this to the Release 1.13.0 milestone Nov 28, 2023
matejk added a commit that referenced this issue Dec 9, 2023
* fix(NumericString): properly mark uIntToString deprecated #4304

* dev(runLibtests): allow to specify test to run

* fix(NotificationCenter): data race #4307

* fix(DirectoryWatcher): data race #4308

* fix(ArchiveStrategy): data race #4309

* fix(ActiveThread): data race #4310

* fix(Task): Cancelled Task shouldn't start running #4311 (WIP)

* fix(String): ignore clang loop unrolling warnings

* fix(TaskManager): task ownership #4311

* chore(FIFOEventTest): fix unused var warning; disable benchmark in test

* fix(Task): remove unnecessary mutex (and prevent cyclic locking reported by TSAN)

* fix(CryptoTest): disable testEncryptDecryptGCM

* fix(ci): typo

* fix(NotificationCenter): disable and clear observers in dtor (#4307)

---------

Co-authored-by: Matej Kenda <matejken@gmail.com>
@matejk matejk added the fixed label Dec 9, 2023
@aleks-f aleks-f closed this as completed Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants