RTSPServer crash with simultaneous identical requests
we've been using the RTSPServer to stream both live and stored video.
Because of our client's specific needs, particularly when asking for stored videos,
sometimes we get identical requests from 2 clients simultaneously (i.e. a few
milliseconds apart) and, whenever that happens, the server crashes.
Because we've extended the RTSPServer (as in the DynamicRTSPServer of the Media Server
app) to parse the clients' requests, we went back to test some basic things to make sure
that the error was not introduced by our enhancements.
So we ran testOnDemandRTSPServer with some of the videos you supply for tests and
created a simple shell script with the following lines for the clients:
./openRTSP -F "0-" rtsp://127.0.0.1:8554/h264ESVideoTest > openRTSP-0.log 2>&1 &
./openRTSP -F "1-" rtsp://127.0.0.1:8554/h264ESVideoTest > openRTSP-1.log 2>&1 &
This should launch (almost simultaneously) two instances of openRTSP that ask for the
same video segment from the server. And we got similar results to our app.
Either the server crashes with a segfault or it delivers the video correctly to one of
the clients but it delivers a SDP description containing errors to the 2nd (or so
openRTSP complains). From that point on every new request from a client receives a
corrupted SDP description.
Below is the stack trace from one of the server crashes:
gdb ./testOnDemandRTSPServer core
Core was generated by `./testOnDemandRTSPServer'.
Program terminated with signal 11, Segmentation fault.
#0 0xb73bc000 in ?? ()
#0 0xb73bc000 in ?? ()
#1 0x08069969 in MultiFramedRTPSink::ourHandleClosure (clientData=0x89124d8) at
#2 0x0804f9a8 in H264VideoFileServerMediaSubsession::checkForAuxSDPLine1 (this=0x8905bf8)
#3 0x0804f9f9 in checkForAuxSDPLine (clientData=0x8905bf8) at
#4 0x08077f5f in AlarmHandler::handleTimeout (this=0x8912780) at BasicTaskScheduler0.cpp:34
#5 0x08076a72 in DelayQueue::handleAlarm (this=0x32482036) at DelayQueue.cpp:180
#6 0x080760e5 in BasicTaskScheduler::SingleStep (this=0x8905008, maxDelayTime=0) at
#7 0x08077617 in BasicTaskScheduler0::doEventLoop (this=0x8905008, watchVariable=0x0)
#8 0x0804a011 in main (argc=<value optimized out>, argv=<value optimized out>) at
And here is the part of the log from one of the openRTSP clients:
Opened URL "rtsp://127.0.0.1:8554/h264ESVideoTest", returning a SDP description:
o=- 1304352757340991 1 IN IP4 10.10.9.211^M
s=Session streamed by "testOnDemandRTSPServer"^M
a=tool:LIVE555 Streaming Media v2011.03.14^M
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"^M
m=video 0 RTP/AVP 96^M
c=IN IP4 0.0.0.0^M
Failed to create a MediaSession object from the SDP description: Invalid SDP line:
I'd like to point out that we're using the latest version of live555 and that, for these
tests, not a single line of code as been touched.
We would like to know if this is a bug that will get fixed in the future or, simply,
something that is not allowed.
Any help would be appreciated
Living Data - Sistemas de Informação e Apoio à Decisão, Lda.
Rua Luís de Camões, Nº 133, 1º B Phone: +351 213622163
1300-357 LISBOA Fax: +351 213622165
Portugal URL: www.livingdata.pt