[Live-devel] Issue in ProxyServerMediaSession

Subhankar Saha Subhankar_Saha at mindtree.com
Fri Aug 30 12:38:21 PDT 2013


In any case, I don't have time to speculate back and forth on this mailing list (for free) about this problem.  Right now, because you're the only person encountering this, you're going to have to track it down yourself.  Sorry.

Here is what I found:

#1. When the backend server goes away unceremoniously, the 'readSocket()' in 'SocketDescriptor::tcpReadHandler1()' will set 'fDeleteMyselfNext' - this causes 'SocketDescriptor::tcpReadHandler()' to delete the 'socketDescriptor'. Note that 'fAreInReadHandlerLoop' reset back to False before deleting the 'socketDescriptor'

#2. 'SocketDescriptor::~SocketDescriptor()' then invokes RTSPClient's 'fServerRequestAlternativeByteHandler' with 0xFF (ReadErrorOccured)
#3. For ProxyServerMediaSession, this results in negative return for OPTIONS command sent during Liveness.

#4. 'continueAfterLivenessCommand' gets invoked, and thereby everything is being reset.

#5. As part of those reset handling RTCPInstances gets closed - which results in deregistering from RTPInterface.

#6. 'SocketDescriptor::deregisterRTPInterface' will then remove the reference of the SocketDescriptor from 'fSubChannelHasTable' - and once this is empty,  and since 'fAreInReadHandlerLoop' is False (refer #1 above), this will go on to delete 'socketDescriptor' yet again. This deletion is successfully completed - resulting in successful 'removeSocketDescription()'.

#7. After all clean-up, the 'fServerRequestAlternativeByteHandler' (from #2 above) finally returns back to the SocketDescriptor destructor, and it crashes in next call to 'removeSocketDescription'. SocketDescriptor is no longer a valid object at this point - it is already been deleted in #6.

Any of the following seems to work for my use case:

-          Moving invocation of 'fServerRequestAlternativeByteHandler' to bottom of 'SocketDescriptor::~SocketDescriptor()'

-          Moving 'socketDescriptor->fAreInReadHandlerLoop = False;' to bottom of 'SocketDescriptor::tcpReadHandler()'

Many thanks,
Subhankar.


________________________________

http://www.mindtree.com/email/disclaimer.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130830/763895dd/attachment.html>


More information about the live-devel mailing list