1. 26 Mar, 2017 1 commit
    • Arthur Huillet's avatar
      _XDefaultError: set XlibDisplayIOError flag before calling exit · 00405b27
      Arthur Huillet authored
      _XReply isn't reentrant, and it can lead to deadlocks when the default error
      handler is called: _XDefaultError calls exit(1). It is called indirectly by
      _XReply when a X protocol error comes in that isn't filtered/handled by an
      extension or the application. This means that if the application (or one of its
      loaded shared libraries such as the NVIDIA OpenGL driver) has registered any
      _fini destructor, _fini will get called while still on the call stack of
      _XReply. If the destructor interacts with the X server and calls _XReply, it
      will hit a deadlock, looping on the following in _XReply:
      
          ConditionWait(dpy, dpy->xcb->reply_notify);
      
      It is legal for an application to make Xlib calls during _fini, and that is
      useful for an OpenGL driver to avoid resource leaks on the X server side, for
      example in the dlopen/dlclose case. However, the driver can not readily tell
      whether its _fini is being called because Xlib called exit, or for another
      reason (dlclose), so it is hard to cleanly work around this issue in the driver.
      
      This change makes it so _XReply effectively becomes a no-op when called after
      _XDefaultError was called, as though an XIOError had happened. The dpy
      connection isn't broken at that point, but any call to _XReply is going to hang.
      This is a bit of a kludge, because the more correct solution would be to make
      _XReply reentrant, maybe by broadcasting the reply_notify condition before
      calling the default error handler. However, such a change would carry a grater
      risk of introducing regressions in Xlib.
      
      This change will drop some valid requests on the floor, but this should not
      matter, as it will only do so in the case where the application is dying: X will
      clean up after it once exit() is done running. There is the case of
      XSetCloseDownMode(RETAIN_PERMANENT), but an application using that and wishing
      to clean up resources in _fini would currently be hitting a deadlock, which is
      hardly a better situation.
      Signed-off-by: 's avatarAaron Plattner <aplattner@nvidia.com>
      Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net>
      00405b27
  2. 01 Mar, 2017 4 commits
  3. 08 Feb, 2017 4 commits
  4. 20 Oct, 2016 2 commits
    • walter harms's avatar
      Fixes: warning: variable 'req' set but not,used · ddc5ed4c
      walter harms authored
      Fixes: warning: variable 'req' set but not used [-Wunused-but-set-variable]
             by marking req _X_UNUSED
      	Solution was discussed on xorg-devel ML
             Peter Hutter, Alan Coopersmith
              Re: [PATCH libX11 3/5] fix: warning: pointer targets in passing argument 2 of '_XSend' differ in signedness [-Wpointer-sign]
      
      Signed-off-by: harms wharms@bfs.de
      ddc5ed4c
    • Ulrich Sibiller's avatar
      Fix warnings in XlibInt.c · 2c59fbe3
      Ulrich Sibiller authored
      XlibInt.c: In function ‘_XIOError’:
      XlibInt.c:3750:1: warning: ‘noreturn’ function does return [enabled by default]
       }
      
      After fixing the above a new warning came up, which is also fixed now:
      
      XlibInt.c: In function ‘_XIOError’:
      XlibInt.c:3750:1: warning: control reaches end of non-void function [-Wreturn-type]
       }
      2c59fbe3
  5. 19 Oct, 2016 12 commits
  6. 10 Oct, 2016 3 commits
  7. 09 Oct, 2016 1 commit
  8. 05 Jul, 2016 2 commits
  9. 29 Jun, 2016 2 commits
  10. 12 Jun, 2016 1 commit
  11. 28 Dec, 2015 1 commit
    • Mike Gabriel's avatar
      Clear header file namespace separation (<X11/...> vs. <nx-X11/...>). · 433d8186
      Mike Gabriel authored
       In the process of building nxagent against more and more system-wide installed
       X.org libraries, we come to the limit of including structs from this (bundled
       nx-X11) and that (system-wide X.Org) library.
      
       This commit introduces a clear namespace separation of headers provided by
       nx-X11 and headers provided by X.Org. This approach is only temporary as we
       want to drop all nx-X11 bundled libraries from nx-libs.
      
       However, for a while we need to make this separation clear and also ship
       some reduced fake X.Org headers that avoid pulling in libX* and libNX_X*
       symbols at the same time.
      
       This patch has been tested on Debian jessie and unstable and requires no
       overall testing on various distros and distro versions, as we finally will
       drop all libNX_X* libraries and build against X.org's client libs.
      
       For now, this hack eases our development / cleanup process.
      433d8186
  12. 16 Apr, 2015 1 commit
  13. 10 Oct, 2011 6 commits