buildFdSets: file descriptor out of range

Brandon S. Allbery KF8NH allbery at
Wed Jul 15 00:16:21 EDT 2009

On Jul 14, 2009, at 21:48 , Kazu Yamamoto (山本和彦) wrote:
> running well at the beginning. But after several hours, it receives an
> error, "buildFdSets: file descriptor out of range".

I believe the runtime uses select(), which has a hard limit (enforced  
by the kernel) that the maximum file descriptor id be 1023.  (select()  
uses bitmasks and there is a limit on the size of a bitmask; see  

> - pushes the limit of file descriptors to 65536 with setResourceLimit.

Reduce this to 1024, otherwise the runtime will eventually find itself  
dealing with file descriptors beyond the select() limit mentioned  
above.  Someone with more knowledge of the Haskell runtime will have  
to advise as to possible ways around it if you really need more than  
1024 file descriptors.

brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at
system administrator [openafs,heimdal,too many hats] allbery at
electrical and computer engineering, carnegie mellon university    KF8NH

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
Url :

More information about the Glasgow-haskell-users mailing list