Applications that use libxcb 1.1 cannot open more than 1024 files
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ia32-libs (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Hardy |
Won't Fix
|
Undecided
|
Unassigned | ||
libxcb (Ubuntu) |
Fix Released
|
Undecided
|
Timo Aaltonen | ||
Hardy |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
Hi,
We have some internal 32-bit applications that end up with a lot of files open. If they in turn call a program that links with libxcb, more often than not, that program segfaults.
This has been determined to be because libxcb uses select() and the man page for select() says this:
"An fd_set is a fixed size buffer. Executing FD_CLR() or FD_SET() with a value of fd that is negative or is equal to or larger than FD_SETSIZE will result in undefined behavior. Moreover, POSIX requires fd to be a valid file descriptor."
Later versions of libxcb address this by using poll()
I'm attaching the patch that we are using internally against libxcb 1.1-1.1
If you make this SRU, please also ensure that the 32-bit version in ia32-libs gets updated.
Assigning to Timo as discussed via email