]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: ev_select: disable the select() poller if maxsock > FD_SETSIZE
authorWilly Tarreau <w@1wt.eu>
Sun, 31 Mar 2013 12:41:15 +0000 (14:41 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 31 Mar 2013 13:01:05 +0000 (15:01 +0200)
commit3fa87b1db95bc4d6640999462bdae620bff147c6
treecd43c74a186ecff5b01be940039795213d30f7bb
parent80da05a4cfb881663dc1f38a94d613f37e54552a
BUG/MAJOR: ev_select: disable the select() poller if maxsock > FD_SETSIZE

Some recent glibc updates have added controls on FD_SET/FD_CLR/FD_ISSET
that crash the program if it tries to use a file descriptor larger than
FD_SETSIZE.

For this reason, we now control the compatibility between global.maxsock
and FD_SETSIZE, and refuse to use select() if there too many FDs are
expected to be used. Note that on Solaris, FD_SETSIZE is already forced
to 65536, and that FreeBSD and OpenBSD allow it to be redefined, though
this is not needed thanks to kqueue which is much more efficient.

In practice, since poll() is enabled on all targets, it should not cause
any problem, unless it is explicitly disabled.

This change must be backported to 1.4 because the crashes caused by glibc
have already been reported on this version.
src/ev_select.c
src/haproxy.c