[Live-devel] RTSPServer crash with simultaneous identical requests

Bruno Abreu bruno.abreu at livingdata.pt
Tue May 3 03:21:30 PDT 2011


Hello,

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:

#!/bin/sh
./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 ?? ()
(gdb) bt
#0  0xb73bc000 in ?? ()
#1  0x08069969 in MultiFramedRTPSink::ourHandleClosure (clientData=0x89124d8) at
MultiFramedRTPSink.cpp:413
#2  0x0804f9a8 in H264VideoFileServerMediaSubsession::checkForAuxSDPLine1 (this=0x8905bf8)
    at H264VideoFileServerMediaSubsession.cpp:61
#3  0x0804f9f9 in checkForAuxSDPLine (clientData=0x8905bf8) at
H264VideoFileServerMediaSubsession.cpp:57
#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
BasicTaskScheduler.cpp:189
#7  0x08077617 in BasicTaskScheduler0::doEventLoop (this=0x8905008, watchVariable=0x0)
at BasicTaskScheduler0.cpp:80
#8  0x0804a011 in main (argc=<value optimized out>, argv=<value optimized out>) at
testOnDemandRTSPServer.cpp:264

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:
v=0^M
o=- 1304352757340991 1 IN IP4 10.10.9.211^M
s=Session streamed by "testOnDemandRTSPServer"^M
i=h264ESVideoTest^M
t=0 0^M
a=tool:LIVE555 Streaming Media v2011.03.14^M
a=type:broadcast^M
a=control:*^M
a=range:npt=0-^M
a=x-qt-text-nam:Session streamed by "testOnDemandRTSPServer"^M
a=x-qt-text-inf:h264ESVideoTest^M
m=video 0 RTP/AVP 96^M
c=IN IP4 0.0.0.0^M
b=AS:500^M
a=rtpmap:96 H264/90000^M
øfË^H^XdË^HliveMedia33a=control:track1^M

Failed to create a MediaSession object from the SDP description: Invalid SDP line:
øfË^H^XdË^HliveMedia33a=control:track1^M


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
Thank you

Bruno Abreu

--
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



More information about the live-devel mailing list