[Live-devel] Stack Overflow in FD_SET()

Ross Finlayson finlayson at live555.com
Tue Aug 3 08:34:36 PDT 2021


Thank you for the report.

Unfortunately, I have not been able to reproduce the error that you saw, because your “command.rtsp” input (RTSP commands) will not work in reality, because the “Session:” headers in the “PLAY” and “TEARDOWN” commands are incorrect.  The “Session:” headers in “PLAY” and “TEARDOWN” commands need to contain the same ‘session id’ that was returned by the earlier “SETUP” command, otherwise  the server will return a
	RTSP/1.0 454 Session Not Found

I.e., running
	nc -n 8554 < command.rtsp
will not work.  (You can try this yourself.)

I am also puzzled by your description of the error as a ‘stack overflow’,  because the server should handle concurrent requests - even requests for the same file - as separate, sequential events within the event loop (“BasicTaskScheduler”, in this case).  So I don’t see where any excessive recursion (causing a stack overflow) could be happening.  It is true that operating systems place limits on the number of open files, and that this may cause the server to stop responding after receiving a large number of concurrent requests - but this should not be causing a stack overflow.

Ross Finlayson
Live Networks, Inc.

More information about the live-devel mailing list