[FFmpeg-devel] libossupport status

Dave Dodge dododge
Sun Dec 23 21:11:12 CET 2007


On Sun, Dec 23, 2007 at 02:50:55PM +0100, Luca Abeni wrote:
> BTW, where can I find more info about the Linux bug you are citing? I've
> never heared anything about it (and I often use select() in my
> programs)... Is it limited to some particular kernel/libc versions?

The best-known bug is that if you're using a UDP socket and a packet
arrives with a bad checksum, select() will report the socket is
readable but recvfrom() can still block.  This is because the checksum
is verified during the recvfrom; the packet gets discarded mid-stack
and suddenly the socket is empty even though select claimed there was
data waiting.

This particular UDP case might have been fixed in the past few years
but I think it wasn't the only way select can end up reporting that
I/O is possible even when it isn't.  The basic rule of thumb on Linux
is that if you don't want an I/O operation to block you really need to
put the descriptor into non-blocking mode while doing the operation.
You can't rely on select to guarantee that the operation will not
block.

                                                  -Dave Dodge




More information about the ffmpeg-devel mailing list