Bug 20335

Summary: select() crashes with large file descriptors
Product: XCB Reporter: Michael Ost <most>
Component: LibraryAssignee: xcb mailing list dummy <xcb>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: 1.1   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: libxcb-1.1-use-poll.patch
libxcb-spec.patch

Description Michael Ost 2009-02-26 12:16:39 UTC
If you call _xcb_conn_wait or read_block in an application that has more than FD_SETSIZE files already open, the select() calls they make will corrupt that stack and crash the app.

This is the old poll() vs select() bug. Replacing select() with poll() fixes it.
Comment 1 Michael Ost 2009-02-26 12:18:53 UTC
Created attachment 23332 [details] [review]
libxcb-1.1-use-poll.patch

This patch replaces select() with poll() if USE_POLL is set by configure. It was built against the libxcb-1.1-1.1.fc8 that came with Fedora 8. It fixes the crash I was seeing.
Comment 2 Michael Ost 2009-02-26 12:20:09 UTC
Created attachment 23333 [details] [review]
libxcb-spec.patch

This patches the Fedora 8 spec file to include attachment #23332 [details] [review] in libraries. It was built against the spec file for 1.1-1.1.fc8.
Comment 3 Julien Danjou 2009-04-06 01:48:09 UTC
commit f916062edf0e04cd4e0a78f6975892f59fae3b60
Author: Michael Ost <most@museresearch.com>
Date:   Mon Mar 30 11:09:32 2009 +0200

    use poll() instead of select() when available
    
    Signed-off-by: Julien Danjou <julien@danjou.info>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.