[Live-devel] Segmentation fault in FramedSource::getNextFrame

Brilliantov Kirill Vladimirovich brilliantov at byterg.ru
Wed Feb 12 04:09:25 PST 2014


Hello!
I use live555 2014.01.29.
For run on-demand RTSP-server I write OnDemandServerMediaSubsession
subclass with implements createNewStreamSource, return
H264VideoStreamDiscreteFramer, and createNewRTPSink, return
H264VideoRTPSink.
Unfortunally programm exit with "Segmentation fault" after PLAY command.

OpenRTSP log:
..........
Received 216 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Date: Thu, Jan 01 1970 01:18:14 GMT
Transport:
RTP/AVP;unicast;destination=192.168.255.1;source=192.168.255.2;client_port=37662-37663;server_port=6970-6971
Session: B671D2F8;timeout=65

Setup "video/H264" subsession (client ports 37662-37663)
Created output file: "video-H264-1"
Sending request: PLAY rtsp://192.168.255.2/0/ RTSP/1.0
CSeq: 5
User-Agent: openRTSP (LIVE555 Streaming Media v2012.05.17)
Session: B671D2F8
Range: npt=0.000-

GDB output:
Breakpoint 1, FramedSource::getNextFrame (this=0x54ba4b70,
    to=0x2be8d21c "tW\256ThK\272ThK\272Th\352", maxSize=1421257168,
    afterGettingFunc=0x54b91738, afterGettingClientData=0x54bbe940,
    onCloseFunc=0x54ae5774 <FramedSource::handleClosure(void*)>,
    onCloseClientData=0x54bbe940) at FramedSource.cpp:64
64      in FramedSource.cpp
(gdb) s
61      in FramedSource.cpp
(gdb)
63      in FramedSource.cpp
(gdb)
64      in FramedSource.cpp
(gdb) print fIsCurrentlyAwaitingData
$1 = 128 '\200'
(gdb) s
Medium::envir (this=0x54b9a638)
    at
/home/kirill/Projects/MobileCam/src/live/liveMedia/include/Media.hh:59
59
/home/kirill/Projects/MobileCam/src/live/liveMedia/include/Media.hh: No
such file or directory.
(gdb)

Program received signal SIGSEGV, Segmentation fault.
0x54ae55ac in FramedSource::getNextFrame (this=0x54b9a638, to=0x54f5bef1
"",
    maxSize=60000,
    afterGettingFunc=0x54b32194
<H264or5VideoStreamDiscreteFramer::afterGettingFrame(void*, unsigned
int, unsigned int, timeval, unsigned int)>,
    afterGettingClientData=0x54bbe940,
    onCloseFunc=0x54ae5774 <FramedSource::handleClosure(void*)>,
    onCloseClientData=0x54bbe940) at FramedSource.cpp:64
64      FramedSource.cpp: No such file or directory.
(gdb) bt
#0  0x54ae55ac in FramedSource::getNextFrame (this=0x54b9a638,
    to=0x54f5bef1 "", maxSize=60000,
    afterGettingFunc=0x54b32194
<H264or5VideoStreamDiscreteFramer::afterGettingFrame(void*, unsigned
int, unsigned int, timeval, unsigned int)>,
    afterGettingClientData=0x54bbe940,
    onCloseFunc=0x54ae5774 <FramedSource::handleClosure(void*)>,
    onCloseClientData=0x54bbe940) at FramedSource.cpp:64
#1  0x54b3217c in H264or5VideoStreamDiscreteFramer::doGetNextFrame (
    this=0x54bbe940) at H264or5VideoStreamDiscreteFramer.cpp:40
#2  0x54ae56c8 in FramedSource::getNextFrame (this=0x54bbe940,
    to=0x54f5bef1 "", maxSize=60000,
    afterGettingFunc=0x54b46108
<H264or5Fragmenter::afterGettingFrame(void*, unsigned int, unsigned int,
timeval, unsigned int)>,
    afterGettingClientData=0x54ba4b68,
    onCloseFunc=0x54ae5774 <FramedSource::handleClosure(void*)>,
    onCloseClientData=0x54ba4b68) at FramedSource.cpp:78
#3  0x54b45bf8 in H264or5Fragmenter::doGetNextFrame (this=0x54ba4b68)
    at H264or5VideoRTPSink.cpp:180
#4  0x54ae56c8 in FramedSource::getNextFrame (this=0x54ba4b68,
    to=0x54bac1f4 "\340\301\272T
