summaryrefslogtreecommitdiff
path: root/cppuhelper/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-09-04 20:02:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-09-05 09:58:55 +0200
commit6ebe316635b7d4a2d8a82f79cc99eab95b0aabff (patch)
treef9458b67e82eb23b5a7df04ca8f43bf401873504 /cppuhelper/source
parent1799fb8a5ab568519f00a575ec2fb0190ae0c19d (diff)
tsan: data race
Atomic write of size 4 at 0x7254000f5f08 by thread T38 (mutexes: write M0, write M1, write M2): 0 configmgr::Access::acquireCounting() 1 configmgr::Components::initGlobalBroadcaster(configmgr::Modifications const&, rtl::Reference<configmgr::RootAccess> const&, configmgr::Broadcaster*) 2 configmgr::RootAccess::commitChanges() 3 non-virtual thunk to configmgr::RootAccess::commitChanges() 4 utl::OConfigurationTreeRoot::commit() 5 dbaccess::(anonymous namespace)::DatabaseRegistrations::registerDatabaseLocation(rtl::OUString const&, rtl::OUString const&) 6 non-virtual thunk to dbaccess::(anonymous namespace)::DatabaseRegistrations::registerDatabaseLocation(rtl::OUString const&, rtl::OUString const&) 7 dbaccess::ODatabaseContext::registerDatabaseLocation(rtl::OUString const&, rtl::OUString const&) 8 dbaccess::ODatabaseContext::registerObject(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) 9 non-virtual thunk to dbaccess::ODatabaseContext::registerObject(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&) 10 gcc3::callVirtualMethod(void*, unsigned int, void*, _typelib_TypeDescriptionReference*, bool, unsigned long*, unsigned int, unsigned long*, double*) Previous read of size 4 at 0x7254000f5f08 by main thread (mutexes: write M3, write M4): 0 cppu::OWeakObject::disposeWeakConnectionPoint() 1 cppu::OWeakObject::release() 2 configmgr::RootAccess::release() 3 non-virtual thunk to configmgr::RootAccess::release() 4 com::sun::star::uno::Reference<com::sun::star::util::XChangesBatch>::~Reference() 5 SvtLinguConfig::~SvtLinguConfig() 6 SwDoc::GetGCIterator() 7 SwDoc::StartGrammarChecking(bool) 8 sw::DocumentTimerManager::GetNextIdleJob() 9 sw::DocumentTimerManager::IsDocIdle() 10 sw::SwDocIdle::UpdateMinPeriod(unsigned long) const 11 Scheduler::CallbackTaskScheduling() Change-Id: Idaf2707e5902338a873a325228e9c97e646ea768 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172874 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppuhelper/source')
-rw-r--r--cppuhelper/source/weak.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index 6bb353faa9bd..446cdc0e43ba 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -27,6 +27,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
+#include <atomic>
#include <algorithm>
#include <vector>
#include <mutex>
@@ -232,7 +233,7 @@ void SAL_CALL OWeakObject::release() noexcept
void OWeakObject::disposeWeakConnectionPoint()
{
- OSL_PRECOND( m_refCount == 0, "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" );
+ OSL_PRECOND( (atomic_thread_fence(std::memory_order_acquire), m_refCount == 0), "OWeakObject::disposeWeakConnectionPoint: only to be called with a ref count of 0!" );
if (m_pWeakConnectionPoint != nullptr) {
OWeakConnectionPoint * const p = m_pWeakConnectionPoint;
m_pWeakConnectionPoint = nullptr;