[PATCH xserver 2/2] dix: Disable AttendClient() operation during client teardown

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 10 12:06:24 UTC 2016


commit e43abdce964f5ed9689cf908af8c305b39a5dd36
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Feb 3 09:54:46 2016 +0000

    dri2: Unblock Clients on Drawable release

added a call to AttendClient during drawable teardown, which also happens
as a result of client teardown. However, at that point the Client state
is no longer valid causing a possible explosion from AttendClient().

A simple workaround is to set the Client as ignored when tearing it
down, but we then also need to teach AttendClient not to dereference its
private pointer during teardown.

References: Jos van Wolput <wolput at onsneteindhoven.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94074
Testcase: dri2-race/client
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Ville Syrjälä <ville.syrjala at linux.intel.com>
Cc: Adam Jackson <ajax at nwnk.net>
---
 dix/dispatch.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 53032dc..bfb5e1a 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3414,6 +3414,9 @@ CloseDownClient(ClientPtr client)
     }
 
     if (really_close_down) {
+        /* The client is going away, disable any AttendClient during shutdown */
+        client->ignoreCount++;
+
         if (client->clientState == ClientStateRunning && nClients == 0)
             dispatchException |= dispatchExceptionAtReset;
 
-- 
2.7.0



More information about the xorg-devel mailing list