[Live-devel] Segmentation fault on streaming server with several unicast clients

Bruno Filipe Basilio Bruno.Basilio at brisa.pt
Mon Sep 5 04:37:22 PDT 2016


> I have now installed a new version (2016.09.05) of the “LIVE555 Streaming Media” code that should, I believe, fix a problem (actually, one error and one warning) that showed up in this log.  I hope this helps!

>From my initial tests the Valgring error message seems to have been solved, I hope it solves the segmentation fault.
Ongoing tests are being made, I will get back to you as soon as I can take some definitive conclusions.


http://www.live555.com/liveMedia/public/changelog.txt
> 2016.09.05:
> - Updated "Socket::reset()" (in "groupsock/NetInterface.cpp") so that it doesn't try to call
  "closeSocket()" (=="close()") on socket numbers <0.

In my tests this changes didn't made the desired effect as you can see by the Valgrind warning in the output bellow.
But based on your changes and the warning stack-trace I've tested similar change in GenericMediaServer::ClientConnection::closeSockets() and the valgrind warning is no more.
See also the changes made bellow.


Valgring output

RTSPClientConnection[0x56e65c8]::handleRequestBytes() read -1 new bytes (of 20000); terminating connection!
==12608== Warning: invalid file descriptor -1 in syscall close()
==12608==    at 0x4094FAC: __close_nocancel (syscall-template.S:82)
==12608==    by 0x809D94A: GenericMediaServer::ClientConnection::closeSockets() (GenericMediaServer.cpp:232)
==12608==    by 0x809D9E9: GenericMediaServer::ClientConnection::~ClientConnection() (GenericMediaServer.cpp:226)
==12608==    by 0x80A242F: RTSPServer::RTSPClientConnection::~RTSPClientConnection() (RTSPServer.cpp:383)
==12608==    by 0x807D465: DynamicRTSPServer::RTSPClientConnection::~RTSPClientConnection() (DynamicRTSPServer.hh:76)
==12608==    by 0x80A1C42: RTSPServer::RTSPClientConnection::handleRequestBytes(int) (RTSPServer.cpp:1063)
==12608==    by 0x809D8DA: GenericMediaServer::ClientConnection::incomingRequestHandler() (GenericMediaServer.cpp:246)
==12608==    by 0x809D902: GenericMediaServer::ClientConnection::incomingRequestHandler(void*, int) (GenericMediaServer.cpp:239)
==12608==    by 0x80D80BC: BasicTaskScheduler::SingleStep(unsigned int) (BasicTaskScheduler.cpp:171)
==12608==    by 0x80D9668: BasicTaskScheduler0::doEventLoop(char volatile*) (BasicTaskScheduler0.cpp:80)
==12608==    by 0x80565CD: main (smartCodecServer.cpp:567)


diff a/live555/liveMedia/GenericMediaServer.cpp b/live555/liveMedia/GenericMediaServer.cpp
--- a/live555/liveMedia/GenericMediaServer.cpp
+++ b/live555/liveMedia/GenericMediaServer.cpp
@@ -229,7 +229,7 @@ GenericMediaServer::ClientConnection::~ClientConnection() {
 void GenericMediaServer::ClientConnection::closeSockets() {
   // Turn off background handling on our socket:
   envir().taskScheduler().disableBackgroundHandling(fOurSocket);
-  ::closeSocket(fOurSocket);
+  if (fOurSocket>= 0) ::closeSocket(fOurSocket);

   fOurSocket = -1;
 }



Bruno Filipe Basílio
Departamento de Investigação, Desenvolvimento e Inovação

Tel: (+351) 214233436

http://www.brisainovacao.pt







--------------------------------------------------------------------------------

Declaração:
A informação contida nesta mensagem, e os ficheiros anexos, é privilegiada e confidencial, destinando-se exclusivamente ao(s) destinatário(s).Se não é o destinatário (ou o responsável pela sua entrega ao destinatário) e recebeu a mesma por engano, fica notificado que é estritamente proibido reproduzir, guardar ou distribuir toda ou qualquer parte desta mensagem e ficheiros anexos. Por favor reencaminhe a mensagem para o responsável pelo seu envio ou contacte-nos por telefone e elimine a mensagem e ficheiros anexos do seu computador, sem os reproduzir.

Disclaimer:
The information contained in this message, and any files attached, is privileged and confidential, and intended exclusively for the included addresses. If you are not the intended recipient (or the person responsible for delivering to the intended recipient) and received this message by mistake, be aware that copy, storage, distribution or any other use of all or part of this message and the files attached is strictly prohibited. Please notify the sender by reply e-mail or contact us by telephone and delete this message and the files attached, without retaining a copy.

--------------------------------------------------------------------------------




More information about the live-devel mailing list