You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In platform/emulator/os.cc, the nfds argument to select() is completely wrong - the code erroneously uses the open-files
limit, sysconf(_SC_OPEN_MAX). If that ulimit is set beyond what an fd_set can handle (1024, usually), then disastrous
things will happen very quickly (select() will find bogus bits beyond the fd sets which do not correspond to any open
descriptors and return an error).
In fact, all uses of openMax or osOpenMax() are incorrect and should use FD_SETSIZE instead, because that is how many
descriptors go in an fd_set. This includes the error message that enumerates the descriptors when select() fails.
The attached patch, made against mozart 1.4.0, cures this. Please apply.
The text was updated successfully, but these errors were encountered:
Sorry, I should have looked at trunk before filing a bug. It
does indeed look all right in this respect. It still lacks a
range check for indexing into an fd_set, so programs using a
lot of descriptors are likely to corrupt memory, but that is
a separate problem (and nothing I'm concerned with, anyway).
Thanks - this bug can be closed then.
Date: 2009-08-26 19:53
Sender: Raphael Collet
The patch does not match the revision of os.cc on the development
trunk. I Asked Matthias to check the trunk.
In platform/emulator/os.cc, the nfds argument to select() is completely wrong - the code erroneously uses the open-files
limit, sysconf(_SC_OPEN_MAX). If that ulimit is set beyond what an fd_set can handle (1024, usually), then disastrous
things will happen very quickly (select() will find bogus bits beyond the fd sets which do not correspond to any open
descriptors and return an error).
In fact, all uses of openMax or osOpenMax() are incorrect and should use FD_SETSIZE instead, because that is how many
descriptors go in an fd_set. This includes the error message that enumerates the descriptors when select() fails.
The attached patch, made against mozart 1.4.0, cures this. Please apply.
The text was updated successfully, but these errors were encountered: