Text input results in "Attempt to re-lock a non-recursive lock I already hold" (as reported by helgrind)

David Jennings david.jennings at thefoundry.co.uk
Fri Sep 2 06:57:24 PDT 2011

Hello list,

I'm developing a Qt application on CentOS 5.6 and hitting a deadlock with
a text input field.

The basic code flow is:

Create Qt application with windows and widgets
Show widget with a text input field
Upon typing into the text input field the application hangs

At this stage the application is not yet running multithreaded, but soon
will be, hence the call to XInitThreads() at the start.

Running under helgrind shows that the problem is lock request on a
non-recursive lock that is already locked.

Software versions are:

Centos 5.6
X Window System Version 7.1.1 - Release Date: 12 May 2006
Qt 4.7.2

helgrind shows:

==9978== Thread #1: Attempt to re-lock a non-recursive lock I already hold
==9978==    at 0x4A0773C: pthread_mutex_lock (hg_intercepts.c:453)
==9978==    by 0x3CA7A35162: ??? (in /usr/lib64/libX11.so.6.2.0)
==9978==    by 0x3CA7A99E7C: XkbGetUpdatedMap (in
==9978==    by 0x3CA7A99F74: XkbGetMap (in /usr/lib64/libX11.so.6.2.0)
==9978==    by 0x3CA7A95CE0: ??? (in /usr/lib64/libX11.so.6.2.0)
==9978==    by 0x3CA7A963FA: XkbLookupKeySym (in
==9978==    by 0x3CA7A964CA: XLookupString (in /usr/lib64/libX11.so.6.2.0)
==9978==    by 0x3CA7A70F4B: _XimLocalFilter (in
==9978==    by 0x3CA7A281D3: XFilterEvent (in /usr/lib64/libX11.so.6.2.0)
==9978==    by 0x6A98AB2: ??? (in libQtGui.so.4.7.2)
==9978==    by 0x64F6697: QApplication::x11ProcessEvent(_XEvent*) (in
==9978==    by 0x6521B31: ??? (in libQtGui.so.4.7.2)

The ??? at line 3 is almost certainly _XLockDisplay() according to a very
similar stack trace I saw in my Googling for this.

I get the same stack trace if I break into the code under gdb when it's
locked up.

Running the same code on Ubuntu 10.04 with X Windows version 1.7.6
(according to "X -version") is okay.

Are there any steps I can take to further analyse this problem or any
patches I can apply to fix this issue?

Thanks, David.

More information about the xorg mailing list