[Qt-interest] how to debug a deadlock
alexander golks
alex at golks.de
Wed Jul 14 14:41:50 CEST 2010
seeing incoming breakpoint solution while writing the same solution... ;)
i think deadlock detection is rather complex,
and you'll not have other possibilities than logging/breakpointing locks, unlocks, etc.
however, queuing of the commands like mentionend by Atlant would avoid the dead locks.
alex
> ------------------------------
>
> Message: 4
> Date: Wed, 14 Jul 2010 13:29:28 +0200
> From: Matthias Pospiech <matthias.pospiech at gmx.de>
> Subject: [Qt-interest] how to debug a deadlock
> To: qt-interest at trolltech.com
> Message-ID: <4C3D9F98.2060506 at gmx.de>
> Content-Type: text/plain; charset=ISO-8859-15; format=flowed
>
> I have a dll sending commands using the serial port. The dll is from a
> company and I can only use it the way it is.
> My problem is that this dll does not synchronise commands and replies
> over the serial port.
> This becomes a problem if I send commands from different threads.
>
> The simplest solution would be to ensure that all commands can only be
> called once at the same time.
> So that the next command must wait for the previous to be finished. Here
> however is not difference between setting and getting
> (or reading and writing), because the dll always sends and recieves for
> a single command.
>
> Now my idea was to use a
> QMutexLocker locker( &mutex );
>
> in every function sending commands with the dll.
>
> This however leads to an immediate deadlock. QtCreator however does not
> show where this deadlock happend.
> Now I wonder how to debug this?
>
> Matthias
>
>
--
/*
* printk(KERN_ERR "BIGMAC: Would you like that for here or to go?\n");
* linux-2.6.19/drivers/net/sunbmac.c
*/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100714/38c2c68b/attachment.bin
More information about the Qt-interest-old
mailing list