Bug 134794 - curl issues with select vs FD_SETSIZE
Summary: curl issues with select vs FD_SETSIZE
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: curl
Version: 3.0
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Jindrich Novy
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 201599
TreeView+ depends on / blocked
 
Reported: 2004-10-06 12:58 UTC by Joe Orton
Modified: 2013-07-02 23:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-12-16 18:40:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Joe Orton 2004-10-06 12:58:45 UTC
Description of problem:
curl does not work if file descriptor numbers are pushed above
FD_SETSIZE.  This happens, for example, in Apache configurations where
a large number of log files are configured, typical of large-scale
virtual hosting scenarios.

Version-Release number of selected component (if applicable):
curl-7.10.6-4.1 (or any version)

How reproducible:
Always

Steps to Reproduce:
The "bumpfd" program just bumps the rlimits and opens N files to
reproduce the issue:

0. become root
1. curl http://cvs.apache.org/~jorton/bumpfd.c > bumpfd.c
2. gcc -o bumpfd bumpfd.c
3. ./bumpfd 2048 curl http://www.apache.org/

Actual results:
Segmentation fault

Expected results:
Web page

Additional info:
This bug appears to be known to upstream but not being actively worked
on, and is a deep issue since fd_set * is exposed in the curl API.

Comment 1 Daniel Stenberg 2004-10-10 11:15:40 UTC
Known: yes

Worked on: no

Known portable fix: no

Appreciate patch: yes


Comment 2 Joe Orton 2004-10-10 17:15:05 UTC
The "portable fix" is to use poll() where available and select() where
not.

Comment 3 Daniel Stenberg 2004-11-11 14:36:26 UTC
1. What about those systems without poll()?

2. libcurl has APIs that provide fd_set data, those are not easily
fixed with simply switching to poll.


Comment 4 Joe Orton 2004-11-11 14:56:07 UTC
Yes, as I mentioned fixing this really requires changing the curl API
to not expose the fd_set pointers directly, maybe doing so only
through some abstract type. e.g.

curl_multi_fdsets(CURLM *mh, int *read_fds, *write_fds, *except_fds)

where each int * array is a list of fd numbers terminated by a "-1",
that is easy enough for the caller to translate into a struct pollfd
array or an fd_set as desired.

Or alternatively curl could expose the existing curl_multi_fdset as-is
IFF compiled to use select() i.e. on Windows, and it could expose a
struct poll * through a new curl_multi_pollfds() function IFF compiled
to use poll().

Comment 7 Daniel Stenberg 2004-11-20 09:45:05 UTC
This issue is now fixed in the curl CVS, to be included in the
upcoming 7.12.3 release.


Comment 8 Joe Orton 2004-12-13 14:26:07 UTC
Great news, Daniel!

Comment 12 RHEL Program Management 2006-12-16 18:40:36 UTC
Product Management has reviewed and declined this request.  You may appeal this
decision by reopening this request. 


Note You need to log in before you can comment on or make changes to this bug.