Re: /bzr/squid3/trunk/ r10551: Restrict limited select() I/O loop below FD_SETSIZE.

From: Henrik Nordström <henrik_at_henriknordstrom.net>
Date: Sun, 13 Jun 2010 11:26:28 +0200

lör 2010-06-12 klockan 22:53 +1200 skrev Amos Jeffries:

> Henrik informs that loosp using fd_set() (select and win32-select) must
> be kept below FD_SETSIZE or they can hang Squid or cause out-of-bounds
> memory errors.
>
> NP: Squid-2 does not appear to limit select() like this. May need fixing too.

It does. See comm_select_init() which is implemented per select loop
type.

comm_select.c -> Not limited, instead it dynamically allocates storage
to match the fd limit based on some assumptions on how fd_set is built
with fd_mask, a design which is shared among all known UNIX:es.

comm_select_simple.c -> uses fd_set per POSIX specifications. limited to
FD_SETSIZE.

comm_select_win32.c -> limited to FD_SETSIZE

Regards
Henrik
Received on Sun Jun 13 2010 - 09:26:36 MDT

This archive was generated by hypermail 2.2.0 : Sun Jun 13 2010 - 12:00:05 MDT