Tim Peters wrote: > I _suspect_ that rev 42253 introduced these problems. For example, that added: > > + /* Guard against socket too large for select*/ > + if (s->sock_fd >= FD_SETSIZE) > + return SOCKET_INVALID; > > to _ssl.c, and added > > +/* Can we call select() with this socket without a buffer overrun? */ > +#define IS_SELECTABLE(s) ((s)->sock_fd < FD_SETSIZE) > > to socketmodule.c, but those appear to make no sense. FD_SETSIZE is > the maximum number of distinct fd's an fdset can hold, and the > numerical magnitude of any specific fd has nothing to do with that in > general (they may be related in fact on Unix systems that implement an > fdset as "a big bit vector" -- but Windows doesn't work that way, and > neither do all Unix systems, and nothing in socket specs requires an > implementation to work that way). Neal checked these changes in to address bug #876637 "Random stack corruption from socketmodule.c" But the Windows implementation of "select" is entirely different than other platforms, in so far as windows uses an internal counter to assign fds to an fd_set, so the fd number itself has no relevance to where they are placed in an fd_set. This stack corruption bug then does not exist on Windows, and so the code should not be used with Windows either. -- Scott Dial scott at scottdial.com dialsa at rose-hulman.edu
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4