Variables type inconsistency in libX11 library

Alin Popa alin.popa at wenglor.com
Mon Dec 9 22:35:02 PST 2013


Hi everyone,

I have a situation when my application crashes after several days of 
running. I've discovered that the bug is in libX11 library. I have a 32bit 
openSuse 12.2 system.
https://bugs.freedesktop.org/show_bug.cgi?id=71338 
http://lists.x.org/archives/xorg-devel/2013-November/039007.html 
After I've applied the patch from 
http://patchwork.freedesktop.org/patch/16297/  the application worked.

The function 
src/xcb_io.c: void _XSend(Display *dpy, const char *data, long size)
has some inconsistency which leads to crash, because of mixing of 
different variable types.

I've discovered that the variable declarations are not as it must be, 
because depending of the installed system 32/64 bit the "unsigned long" 
type will be 32 or 64 bit.
So "unsigned long" is not a good declaration for using a 64bit type (use 
uint64_t instead).

Some places with variable declarations:
-----
src/xcb_io.c: uint64_t requests (local in void _XSend(Display *dpy, const 
char *data, long size))
src/xcb_io.c: uint64_t sequence; (local in void _XSend(Display *dpy, const 
char *data, long size))
src/Xxcbint.h:  uint64_t last_flushed;
include/X11/Xlib.h: unsigned long request;
src/Xxcbint.h : unsigned long sequence;
-----

As a conclusion, you can harmonize variables type declarations that are 
overall the same.

Cu stima / Best regards

wenglor electronic SRL

Alin Popa, Dipl.-Ing.
Dezvoltare - Programator prelucrare imagini / Development - Image 
Processing

alin.popa at wenglor.com
Phone: +40 (0)269 2077-54
Fax: +40 (0)269 2077-88



www.wenglor.com 
wenglor electronic SRL
Strada Caprioarelor Nr. 2
550089 Sibiu
ROMANIA 
 
CUI: RO 25784779, RC: J32/619/2009
Capital social: 20.000 RON
Manager General: Herbert Oprea, Ioana Duma
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131210/68941c5b/attachment.html>


More information about the xorg-devel mailing list