[Xcb] Win32 port bug fix

Jeetu Golani jeetu.golani at gmail.com
Sun Dec 12 12:15:16 PST 2010


Hi,

Vincent, I could reproduce the bug you were seeing - when you build the test 
code for Win32 mentioned in my documentation with the xcb dll generated 
with the current master, the program crashes with a segmentation fault.

The problem for this is two fold:

a) the test code isn't doing any error handling therefore even though 
xcb_connect fails it goes ahead and passes the connection pointer to a 
downstream function such as xcb_get_setup and this causes the 
segmentation fault.

b) xcb_connect fails because there has been a change within the 
xcb_connect_to_fd function with the following code: 

#ifndef USE_POLL
    if(fd >= FD_SETSIZE) /* would overflow in FD_SET */
    {
        close(fd);
        return (xcb_connection_t *) &error_connection;
    }
#endif

for win32 this code gets executed and an error is generated.

For now, the attached patch circumvents this code block for the Win32 
platform. 

Please let me know if someone feels there is a better approach to this 
problem. If not then would be great if this could be committed upstream.

Thanks,
Jeetu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-win32-xcb-conn-use-poll.patch
Type: text/x-patch
Size: 584 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20101213/df3e290a/attachment-0001.bin>


More information about the Xcb mailing list