[mythtv] Strange backtrace from mythtranscode crash

Paul Gardiner lists at glidos.net
Sat Oct 1 16:43:15 UTC 2011


I'm trying to trace a crash in mythtranscode, but I get a very strange
backtrace:

#0  0xb46c1d16 in memcpy () from /lib/libc.so.6
#1  0x0806cd84 in AudioReencodeBuffer::AddFrames (this=0x103c, 
buffer=0xb125d020, frames=1536, timecode=30064772608) at transcode.cpp:89
#2  0x0806ce8e in AudioReencodeBuffer::AddData (this=0xb1d00fd0, 
buffer=0xb125d020, len=1536, timecode=4156, frames=1536) at 
transcode.cpp:110
#3  0xb7a2380a in AudioPlayer::AddAudioData (this=0x81e56dc, 
buffer=0xb125d020 "\vwt\316\034\060\341\314\t)\331$\200", len=1536, 
timecode=4156, frames=1536) at audioplayer.cpp:385
#4  0xb7a88dc8 in AvFormatDecoder::ProcessAudioPacket (this=0xb1d01848, 
curstream=0xb1d20f10, pkt=0x8215e88, decodetype=kDecodeAV) at 
avformatdecoder.cpp:4156
#5  0xb7a8b150 in AvFormatDecoder::GetFrame (this=0xb1d01848, 
decodetype=kDecodeAV) at avformatdecoder.cpp:4453
#6  0xb7a17e60 in MythPlayer::TranscodeGetNextFrame (this=0x81cd530, 
dm_iter=..., did_ff=@0xbfffef50, is_key=@0xbfffef4b, honorCutList=true) 
at mythplayer.cpp:4171
#7  0x0806a8ab in Transcode::TranscodeFile (this=0x81c39d8, 
inputname=..., outputname=..., profileName=..., honorCutList=true, 
framecontrol=false, jobID=-1, fifodir=...,
     fifo_info=false, cleanCut=true, deleteMap=..., passthru=true) at 
transcode.cpp:1072
#8  0x08057ea6 in main (argc=10, argv=0xbffff9b4) at main.cpp:683

The strange thing is that AddData doesn't call AddFrames; it's the other
way around: AddFrames calls AddData. Also AddFrames doesn't call
memcpy. AddData does. It would make much more sense if level #1 was
just missing, although in that case, there seems to be no reason
for memcpy to segfault.

Note also the value of "this" for level #1. Anyone seen anything like
this before? I wonder if something previously has made a random write
to memory and screwed up the stack maybe. If that were the case, how
is it best traced?

Cheers,
	Paul.

Here's the section of code, BTW.

  // timecode is in milliseconds.
     virtual bool AddFrames(void *buffer, int frames, int64_t timecode)
     {
         return AddData(buffer, frames * bytes_per_frame, timecode, frames);
     }

     // timecode is in milliseconds.
     virtual bool AddData(void *buffer, int len, int64_t timecode, int 
frames)
     {
         int freebuf = bufsize - audiobuffer_len;
         int newlen;

         if (len > freebuf)
         {
             bufsize += len - freebuf;
             unsigned char *tmpbuf = new unsigned char[bufsize];
             memcpy(tmpbuf, audiobuffer, audiobuffer_len);
             delete [] audiobuffer;
             audiobuffer = tmpbuf;
         }

         ab_len[ab_count] = len;
         ab_offset[ab_count] = audiobuffer_len;

         memcpy(audiobuffer + audiobuffer_len, buffer,
                len);
         audiobuffer_len    += len;
         audiobuffer_frames += frames;


More information about the mythtv-dev mailing list