Skip to content

Fix deadlock in XRebindKeysym()

Olivier Fourdan requested to merge ofourdan/libx11:fix-issue-216 into master

Xlib is now built with threading support enabled from the constructor by default.

XRebindKeysym() acquires the display lock, then calls:

| XRebindKeysym()
|  LockDisplay()
|  ComputeMaskFromKeytrans()
|    -> XkbKeysymToModifiers()
|        -> _XkbLoadDpy()
|            -> XkbGetMap()
|                -> XkbGetUpdatedMap()
|                   LockDisplay()

And the dead lock:

| Xlib ERROR: XKBGetMap.c line 575 thread 1fc6e580: locking display already
| locked at KeyBind.c line 937

To avoid the issue, call ComputeMaskFromKeytrans() from outside the display lock.

Signed-off-by: Olivier Fourdan ofourdan@redhat.com
Closes: #216 (closed)

Edited by Olivier Fourdan

Merge request reports