Bug 20335 - select() crashes with large file descriptors
Summary: select() crashes with large file descriptors
Status: RESOLVED FIXED
Alias: None
Product: XCB
Classification: Unclassified
Component: Library (show other bugs)
Version: 1.1
Hardware: Other All
: medium normal
Assignee: xcb mailing list dummy
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-26 12:16 UTC by Michael Ost
Modified: 2009-04-06 01:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
libxcb-1.1-use-poll.patch (3.55 KB, patch)
2009-02-26 12:18 UTC, Michael Ost
Details | Splinter Review
libxcb-spec.patch (1.14 KB, patch)
2009-02-26 12:20 UTC, Michael Ost
Details | Splinter Review

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.