1. 19 Nov, 2020 2 commits
  2. 02 Mar, 2020 1 commit
  3. 22 Feb, 2020 5 commits
  4. 19 May, 2019 1 commit
    • Martin Dørum's avatar
      Handle EINTR from recvmsg in _xcb_in_read · 21324989
      Martin Dørum authored
      I have a GTK application which occasionally crashes with an "interrupted
      system call" g_message from gdk. After a lot of debugging, I've found
      that the call to recvmsg in _xcb_in_read occasionally fails with EINTR,
      and instead of retrying the system call, xcb would just shut down the
      connection.
      
      This change makes _xcb_in_read treat EINTR the same as it would treat
      EAGAIN; it returns 1 and libX11 ends up calling xcb_poll_for_event
      again (from what I have understood).
      
      I have spoken with a few people who think recvmsg failing with EINTR in
      this case shouldn't ever happen, and I don't know enough to agree or
      disagree with that. In case anyone wants to dig further and try to
      figure out why the recvmsg call sometimes fails with EINTR, here's the
      backtrace from inside of _xcb_in_read where that happened:
      
      Thread 1 "beanbar" hit Breakpoint 1, _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059
      1059                fprintf(stderr, "Hello World am %s:%i, errno is %s\n", __FILE__, __LINE__, strerror(errno));
      (gdb) bt
      0  0x00007fa48fa48639 in _xcb_in_read (c=c@entry=0x55ecbe4aba80) at xcb_in.c:1059
      1  0x00007fa48fa489d8 in poll_for_next_event (c=0x55ecbe4aba80, queued=queued@entry=0) at xcb_in.c:352
      2  0x00007fa48fa48a3d in poll_for_next_event (queued=0, c=<optimized out>) at xcb_in.c:722
      3  0x00007fa48fa48a3d in xcb_poll_for_event (c=<optimized out>) at xcb_in.c:722
      4  0x00007fa4908d1b7e in poll_for_event (dpy=dpy@entry=0x55ecbe4a9730, queued_only=queued_only@entry=0) at xcb_io.c:245
      5  0x00007fa4908d1cf0 in poll_for_response (dpy=dpy@entry=0x55ecbe4a9730) at xcb_io.c:303
      6  0x00007fa4908d1fed in _XEventsQueued (mode=2, dpy=0x55ecbe4a9730) at xcb_io.c:363
      7  0x00007fa4908d1fed in _XEventsQueued (dpy=dpy@entry=0x55ecbe4a9730, mode=mode@entry=2) at xcb_io.c:344
      8  0x00007fa4908c3d47 in XPending (dpy=0x55ecbe4a9730) at Pending.c:55
      9  0x00007fa493cadbc7 in  () at /usr/lib/libgdk-3.so.0
      10 0x00007fa49234d08a in g_main_context_prepare () at /usr/lib/libglib-2.0.so.0
      11 0x00007fa49234d6e6 in  () at /usr/lib/libglib-2.0.so.0
      12 0x00007fa49234d8ae in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
      13 0x00007fa4938b920e in g_application_run () at /usr/lib/libgio-2.0.so.0
      14 0x000055ecbc820af4 in main (argc=1, argv=0x7ffd06238098) at src/main.c:190
      Signed-off-by: Martin Dørum's avatarMartin Dørum <martid0311@gmail.com>
      21324989
  5. 25 Apr, 2019 1 commit
  6. 17 Feb, 2019 2 commits
  7. 16 Feb, 2019 2 commits
  8. 07 Jan, 2019 1 commit
  9. 27 Sep, 2018 1 commit
  10. 21 Aug, 2018 1 commit
    • Erik Kurzinger's avatar
      don't flag extra reply in xcb_take_socket · bbda345a
      Erik Kurzinger authored
      If any flags are specified in a call to xcb_take_socket,
      they should only be applied to replies for requests sent
      after that function returns (and until the socket is
      re-acquired by XCB).
      
      Previously, they would also be incorrectly applied to the
      reply for the last request sent before the socket was taken.
      For instance, in this example program the reply for the
      GetInputFocus request gets discarded, even though it was
      sent before the socket was taken. This results in the
      call to retrieve the reply hanging indefinitely.
      
      static void return_socket(void *closure) {}
      
      int main(void)
      {
          Display *dpy = XOpenDisplay(NULL);
          xcb_connection_t *c = XGetXCBConnection(dpy);
      
          xcb_get_input_focus_cookie_t cookie = xcb_get_input_focus_unchecked(c);
          xcb_flush(c);
      
          uint64_t seq;
          xcb_take_socket(c, return_socket, dpy, XCB_REQUEST_DISCARD_REPLY, &seq);
      
          xcb_generic_error_t *err;
          xcb_get_input_focus_reply(c, cookie, &err);
      }
      
      In practice, this has been causing intermittent KWin crashes when
      used in combination with the proprietary NVIDIA driver such as
      https://bugs.kde.org/show_bug.cgi?id=386370 since when Xlib fails to
      retrieve one of these incorrectly discarded replies it triggers
      an IO error.
      Signed-off-by: Erik Kurzinger's avatarErik Kurzinger <ekurzinger@nvidia.com>
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      bbda345a
  11. 28 Feb, 2018 1 commit
  12. 05 Jun, 2017 2 commits
  13. 13 May, 2017 2 commits
  14. 01 Apr, 2017 1 commit
  15. 11 Mar, 2017 3 commits
    • Christian Linhart's avatar
      add support for eventstruct · ee9dfc9a
      Christian Linhart authored
      eventstruct allows to use events as part of requests.
      This is, e.g., needed by xcb_input_send_extension_event.
      Signed-off-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      ee9dfc9a
    • Christian Linhart's avatar
      optionally build the GE extension · 0c2c5d50
      Christian Linhart authored
      xcb contains an xml-definition for the GenericEvent extension
      but this extension was neither generated nor built.
      
      This patch enables optional building of the GenericEvent extension
      with configure option --enable-ge
      
      By default, the GenericEvent extension is not built.
      Normally this is not needed by application programs
      because there is implicit support for the GE-extension
      for the specific events built with this extension.
      
      But it may be useful for X-protocol analyzers and stuff like that.
      Signed-off-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      0c2c5d50
    • Christian Linhart's avatar
      move symbol lookup of sumof expr to the parser · 9bce1f72
      Christian Linhart authored
      replace the complicated symboltable lookup for sumof expr
      by accessing the lenfield of the expr-object.
      
      This requires the corresponding patch for xcb/proto
      which sets the lenfield accordingly.
      
      This should be OK because for official releases we define
      that dependency in the build system.
      
      For getting versions off the HEAD of the git repo, it should
      be obvious that xcb/proto and xcb/libxcb have to be updated together.
      
      I have tested this patch and it generates exactly the same code
      as before.
      Tested-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      Signed-off-by: Christian Linhart's avatarChristian Linhart <chris@demorecorder.com>
      9bce1f72
  16. 29 May, 2016 2 commits
    • Alan Coopersmith's avatar
      Correct @param "e" to "error" in xcb_poll_for_reply*() · 65b298c7
      Alan Coopersmith authored
      Found by clang -Wdocumentation:
      
      ./xcbext.h:271:11: warning: parameter 'e' not found in the function
            declaration [-Wdocumentation]
       * @param e Location to store errors in, or NULL. Ignored for un...
                ^
      ./xcbext.h:271:11: note: did you mean 'error'?
       * @param e Location to store errors in, or NULL. Ignored for un...
                ^
                error
      
      ./xcbext.h:283:11: warning: parameter 'e' not found in the function
            declaration [-Wdocumentation]
       * @param e Location to store errors in, or NULL. Ignored for un...
                ^
      ./xcbext.h:283:11: note: did you mean 'error'?
       * @param e Location to store errors in, or NULL. Ignored for un...
                ^
                error
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      65b298c7
    • Alan Coopersmith's avatar
      Remove : from @param names in manually written headers · 32a90845
      Alan Coopersmith authored
      Makes style match the @param names in autogenerated headers and makes
      clang -Wdocumentation stop complaining about all of them:
      
      ./xcb.h:523:11: warning: parameter 'display:' not found in the function
            declaration [-Wdocumentation]
       * @param display: A pointer to the display number.
                ^~~~~~~~
      ./xcb.h:523:11: note: did you mean 'display'?
       * @param display: A pointer to the display number.
                ^~~~~~~~
                display
      Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
      Signed-off-by: Uli Schlachter's avatarUli Schlachter <psychon@znc.in>
      32a90845
  17. 28 May, 2016 1 commit
  18. 18 May, 2016 1 commit
  19. 14 May, 2016 1 commit
  20. 01 Feb, 2016 2 commits
  21. 06 Jan, 2016 3 commits
  22. 21 Sep, 2015 1 commit
  23. 13 Aug, 2015 1 commit
  24. 04 Jul, 2015 2 commits