[mythtv-users] bug in mythreplex

D. Hugh Redelmeier hugh at mimosa.com
Tue Sep 26 06:05:11 UTC 2006

| From: Clark Rawlins <clark at bit63.org>
| Subject: [mythtv-users] mythreplex
| I have run into a problem with mythreplex that causes a
| segmentation fault to occur. I would have debugged the
| problem myself and attempted a patch, but I get different
| behavior depending on whether the  --compile-type=debug
| flag is passed to configure.  Of course the segmentation
| fault only occurs when --compile-type is absent.

Yeah.  Me too.

I figured out how to track this down.  Thanks to Axel for explaining
how to building the RPM.


in mythtv-0.20/programs/mythtranscode/replex/element.c
routine get_audio_info calls find_audio_sync
The second arg, is header, an array of 4 bytes.
Almost the first thing that find_audio_sync does is memset the first
7(!) bytes of this array.

That's the bug.  I don't know what the correct fix would be.

You could prevent this particular crash by increasing the array size
but I don't know that the program would then be correct.

BTW, a gdb backtrace shows about 85 recusive calls to get_pes().  I
expect that this is accurate (but I may be wrong).  This seems very
wasteful since the recursive call in get_pes is a last-action call and
could be turned into iteration very easily.  Is there a reason not to
do this?

To whom should I report this?  Is posting this message sufficient?

| What additional information should I include in a bug report.

The trick is to get a copy of the debug symbols without changing the
object code.  You don't want to change the object code because the
symptom goes away (as you have found).

I rebuilt the rpm in the same way that Axel did.  My intention was to
install the -debuginfo.rpm that was generated.  But I found a
shortcut:  the replex binary in the build tree was unstripped, so I
just tested with it.

Then it was just a matter of whacking on the problem (which was
nicely repeatable) with gdb.  (Not totally trivial: I had to figure
out what the stack guard code did and use the "watch" command to catch
when the sentinel got written to.)

More information about the mythtv-users mailing list