[Interest] Using valgrind to detect threading errors in qt5 code

Thiago Macieira thiago.macieira at intel.com
Tue Apr 10 14:56:20 CEST 2012


On terça-feira, 10 de abril de 2012 13.35.24, paulf at free.fr wrote:
> ----- Original Message -----
> 
> > Hi all...what's the best tool to detect threading errors in qt5 based
> > code?
> > Are valgrind's drd and helgrind tools reliable for qt5 code?
> > AFAIK they include some support for qt4 based clients, but I also
> > know Qmutex has changed quite a lot in qt5, so I wonder if the
> > results we get now for qt5 code are reliable or not anymore.
> 
> Hi
> 
> I believe that Valgrind has nothing specific to Qt other than Valkyrie, a Qt
> 4 graphical frontend.

That's not correct. Valgrind's helgrind had support for QMutex specifically. 
Helgrind needed to know when a mutex was locked or unlocked, in order to 
present its warnings. To do that, it specifically overrides the QMutex::lock 
and unlock functions.

I don't know about DRD.

As for Qt 5, since locking and unlocking is inlined into the user code, 
valgrind might be completely unable to work.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120410/8e7b71f4/attachment.sig>


More information about the Interest mailing list