[Live-devel] RTSP server hang

Jeremy Noring jnoring at logitech.com
Fri Jun 4 10:28:26 PDT 2010


Under load, I'm noticing our RTSP server occasionally hangs in this
location:

static int blockUntilReadable(UsageEnvironment& env,
                  int socket, struct timeval* timeout) {
  int result = -1;
  do {
    fd_set rd_set;
    FD_ZERO(&rd_set);
    if (socket < 0) break;
    FD_SET((unsigned) socket, &rd_set);
    const unsigned numFds = socket+1;

    result = select(numFds, &rd_set, NULL, NULL, timeout);  <--HANG

I added some logging and found that the select() timeout is NULL, which is
infinite.  I would expect this to unblock when data arrived on the socket,
but no amount of connection attempts seems to wake it up--it stays there,
blocking the Live555 thread from servicing any new clients.  Also, what code
would be calling this with a NULL timeout?

The other thing I notice is our netstat output:

# netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:5222            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5800            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5000            0.0.0.0:*               LISTEN
tcp        0      0 0.0.0.0:5802            0.0.0.0:*               LISTEN
tcp       21      0 0.0.0.0:554             0.0.0.0:*               LISTEN

When it's in a failed state, I always see 21 on the Recv-Q, which is "The
count of bytes not copied by the user program connected to this socket."
We're using Linux (2.6.18, so a bit old).

Does anyone know why this may be, or have any suggestions for fixing it?
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20100604/46c50c5a/attachment.html>


More information about the live-devel mailing list