On Mon, 2017-08-28 at 18:27 +0300, Alexander Kanavin wrote: > On 08/28/2017 06:14 PM, Alexander Kanavin wrote: > > > > On 08/28/2017 05:43 PM, Richard Purdie wrote: > > > > > > > > The bitfield operation that says "can I read this fd?" probably > > > overflows into the next data item in the structure (I haven't > > > checked > > > exactly how it fails). It may be "set", certainly the case I > > > debugged > > > had to have thought it was and the code thinks "fd 1025 is ready > > > for > > > reading" when in fact it may not be. The code then calls read() > > > on it > > > and if it wasn't ready for reading, it would block. > > Right; what I am getting at is that we might have a bug hereĀ > > (specifically the absence of check against FD_SETSIZE), rather > > thanĀ > > something that needs to be solved by switching to poll(). > > > > Does the code use that constant anywhere? > > > Actually, wait: "Executing FD_CLR() or FD_SET() with a value of fd > that is negative or is equal to or larger than FD_SETSIZE will result > in undefined behavior." (man select) > > This means that select() cannot be used with fd >= FD_SETSIZE at all?
Correct. The code has no guards on this happening. Cheers, Richard -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core