[Gammaray-interest] QtXmlPatterns and probe's object lock
Volker Krause
volker.krause at kdab.com
Mon Jun 25 10:36:15 CEST 2018
On Sunday, 24 June 2018 08:01:30 CEST Christian Gagneraud wrote:
> Hi there,
>
> It took me a while to find out what the problem was, so here it is:
> My query engine would dead-lock if i create a QXmlQuery or a
> QXmlFormatter, while holding the probe's lock.
> Is it something unexpected or does holding the probe's object lock
> interferes with some internal Qt lock mechanism?
That probably means those classes create (or destroy) a QObject internally,
which they can only do when the probe object lock isn't locked. That lock is
meant to prevent QObjects from being invalidated while GammaRay code is
exploring them, which however also affects QObjects that belong to GammaRay
itself, directly or indirectly.
Try to hold the lock for as short as possible, only while actually reading
QObject state. There are of course limits to this, in the QObject monitoring
code paths it's for example impossible to use qDebug() due to the same
problem. I would assume though that QXml* classes limit QObject creation to
their construction, so reducing the lock scope is hopefully enough.
Regards,
Volker
> BTW, I manage to write my query client, here is a demo on an empty
> QCoreApplication program:
> $ gammaray-query tcp://127.0.0.1:11732 './/*[@applicationName]'
> <objects>
> <QThread objectName=""/>
> <QBuffer objectName=""/>
> <QBuffer objectName=""/>
> <QBuffer objectName=""/>
> <QBuffer objectName=""/>
> <QBuffer objectName=""/>
> <QObject objectName=""/>
> <QAbstractItemModel objectName=""/>
> <QEventLoop objectName=""/>
> <QCoreApplication objectName="" applicationName="untitled"
> applicationVersion="" organizationName="" organizationDomain=""
> quitLockEnabled="true">
> <QEventDispatcherGlib objectName=""/>
> </QCoreApplication>
> </objects>
>
> $ gammaray-query tcp://127.0.0.1:11732 './/*[@applicationName]'
> <QCoreApplication objectName="" applicationName="untitled"
> applicationVersion="" organizationName="" organizationDomain=""
> quitLockEnabled="true">
> <QEventDispatcherGlib objectName=""/>
> </QCoreApplication>
nice :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4664 bytes
Desc: not available
URL: <http://mail.kdab.com/pipermail/gammaray-interest/attachments/20180625/bb619ecb/attachment.p7s>
More information about the Gammaray-interest
mailing list