[Live-devel] Unitialized memory in RTPReceptionStats

PROMONET Michel michel.promonet at thalesgroup.com
Fri Apr 5 06:12:39 PDT 2013


                Hi Ross,

I know you don't like valgrind tool, but it reports use of uninitialized memory :


Conditional jump or move depends on uninitialised value(s)

 (see: http://valgrind.org/docs/manual/mc-manual.html#mc-manual.uninitvals)

    at 0x1036E23: RTCPInstance::enqueueReportBlock(RTPReceptionStats*) (RTCP.cpp:811)

    by 0x1036D17: RTCPInstance::enqueueCommonReportSuffix() (RTCP.cpp:782)

    by 0x1036BCC: RTCPInstance::addRR() (RTCP.cpp:744)

    by 0x1036A3A: RTCPInstance::addReport() (RTCP.cpp:710)

    by 0x1036767: RTCPInstance::sendReport() (RTCP.cpp:627)

    by 0x1037594: SendRTCPReport (RTCP.cpp:965)

    by 0x10379C2: OnExpire (rtcp_from_spec.c:202)

    by 0x103740E: RTCPInstance::onExpire1() (RTCP.cpp:926)

    by 0x10369B7: RTCPInstance::onExpire(RTCPInstance*) (RTCP.cpp:693)

    by 0x10895D0: AlarmHandler::handleTimeout() (BasicTaskScheduler0.cpp:34)

    by 0x1088419: DelayQueue::handleAlarm() (DelayQueue.cpp:184)

    by 0x108714D: BasicTaskScheduler::SingleStep(unsigned int) (BasicTaskScheduler.cpp:205)

    by 0x10854E3: BasicTaskScheduler0::doEventLoop(char*) (BasicTaskScheduler0.cpp:81)

  Uninitialised value was created by a heap allocation

    at 0x4C27CC1: operator new(unsigned long) (vg_replace_malloc.c:261)

    by 0x1026FCF: RTPReceptionStatsDB::noteIncomingSR(unsigned int, unsigned int, unsigned int, unsigned int) (RTPSource.cpp:134)

    by 0x103619B: RTCPInstance::incomingReportHandler1() (RTCP.cpp:445)

    by 0x1035DDE: RTCPInstance::incomingReportHandler(RTCPInstance*, int) (RTCP.cpp:319)

    by 0x1086D2B: BasicTaskScheduler::SingleStep(unsigned int) (BasicTaskScheduler.cpp:146)

    by 0x10854E3: BasicTaskScheduler0::doEventLoop(char*) (BasicTaskScheduler0.cpp:81)

A way to fix this is to initialize

void RTPReceptionStats::init(u_int32_t SSRC) {

  fSSRC = SSRC;

  fTotNumPacketsReceived = 0;

  fTotBytesReceived_hi = fTotBytesReceived_lo = 0;

+  fBaseExtSeqNumReceived = 0;

+  fHighestExtSeqNumReceived = 0;

  fHaveSeenInitialSequenceNumber = False;

Another way could be to check fHaveSeenInitialSequenceNumber in accessors, it's up to you.

Best Regards,

                Michel.

[@@ THALES GROUP INTERNAL @@]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20130405/6f45e4d4/attachment.html>


More information about the live-devel mailing list