\304\362z\352\346UK\306SzG\037\262\364A\277Q\304\202
`\272n\036h\301\360\206t\243p\030\230\212\023\204\352I;\370\233\b\254\016v\241\223\206\f\016\254D%\204\316\065%\220\262\230\205\v\344\231J\360\b\226\r#\343)\320\201\277\230\020\rs\tX\215F\363\240\266\210\032,\\]\336E\bH\332H\366\236?\025\243U\230\353n;\027\027\204\247\004\001W\221\310\270\213L\247\261e\210\362\310\351\006\206\207oN9\227v\220\261\021r\021>ic\232x\231F\034\354\224",

    maxSize=60804,
    afterGettingFunc=0x54af6f3c
<MultiFramedRTPSink::afterGettingFrame(void*, unsigned int, unsigned
int, timeval, unsigned int)>,
    afterGettingClientData=0x54e3cae8,
    onCloseFunc=0x54af7ae0 <MultiFramedRTPSink::ourHandleClosure(void*)>,
    onCloseClientData=0x54e3cae8) at FramedSource.cpp:78
#5  0x54af6f1c in MultiFramedRTPSink::packFrame (this=0x54e3cae8)
    at MultiFramedRTPSink.cpp:216
#6  0x54af6d5c in MultiFramedRTPSink::buildAndSendPacket (this=0x54e3cae8,
    isFirstPacket=1 '\001') at MultiFramedRTPSink.cpp:191
#7  0x54af6ba4 in MultiFramedRTPSink::continuePlaying (this=0x54e3cae8)
    at MultiFramedRTPSink.cpp:152
#8  0x54b455e4 in H264or5VideoRTPSink::continuePlaying (this=0x54e3cae8)
    at H264or5VideoRTPSink.cpp:125
#9  0x54aeb170 in MediaSink::startPlaying (this=0x54e3cae8, source=...,
    afterFunc=0x54b2321c <afterPlayingStreamState(void*)>,
    afterClientData=0x54e3ccf0) at MediaSink.cpp:78
#10 0x54b238f0 in StreamState::startPlaying (this=0x54e3ccf0,
    dests=0x54e3cd30, rtcpRRHandler=
    0x54b081e0
<RTSPServer::RTSPClientSession::noteClientLiveness(RTSPServer::RTSPClientSession*)>,
rtcpRRHandlerClientData=0x54bbeab8,
    serverRequestAlternativeByteHandler=0x54b029f8
<RTSPServer::RTSPClientConnection::handleAlternativeRequestByte(void*,
unsigned char)>,
    serverRequestAlternativeByteHandlerClientData=0x54ef6690)
    at OnDemandServerMediaSubsession.cpp:491
#11 0x54b22648 in OnDemandServerMediaSubsession::startStream (
    this=0x54ba43c0, clientSessionId=3786496502, streamToken=0x54e3ccf0,
    rtcpRRHandler=0x54b081e0
<RTSPServer::RTSPClientSession::noteClientLiveness(RTSPServer::RTSPClientSession*)>,
rtcpRRHandlerClientData=0x54bbeab8,
    rtpSeqNum=@0x2be8d42e: 0, rtpTimestamp=@0x2be8d428: 0,
    serverRequestAlternativeByteHandler=0x54b029f8
<RTSPServer::RTSPClientConnection::handleAlternativeRequestByte(void*,
unsigned char)>,
    serverRequestAlternativeByteHandlerClientData=0x54ef6690)
    at OnDemandServerMediaSubsession.cpp:203
#12 0x54b07bb4 in RTSPServer::RTSPClientSession::handleCmd_PLAY (
    this=0x54bbeab8, ourClientConnection=0x54ef6690, subsession=0x0,
    fullRequestStr=0x54ef66b4 "PLAY rtsp://192.168.255.2/0/
RTSP/1.0\r\nCSeq: 5\r\nUser-Agent: openRTSP (LIVE555 Streaming Media
v2012.05.17)\r\nSession: E1B159F6\r\nRange: npt=0.000-\r\n\r\n") at
RTSPServer.cpp:1984
#13 0x54b06bd8 in RTSPServer::RTSPClientSession::handleCmd_withinSession (
    this=0x54bbeab8, ourClientConnection=0x54ef6690,
    cmdName=0x2be8d9e8 "PLAY", urlPreSuffix=0x2be8d920 "0",
    urlSuffix=0x2be8d858 "",
    fullRequestStr=0x54ef66b4 "PLAY rtsp://192.168.255.2/0/
RTSP/1.0\r\nCSeq: 5\r\nUser-Agent: openRTSP (LIVE555 Streaming Media
v2012.05.17)\r\nSession: E1B159F6\r\nRange: npt=0.000-\r\n\r\n") at
RTSPServer.cpp:1785
#14 0x54b038e4 in RTSPServer::RTSPClientConnection::handleRequestBytes (
    this=0x54ef6690, newBytesRead=148) at RTSPServer.cpp:1014
#15 0x54b029e4 in
RTSPServer::RTSPClientConnection::incomingRequestHandler1 (
    this=0x54ef6690) at RTSPServer.cpp:787
#16 0x54b02970 in RTSPServer::RTSPClientConnection::incomingRequestHandler (
    instance=0x54ef6690) at RTSPServer.cpp:780
---Type <return> to continue, or q <return> to quit---
#17 0x54b64e58 in BasicTaskScheduler::SingleStep (this=0x54b9a370,
    maxDelayTime=0) at BasicTaskScheduler.cpp:163
#18 0x54b68f44 in BasicTaskScheduler0::doEventLoop (this=0x54b9a370,
    watchVariable=0x54b96cfb <stream_stop> "") at BasicTaskScheduler0.cpp:80
#19 0x54ad9eac in stream_thread (arg=0x7ef91ccc) at
src/stream_thread.cpp:118
#20 0x2ae7580c in ?? () from /lib/libpthread.so.0

How can I solve this problem?
Thank you and excuse me for my bad english.

-- 
Best regards,
Brilliantov Kirill Vladimirovich



More information about the live-devel mailing list