Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • libX11 libX11
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 68
    • Issues 68
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 7
    • Merge requests 7
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorg
  • lib
  • libX11libX11
  • Merge requests
  • !13

Merged
Created May 18, 2019 by Dmitry Osipenko@digetxContributor

Fix lockup in _XReply() caused by recursive synchronization

  • Overview 9
  • Commits 1
  • Changes 3

This patch is based on a suggestion made by Uli Schlachter @psychon in a comment to the bug report #93 (closed).

Explanation of the bug (given by Uli Schlachter as well):

An error was received and handled. Since there was an error callback set, Xlib unlocks the display, runs the error callback, and then locks the display again. This goes through _XLockDisplay and then calls _XSeqSyncFunction. On this "lock the thing"-path, Xlib notices that sequence numbers are close to wrap-around and tries to send a GetInputFocus request. However, the earlier calls already registered themselves as "we are handling replies/errors, do not interfere!" and so the code here waits for "that other thread" to be done before it continues. Only that there is no other thread, but it is this thread itself and thus a deadlock follows.

The bug is relatively easy to reproduce on any desktop environment by using actively a touchscreen input that supports multitouch, i.e. practically all mobile devices are affected.

Fixes: #93 (closed)

Suggested-by: Uli Schlachter psychon@znc.in
Tested-by: Dmitry Osipenko digetx@gmail.com
Reported-by: Dmitry Osipenko digetx@gmail.com
Signed-off-by: Dmitry Osipenko digetx@gmail.com

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: lockup-fix