Hi,

libxcb 1.13.1 is a bug fix release to handle a corner case in X11
event handling.

to test, apply in /usr/xenocara and rebuild xenocara as per
release(8).


ok?

Index: dist/libxcb/ChangeLog
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/ChangeLog,v
retrieving revision 1.2
diff -u -p -u -r1.2 ChangeLog
--- dist/libxcb/ChangeLog       11 Sep 2018 19:34:56 -0000      1.2
+++ dist/libxcb/ChangeLog       27 Sep 2018 19:16:38 -0000
@@ -1,3 +1,53 @@
+commit 8287ebd7b752c33b0cabc4982606fe4831106f7e
+Author: Uli Schlachter <psyc...@znc.in>
+Date:   Thu Sep 27 14:04:17 2018 +0200
+
+    Release libxcb 1.13.1
+
+commit bbda345a718ff73086437e51f03fcbb73e4365b9
+Author: Erik Kurzinger <ekurzin...@nvidia.com>
+Date:   Mon Aug 20 12:06:25 2018 -0700
+
+    don't flag extra reply in xcb_take_socket
+    
+    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 <ekurzin...@nvidia.com>
+    Signed-off-by: Uli Schlachter <psyc...@znc.in>
+
 commit 7e0f166579672d71efd819c81f0c932b0acd542c
 Author: Daniel Stone <dani...@collabora.com>
 Date:   Wed Feb 28 01:26:55 2018 +0000
Index: dist/libxcb/NEWS
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/NEWS,v
retrieving revision 1.13
diff -u -p -u -r1.13 NEWS
--- dist/libxcb/NEWS    11 Sep 2018 19:34:56 -0000      1.13
+++ dist/libxcb/NEWS    27 Sep 2018 19:16:38 -0000
@@ -1,3 +1,7 @@
+Release 1.13.1 (2018-09-27)
+===========================
+* Don't flag extra reply in xcb_take_socket
+
 Release 1.13 (2018-02-28)
 =========================
 * Add support for variable-sized lists of FDs
Index: dist/libxcb/configure.ac
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/configure.ac,v
retrieving revision 1.13
diff -u -p -u -r1.13 configure.ac
--- dist/libxcb/configure.ac    11 Sep 2018 19:34:56 -0000      1.13
+++ dist/libxcb/configure.ac    27 Sep 2018 19:16:38 -0000
@@ -2,7 +2,7 @@ dnl Process this file with autoconf to p
 
 # Initialize Autoconf
 AC_PREREQ([2.60])
-AC_INIT([libxcb],[1.13],
+AC_INIT([libxcb],[1.13.1],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xcb],
         [libxcb])
 AC_CONFIG_AUX_DIR([build-aux])
Index: dist/libxcb/build-aux/compile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/build-aux/compile,v
retrieving revision 1.3
diff -u -p -u -r1.3 compile
--- dist/libxcb/build-aux/compile       11 Sep 2018 19:34:56 -0000      1.3
+++ dist/libxcb/build-aux/compile       27 Sep 2018 19:16:38 -0000
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+# Copyright (C) 1999-2018 Free Software Foundation, Inc.
 # Written by Tom Tromey <tro...@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -340,7 +340,7 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
Index: dist/libxcb/build-aux/test-driver
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/build-aux/test-driver,v
retrieving revision 1.4
diff -u -p -u -r1.4 test-driver
--- dist/libxcb/build-aux/test-driver   11 Sep 2018 19:34:56 -0000      1.4
+++ dist/libxcb/build-aux/test-driver   27 Sep 2018 19:16:38 -0000
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -140,7 +140,7 @@ echo ":copy-in-global-log: $gcopy" >> $t
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
Index: dist/libxcb/m4/libtool.m4
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/m4/libtool.m4,v
retrieving revision 1.4
diff -u -p -u -r1.4 libtool.m4
--- dist/libxcb/m4/libtool.m4   11 Sep 2018 19:34:56 -0000      1.4
+++ dist/libxcb/m4/libtool.m4   27 Sep 2018 19:16:38 -0000
@@ -728,7 +728,6 @@ _LT_CONFIG_SAVE_COMMANDS([
     cat <<_LT_EOF >> "$cfgfile"
 #! $SHELL
 # Generated automatically by $as_me ($PACKAGE) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 # NOTE: Changes made to this file will be lost: look at ltmain.sh.
 
 # Provide generalized library-building support services.
@@ -2867,9 +2866,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu 
   # before this can be enabled.
   hardcode_into_libs=yes
 
-  # Add ABI-specific directories to the system library path.
-  sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib"
-
   # Ideally, we could use ldconfig to report *all* directores which are
   # searched for libraries, however this is still not possible.  Aside from not
   # being certain /sbin/ldconfig is available, command
@@ -2878,7 +2874,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu 
   # appending ld.so.conf contents (and includes) to the search path.
   if test -f /etc/ld.so.conf; then
     lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 
2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < 
/etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ 
/g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra"
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
   fi
 
   # We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -2890,6 +2886,18 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu 
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+netbsdelf*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix 
${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
 netbsd*)
   version_type=sunos
   need_lib_prefix=no
@@ -3549,7 +3557,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu 
   lt_cv_deplibs_check_method=pass_all
   ;;
 
-netbsd*)
+netbsd* | netbsdelf*-gnu)
   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern 
/lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   else
@@ -4427,7 +4435,7 @@ m4_if([$1], [CXX], [
            ;;
        esac
        ;;
-      netbsd*)
+      netbsd* | netbsdelf*-gnu)
        ;;
       *qnx* | *nto*)
         # QNX uses GNU C++, but need to define -shared option too, otherwise
@@ -4939,6 +4947,9 @@ m4_if([$1], [CXX], [
       ;;
     esac
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   *)
     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | 
$global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
     ;;
@@ -5001,6 +5012,9 @@ dnl Note also adjust exclude_expsyms for
   openbsd* | bitrig*)
     with_gnu_ld=no
     ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
   esac
 
   _LT_TAGVAR(ld_shlibs, $1)=yes
@@ -5255,7 +5269,7 @@ _LT_EOF
       fi
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs 
$linker_flags -o $lib'
        wlarc=
@@ -5776,6 +5790,7 @@ _LT_EOF
        if test yes = "$lt_cv_irix_exported_symbol"; then
           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs 
$deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && 
func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry 
$wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
        fi
+       _LT_TAGVAR(link_all_deplibs, $1)=no
       else
        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags -soname $soname `test -n "$verstring" && func_echo_all 
"-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs 
$compiler_flags -soname $soname `test -n "$verstring" && func_echo_all 
"-set_version $verstring"` -update_registry $output_objdir/so_locations 
-exports_file $export_symbols -o $lib'
@@ -5797,7 +5812,7 @@ _LT_EOF
       esac
       ;;
 
-    netbsd*)
+    netbsd* | netbsdelf*-gnu)
       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
        _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs 
$linker_flags'  # a.out
       else
@@ -6423,7 +6438,7 @@ if test yes != "$_lt_caught_CXX_error"; 
       # Commands to make compiler produce verbose output that lists
       # what "hidden" libraries, object files and flags are used when
       # linking a shared library.
-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | 
$GREP -v "^Configured with:" | $GREP "\-L"'
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | 
$GREP -v "^Configured with:" | $GREP " \-L"'
 
     else
       GXX=no
@@ -6798,7 +6813,7 @@ if test yes != "$_lt_caught_CXX_error"; 
             # explicitly linking system object files so we need to strip them
             # from the output so that they don't get included in the library
             # dependencies.
-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v 
conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z 
in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; func_echo_all "$list"'
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v 
conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z 
in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; func_echo_all "$list"'
             ;;
           *)
             if test yes = "$GXX"; then
@@ -6863,7 +6878,7 @@ if test yes != "$_lt_caught_CXX_error"; 
            # explicitly linking system object files so we need to strip them
            # from the output so that they don't get included in the library
            # dependencies.
-           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v 
conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z 
in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; func_echo_all "$list"'
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v 
conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z 
in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; 
done; func_echo_all "$list"'
            ;;
           *)
            if test yes = "$GXX"; then
@@ -7202,7 +7217,7 @@ if test yes != "$_lt_caught_CXX_error"; 
              # Commands to make compiler produce verbose output that lists
              # what "hidden" libraries, object files and flags are used when
              # linking a shared library.
-             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
 
            else
              # FIXME: insert proper C++ library support
@@ -7286,7 +7301,7 @@ if test yes != "$_lt_caught_CXX_error"; 
                # Commands to make compiler produce verbose output that lists
                # what "hidden" libraries, object files and flags are used when
                # linking a shared library.
-               output_verbose_link_cmd='$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v 
conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
              else
                # g++ 2.7 appears to require '-G' NOT '-shared' on this
                # platform.
@@ -7297,7 +7312,7 @@ if test yes != "$_lt_caught_CXX_error"; 
                # Commands to make compiler produce verbose output that lists
                # what "hidden" libraries, object files and flags are used when
                # linking a shared library.
-               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
              fi
 
              _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
Index: dist/libxcb/src/xcb_in.c
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/src/xcb_in.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 xcb_in.c
--- dist/libxcb/src/xcb_in.c    11 Sep 2018 19:34:56 -0000      1.12
+++ dist/libxcb/src/xcb_in.c    27 Sep 2018 19:16:38 -0000
@@ -958,8 +958,20 @@ void _xcb_in_replies_done(xcb_connection
         pend = container_of(c->in.pending_replies_tail, struct pending_reply, 
next);
         if(pend->workaround == WORKAROUND_EXTERNAL_SOCKET_OWNER)
         {
-            pend->last_request = c->out.request;
-            pend->workaround = WORKAROUND_NONE;
+            if (XCB_SEQUENCE_COMPARE(pend->first_request, <=, c->out.request)) 
{
+                pend->last_request = c->out.request;
+                pend->workaround = WORKAROUND_NONE;
+            } else {
+                /* The socket was taken, but no requests were actually sent
+                 * so just discard the pending_reply that was created.
+                 */
+                struct pending_reply **prev_next = &c->in.pending_replies;
+                while (*prev_next != pend)
+                    prev_next = &(*prev_next)->next;
+                *prev_next = NULL;
+                c->in.pending_replies_tail = prev_next;
+                free(pend);
+            }
         }
     }
 }
Index: dist/libxcb/src/xcb_out.c
===================================================================
RCS file: /cvs/OpenBSD/xenocara/dist/libxcb/src/xcb_out.c,v
retrieving revision 1.10
diff -u -p -u -r1.10 xcb_out.c
--- dist/libxcb/src/xcb_out.c   2 Sep 2016 10:09:43 -0000       1.10
+++ dist/libxcb/src/xcb_out.c   27 Sep 2018 19:16:38 -0000
@@ -387,8 +387,14 @@ int xcb_take_socket(xcb_connection_t *c,
     {
         c->out.return_socket = return_socket;
         c->out.socket_closure = closure;
-        if(flags)
-            _xcb_in_expect_reply(c, c->out.request, 
WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
+        if(flags) {
+            /* c->out.request + 1 will be the first request sent by the 
external
+             * socket owner. If the socket is returned before this request is 
sent
+             * it will be detected in _xcb_in_replies_done and this 
pending_reply
+             * will be discarded.
+             */
+            _xcb_in_expect_reply(c, c->out.request + 1, 
WORKAROUND_EXTERNAL_SOCKET_OWNER, flags);
+        }
         assert(c->out.request == c->out.request_written);
         *sent = c->out.request;
     }
Index: lib/libxcb/src/Makefile
===================================================================
RCS file: /cvs/OpenBSD/xenocara/lib/libxcb/src/Makefile,v
retrieving revision 1.10
diff -u -p -u -r1.10 Makefile
--- lib/libxcb/src/Makefile     11 Sep 2018 19:34:57 -0000      1.10
+++ lib/libxcb/src/Makefile     27 Sep 2018 19:17:51 -0000
@@ -6,7 +6,7 @@
 DATADIR=       ${X11BASE}/share
 PYTHON=                python${PYTHON_VERSION}
 
-MANOPTIONS=    -c 'libxcb 1.13' -l 'X Version 11' -s 3
+MANOPTIONS=    -c 'libxcb 1.13.1' -l 'X Version 11' -s 3
 
 SRCS= \
        bigreq.c \
Index: lib/libxcb/src/config.h
===================================================================
RCS file: /cvs/OpenBSD/xenocara/lib/libxcb/src/config.h,v
retrieving revision 1.6
diff -u -p -u -r1.6 config.h
--- lib/libxcb/src/config.h     11 Sep 2018 19:34:57 -0000      1.6
+++ lib/libxcb/src/config.h     27 Sep 2018 19:18:59 -0000
@@ -77,7 +77,7 @@
 #define PACKAGE_NAME "libxcb"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libxcb 1.13"
+#define PACKAGE_STRING "libxcb 1.13.1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "libxcb"
@@ -86,7 +86,7 @@
 #define PACKAGE_URL ""
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "1.13"
+#define PACKAGE_VERSION "1.13.1"
 
 /* Major version of this package */
 #define PACKAGE_VERSION_MAJOR 1
@@ -95,7 +95,7 @@
 #define PACKAGE_VERSION_MINOR 13
 
 /* Patch version of this package */
-#define PACKAGE_VERSION_PATCHLEVEL 0
+#define PACKAGE_VERSION_PATCHLEVEL 1
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1

-- 
Matthieu Herrb

Reply via email to