64 bit bug in tclUnixNotfy.c
Closed488972ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2001-12-04 17:31:25
The code which builds up the fd_set's for select() isn't 64 bit safe. (long is 64 bits, and int is 32 bits) If you have a fd >= 32, the wrong bit gets set. I've attached a suggested patch.
guymaorplain2001-12-05 00:31:27
File Added - 14163: patch
andreas_kupriesplain2001-12-07 04:00:53
Logged In: YES user_id=75003 Donal, please check this against your 64bit branch if that truly fixes problems for 64 bit machines. Is "fd_mask" a type on which existence we can rely on ?
dkfplain2001-12-07 22:31:44
Logged In: YES user_id=79902 fd_mask is not reliably available on Solaris (i.e. in strict XPG4.2 mode it's not there.) Instead, we should be using an array of 'fd_set's, each of which is large enough on all (Solaris) platforms, and FD_SET, FD_CLEAR, FD_ISSET and FD_ZERO are macros that should be used to manipulate instances of fd_sets. fds_mask *is* always defined, BTW, but isn't necessarily as portable. None of this means anything for anywhere except Solaris (but the Linux box I have convenient access to doesn't provide fds_mask, and provides fd_mask, fd_set, and FD_* access macros.)
andreas_kupriesplain2001-12-12 01:02:42
Logged In: YES user_id=75003 May I ask the original submitter to submit a patch based on Donal's idea of using fd_set ?
Log in (anonymous is fine) to add a comment.
Attachments:
- patch [download] added by guymaor on 2001-12-05 00:31:26. [details]