[Qt-interest] QMutex deadlock without using QMutex

Brad Howes howes at ll.mit.edu
Tue Apr 27 17:49:51 CEST 2010


On Apr 27, 2010, at 11:32 AM, Andre Somers wrote:

> After setting a breakpoint at the two places where this error can be 
> triggered (qmutex.cpp lines 162 and 200; Qt 4.6.2) I managed to get a trace:
> 
> 0    QMutex::lock    qmutex.cpp    201    0x00e10f4e
> 1    QMutexLocker::relock    qmutex.h    120    0x00f5c564
> 2    QMutexLocker    qmutex.h    102    0x00f5c604
> 3    QCoreApplicationPrivate::sendPostedEvents    
> qcoreapplication.cpp    1271    0x00efe127
> 4    qt_internal_proc    qeventdispatcher_win.cpp    482    0x00f1f73f
> 5    USER32!DefDlgProcW    C:\WINDOWS\syswow64\user32.dll    0    
> 0x7d9472d8
> 6    ??        0    0x003f06a8
> 7    ??        0    0x00000401
> 8    ??        0    0x00000000
> 
> Following the item at line 3, I notice that Qt is indeed using a mutex 
> for the message passing. So, it seems we are dealing with Qt's mutex, 
> not mine.


Are your trying to do more signalling while you are responding to a signal? Not knowing the internals, I would hazard a guess that that could cause a (self) deadlock. QMutex supports recursive locking, but I have no idea if the QMutex used in sendPostedEvents was created in that manner.

Brad

-- 
Brad Howes
Group 42
MIT Lincoln Laboratory • 244 Wood St. • Lexington, MA 02173
Phone: 781.981.5292 • Fax: 781.981.3495 • Secretary: 781.981.7420









More information about the Qt-interest-old mailing list