[Live-devel] Valgrind uninitialised values inside live555
Костромин Дмитрий Андреевич
kostromin at bolid.ru
Tue Aug 17 08:17:45 PDT 2021
Hello, du debugging our project i detected some conditional jumps on
uninitialised value. See Valgrind log below
=79825== Thread 23:
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x650BEAB: setPortNum(sockaddr_storage&, unsigned short)
(NetAddress.cpp:517)
==79825== by 0x6508456: getSourcePort0 (GroupsockHelper.cpp:736)
==79825== by 0x6508456: getSourcePort(UsageEnvironment&, int, int,
Port&) (GroupsockHelper.cpp:747)
==79825== by 0x6490491: MediaSubsession::initiate(int)
(MediaSession.cpp:786)
==79825== by 0x3AE01E:
video_network::rtsp_player_internal_data::setup_next_subsession(RTSPClient*)
(rtsp_player.cpp:125)
==79825== by 0x3AEC09:
video_network::rtsp_player_internal_data::continue_after_describe(RTSPClient*,
int, char*) (rtsp_player.cpp:365)
==79825== by 0x6489456: RTSPClient::handleResponseBytes(int)
(RTSPClient.cpp:1970)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x650BEB1: setPortNum(sockaddr_storage&, unsigned short)
(NetAddress.cpp:517)
==79825== by 0x6508456: getSourcePort0 (GroupsockHelper.cpp:736)
==79825== by 0x6508456: getSourcePort(UsageEnvironment&, int, int,
Port&) (GroupsockHelper.cpp:747)
==79825== by 0x6490491: MediaSubsession::initiate(int)
(MediaSession.cpp:786)
==79825== by 0x3AE01E:
video_network::rtsp_player_internal_data::setup_next_subsession(RTSPClient*)
(rtsp_player.cpp:125)
==79825== by 0x3AEC09:
video_network::rtsp_player_internal_data::continue_after_describe(RTSPClient*,
int, char*) (rtsp_player.cpp:365)
==79825== by 0x6489456: RTSPClient::handleResponseBytes(int)
(RTSPClient.cpp:1970)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x6507BD7: readSocket(UsageEnvironment&, int, unsigned
char*, unsigned int, sockaddr_storage&) (GroupsockHelper.cpp:411)
==79825== by 0x6479EAA: SocketDescriptor::tcpReadHandler1(int)
(RTPInterface.cpp:510)
==79825== by 0x647A07A:
SocketDescriptor::tcpReadHandler(SocketDescriptor*, int)
(RTPInterface.cpp:493)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825== by 0x3B4CB5: std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::operator()() (thread:271)
==79825== by 0x3B4B37:
std::thread::_State_impl<std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*> >
>::_M_run() (thread:215)
==79825== by 0x697BDE3: ??? (in
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x6507BDD: readSocket(UsageEnvironment&, int, unsigned
char*, unsigned int, sockaddr_storage&) (GroupsockHelper.cpp:411)
==79825== by 0x6479EAA: SocketDescriptor::tcpReadHandler1(int)
(RTPInterface.cpp:510)
==79825== by 0x647A07A:
SocketDescriptor::tcpReadHandler(SocketDescriptor*, int)
(RTPInterface.cpp:493)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825== by 0x3B4CB5: std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::operator()() (thread:271)
==79825== by 0x3B4B37:
std::thread::_State_impl<std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*> >
>::_M_run() (thread:215)
==79825== by 0x697BDE3: ??? (in
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x6509858:
Groupsock::wasLoopedBackFromUs(UsageEnvironment&, sockaddr_storage
const&) (Groupsock.cpp:319)
==79825== by 0x647AF82: RTCPInstance::incomingReportHandler1()
(RTCP.cpp:460)
==79825== by 0x6479FD8: SocketDescriptor::tcpReadHandler1(int)
(RTPInterface.cpp:589)
==79825== by 0x647A07A:
SocketDescriptor::tcpReadHandler(SocketDescriptor*, int)
(RTPInterface.cpp:493)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825== by 0x3B4CB5: std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::operator()() (thread:271)
==79825== by 0x3B4B37:
std::thread::_State_impl<std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*> >
>::_M_run() (thread:215)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x6507BD7: readSocket(UsageEnvironment&, int, unsigned
char*, unsigned int, sockaddr_storage&) (GroupsockHelper.cpp:411)
==79825== by 0x6479458: RTPInterface::handleRead(unsigned char*,
unsigned int, unsigned int&, sockaddr_storage&, int&, unsigned char&,
unsigned char&) (RTPInterface.cpp:285)
==79825== by 0x64729EB: BufferedPacket::fillInData(RTPInterface&,
sockaddr_storage&, unsigned char&) (MultiFramedRTPSource.cpp:405)
==79825== by 0x64737C2: MultiFramedRTPSource::networkReadHandler1()
(MultiFramedRTPSource.cpp:241)
==79825== by 0x6479FD8: SocketDescriptor::tcpReadHandler1(int)
(RTPInterface.cpp:589)
==79825== by 0x647A07A:
SocketDescriptor::tcpReadHandler(SocketDescriptor*, int)
(RTPInterface.cpp:493)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825==
==79825== Conditional jump or move depends on uninitialised value(s)
==79825== at 0x6507BDD: readSocket(UsageEnvironment&, int, unsigned
char*, unsigned int, sockaddr_storage&) (GroupsockHelper.cpp:411)
==79825== by 0x6479458: RTPInterface::handleRead(unsigned char*,
unsigned int, unsigned int&, sockaddr_storage&, int&, unsigned char&,
unsigned char&) (RTPInterface.cpp:285)
==79825== by 0x64729EB: BufferedPacket::fillInData(RTPInterface&,
sockaddr_storage&, unsigned char&) (MultiFramedRTPSource.cpp:405)
==79825== by 0x64737C2: MultiFramedRTPSource::networkReadHandler1()
(MultiFramedRTPSource.cpp:241)
==79825== by 0x6479FD8: SocketDescriptor::tcpReadHandler1(int)
(RTPInterface.cpp:589)
==79825== by 0x647A07A:
SocketDescriptor::tcpReadHandler(SocketDescriptor*, int)
(RTPInterface.cpp:493)
==79825== by 0x63BB33A: BasicTaskScheduler::SingleStep(unsigned int)
(BasicTaskScheduler.cpp:171)
==79825== by 0x63BA452: BasicTaskScheduler0::doEventLoop(char
volatile*) (BasicTaskScheduler0.cpp:80)
==79825== by 0x3ABB91: video_network::rtsp_player::run()
(rtsp_player.cpp:591)
==79825== by 0x3B4E71: void std::__invoke_impl<void, void
(video_network::rtsp_player::*)(),
video_network::rtsp_player*>(std::__invoke_memfun_deref, void
(video_network::rtsp_player::*&&)(), video_network::rtsp_player*&&)
(invoke.h:73)
==79825== by 0x3B4DA0: std::__invoke_result<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>::type
std::__invoke<void (video_network::rtsp_player::*)(),
video_network::rtsp_player*>(void (video_network::rtsp_player::*&&)(),
video_network::rtsp_player*&&) (invoke.h:95)
==79825== by 0x3B4D00: void std::thread::_Invoker<std::tuple<void
(video_network::rtsp_player::*)(), video_network::rtsp_player*>
>::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) (thread:264)
==79825==
For example I found this code inside GroupsockHelper.cpp:
static Boolean getSourcePort0(int socket, portNumBits&
resultPortNum/*host order*/) {
sockaddr_storage testAddr;
setPortNum(testAddr, 0);
SOCKLEN_T len = sizeof testAddr;
if (getsockname(socket, (struct sockaddr*)&testAddr, &len) < 0)
return False;
resultPortNum = ntohs(portNum(testAddr));
return True;
}
sockaddr_storage testAddr; here uninitialised!!
More information about the live-devel
mailing list