[Live-devel] [BUG] malloc crash

Gaetan SEMET gsem01 at freescale.com
Tue Jul 26 20:12:53 PDT 2005


Hello

I'm using LiveMedia libray (last version) with mplayer to play H264 
content over RTP. I can successully read the video
and audio, but sometimes, it simply crash with malloc'ing for the 
receive buffer.

This should not comes from a memory leak, but it looks like it's unable 
to allocate a buffer (new).

Here is the backtrace from gdb :

#0  0x003cbfc4 in chunk_alloc (ar_ptr=0x40b00010, nb=24) at malloc.c:2905
#1  0x003cbe28 in __libc_malloc (bytes=4278124286) at malloc.c:2810
#2  0x0034f40c in operator new (sz=16)
    at ../../../../gcc-3.2.3/libstdc++-v3/libsupc++/new_op.cc:48
#3  0x0030d6f8 in HashTable::Iterator::create (hashTable=@0x5d1a68) at 
BasicHashTable.cpp:124
#4  0x003099cc in Iterator (this=0xbf3ff798, interfaces=@0x18) at 
NetInterface.cpp:78
#5  0x00308e38 in Groupsock::outputToAllMembersExcept (this=0x5d19d8, 
exceptInterface=0x0,
    ttlToFwd=255 'ÿ', data=0xab04e0 "\200a\202\022kÅ|XB\232ç1", size=12, 
sourceAddr=2317918218)
    at Groupsock.hh:123
#6  0x00308cd8 in Groupsock::handleRead (this=0x5d19d8,
    buffer=0xab04e0 "\200a\202\022kÅ|XB\232ç1", 
bufferMaxSize=4278124286, bytesRead=@0xbf3ff850,
    fromAddress=@0xbf3ff854) at Groupsock.hh:115
#7  0x002e4e78 in RTPInterface::handleRead (this=0x5d1c24,
    buffer=0xab04e0 "\200a\202\022kÅ|XB\232ç1", 
bufferMaxSize=4278124284, bytesRead=@0xbf3ff850,
    fromAddress=@0xbf3ff854) at RTPInterface.cpp:187
#8  0x002dbdf4 in BufferedPacket::fillInData (this=0x743070, 
rtpInterface=@0x5d1c24)
    at MultiFramedRTPSource.cpp:330
#9  0x002db954 in MultiFramedRTPSource::networkReadHandler (source=0x5d1bc8)
    at MultiFramedRTPSource.cpp:205
#10 0x0030c5e0 in BasicTaskScheduler::SingleStep (this=0x5cfb30, 
maxDelayTime=0)
    at BasicTaskScheduler.cpp:133
#11 0x0030bb8c in BasicTaskScheduler0::doEventLoop (this=0x5cfb30, 
watchVariable=0x7757f4 "")
    at BasicTaskScheduler0.cpp:76
#12 0x000c3924 in getBuffer (demuxer=0xbf3ff9f0, ds=0x18, 
mustGetNewData=0, ptsBehind=@0xbf3ffa28)
    at demux_rtp.cpp:507
#13 0x000c3310 in demux_rtp_fill_buffer (demuxer=0x5cf1b8, ds=0x5cfa10) 
at demux_rtp.cpp:281
#14 0x0007c4ac in ds_fill_buffer (ds=0x5cfa10) at demuxer.c:475
#15 0x0007c688 in demux_read_data (ds=0x5cfa10,
    mem=0x742eb3 ":å´÷\n¥\20347\016"..., len=30) at demuxer.c:499
#16 0x00036710 in read_frame (sh=0x775838) at ad_libmad.c:59
#17 0x00036914 in decode_audio (sh=0x775838,
    buf=0xa94c78 
"\032úfúgü¥ÿ¯ÿ\bý\211ûJûSûnü\031ýªý\017\001`\004\231\003±", minlen=15872,
    maxlen=74240) at ad_libmad.c:131
#18 0x00033d78 in decode_audio (sh_audio=0x775838,
    buf=0x4095b008 "O\005S\005\001\005®\004ª\003\036\002\220", 
minlen=74240, maxlen=1048576)
    at dec_audio.c:400


I've changed the behaviour of mplayer, putting the audio decoding and 
ready in another thread, but it doesn't
look like a problem cause by this, since liveMedia is thread safe 
(true?). I'm running the library and mplayer
on an ARM platform. I can't reproduce it on x86 unfortunately.

I hope you will be able to check it, or advise me how to bypass this 
crash, this could be an important bug into the
library.
I can provide any other information you may need.

Thanks a lot for your nice library.

Best Regards
Gaetan




More information about the live-devel mailing list