[PATCH] 64-bit issues in libx11
Emilio Jesús Gallego Arias
egallego at babel.ls.fi.upm.es
Thu Feb 19 18:10:55 PST 2009
It seems xcb/x11 have some bugs related to sizeof(long), in concrete
using 32 bit variables for dpy->request et al in AMD64.
This patch fixes some crashes for me.
diff -ur libx11-22.214.171.124/src/xcb_io.c libx11-126.96.36.199-a/src/xcb_io.c
--- libx11-188.8.131.52/src/xcb_io.c 2008-11-04 20:52:54.000000000 +0100
+++ libx11-184.108.40.206-a/src/xcb_io.c 2009-02-20 02:58:02.000000000 +0100
@@ -214,7 +214,7 @@
else if(req && xcb_poll_for_reply(dpy->xcb->connection, req->sequence, &reply, &error))
- unsigned int sequence = req->sequence;
+ uint64_t sequence = req->sequence;
dpy->xcb->pending_requests = req->next;
@@ -300,7 +300,7 @@
* we need to remember to check later. */
if(dpy->xcb->event_owner != XlibOwnsEventQueue || dpy->async_handlers)
- unsigned int sequence;
+ uint64_t sequence;
for(sequence = dpy->xcb->last_flushed; sequence < dpy->request; ++sequence)
PendingRequest *req = malloc(sizeof(PendingRequest));
I've used uint64_t instead unsigned long as it seems preferred through the codebase.
Note that both req->sequence and dpy->request are defined as unsigned long.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 834 bytes
Desc: not available
More information about the xorg