Skip to content
GitLab
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 77
    • Issues 77
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • lib
  • libX11libX11
  • Merge requests
  • !1

poll_for_response: Call poll_for_event again if xcb_poll_for_reply fails

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Michel Dänzer requested to merge daenzer/libx11:poll_for_response-poll_for_reply-event into master Sep 25, 2018
  • Overview 8
  • Commits 1
  • Pipelines 0
  • Changes 1

If xcb_poll_for_reply fails to find a reply, poll_for_response would always return NULL. However, xcb_poll_for_reply may have read events from the display connection while looking for a reply. In that case, returning NULL from poll_for_response is wrong and can result in the client hanging, e.g. because it returns to waiting for the display connection file descriptor becoming readable after XPending incorrectly returned 0 pending events.

The solution is to call poll_for_event again after xcb_poll_for_reply returned 0. This will return the first of any events read by xcb_poll_for_reply.

Fixes issue #79 (closed).

Reported-by: Yuxuan Shui yshuiv7@gmail.com Bugzilla: https://bugs.freedesktop.org/108008 Bugzilla: https://bugs.freedesktop.org/107992

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: poll_for_response-poll_for_reply-event