datarace in setrepository::isempty

Milian Wolff mail at milianw.de
Thu Sep 30 16:47:02 UTC 2010


Imo this is a valid complain, no? It should get a StaticAccessLocker as well 
before the m_setIndex == 0 comparison? Or use a QAtomicInt?

Bye

==7178== Possible data race during read of size 1 at 0x12116444 by thread #6
==7178==    at 0x688E55C: Utils::StorableSet<KDevelop::IndexedTopDUContext, 
KDevelop::IndexedTopDUContextIndexConversion, 
KDevelop::RecursiveImportRepository, true, Utils::DummyLocker>::isEmpty() 
const (setrepository.h:175)
==7178==    by 0x6887EF1: KDevelop::TopDUContext::usingImportsCache() const 
(topducontext.cpp:673)
==7178==    by 0x688C6DC: 
KDevelop::TopDUContextLocalPrivate::addImportedContextRecursion(KDevelop::TopDUContext 
const*, KDevelop::TopDUContext const*, int, bool) (topducontext.cpp:412)
==7178==    by 0x688C885: 
KDevelop::TopDUContextLocalPrivate::addImportedContextRecursion(KDevelop::TopDUContext 
const*, KDevelop::TopDUContext const*, int, bool) (topducontext.cpp:462)
==7178==    by 0x688C885: 
KDevelop::TopDUContextLocalPrivate::addImportedContextRecursion(KDevelop::TopDUContext 
const*, KDevelop::TopDUContext const*, int, bool) (topducontext.cpp:462)
==7178==    by 0x688BF62: 
KDevelop::TopDUContextLocalPrivate::addImportedContextRecursively(KDevelop::TopDUContext*, 
bool, bool) (topducontext.cpp:295)
==7178==    by 0x6889A06: 
KDevelop::TopDUContext::addImportedParentContext(KDevelop::DUContext*, 
KDevelop::SimpleCursor const&, bool, bool) (topducontext.cpp:1260)
==7178==    by 0xD092724: CMakeProjectVisitor::createContext(KUrl const&, 
KDevelop::ReferencedTopDUContext, int, int, bool) 
(cmakeprojectvisitor.cpp:713)
==7178==    by 0xD0A2E33: CMakeProjectVisitor::walk(QList<CMakeFunctionDesc> 
const&, int, bool) (cmakeprojectvisitor.cpp:2076)
==7178==    by 0xD09038C: CMakeProjectVisitor::visit(IncludeAst const*) 
(cmakeprojectvisitor.cpp:537)
==7178==    by 0xD0845FA: IncludeAst::accept(CMakeAstVisitor*) const 
(cmakeast.h:428)
==7178==    by 0xD0A3762: CMakeProjectVisitor::walk(QList<CMakeFunctionDesc> 
const&, int, bool) (cmakeprojectvisitor.cpp:2141)
==7178==  This conflicts with a previous write of size 4 by thread #2
==7178==    at 0x688D2DF: Utils::StorableSet<KDevelop::IndexedTopDUContext, 
KDevelop::IndexedTopDUContextIndexConversion, 
KDevelop::RecursiveImportRepository, true, 
Utils::DummyLocker>::operator=(Utils::StorableSet<KDevelop::IndexedTopDUContext, 
KDevelop::IndexedTopDUContextIndexConversion, 
KDevelop::RecursiveImportRepository, true, Utils::DummyLocker> const&) 
(setrepository.h:291)
==7178==    by 0x688AAD3: 
KDevelop::TopDUContextData::TopDUContextData(KDevelop::TopDUContextData 
const&) (topducontextdata.h:49)
==7178==    by 0x6894D05: KDevelop::DUChainItemFactory<KDevelop::TopDUContext, 
KDevelop::TopDUContextData>::copy(KDevelop::DUChainBaseData const&, 
KDevelop::DUChainBaseData&, bool) const (duchainregister.h:58)
==7178==    by 0x690438A: 
KDevelop::DUChainItemSystem::copy(KDevelop::DUChainBaseData const&, 
KDevelop::DUChainBaseData&, bool) const (duchainregister.cpp:68)
==7178==    by 0x68951FF: saveDUChainItem(QList<QPair<QByteArray, unsigned 
int> >&, KDevelop::DUChainBase&, unsigned int&) 
(topducontextdynamicdata.cpp:67)
==7178==    by 0x6898265: KDevelop::TopDUContextDynamicData::store() 
(topducontextdynamicdata.cpp:544)
==7178==    by 0x684F7F0: KDevelop::DUChainPrivate::doMoreCleanup(int, bool) 
(duchain.cpp:752)
==7178==    by 0x684CC9B: KDevelop::DUChainPrivate::CleanupThread::run() 
(duchain.cpp:294)
==7178==  Address 0x12116444 is 100 bytes inside a block of size 320 alloc'd
==7178==    at 0x4024490: malloc (vg_replace_malloc.c:236)
==7178==    by 0x544660C: qMalloc(unsigned int) (qmalloc.cpp:55)
==7178==    by 0x544E895: QByteArray::QByteArray(int, char) 
(qbytearray.cpp:1313)
==7178==    by 0x6897723: KDevelop::TopDUContextDynamicData::store() 
(topducontextdynamicdata.cpp:449)
==7178==    by 0x684F7F0: KDevelop::DUChainPrivate::doMoreCleanup(int, bool) 
(duchain.cpp:752)
==7178==    by 0x684CC9B: KDevelop::DUChainPrivate::CleanupThread::run() 
(duchain.cpp:294)
==7178==    by 0x544BFBD: QThreadPrivate::start(void*) (qthread_unix.cpp:248)
==7178==    by 0x4028734: mythread_wrapper (hg_intercepts.c:221)
==7178==    by 0x6D53954: start_thread (pthread_create.c:300)
==7178==    by 0x635FE7D: clone (clone.S:130)

-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100930/664061c1/attachment.sig>


More information about the KDevelop-devel mailing list