[mythtv] frontend segfault

Michael Rice mikerice1969 at hotmail.com
Sun Nov 19 00:44:24 UTC 2006


>Steps to reproduce:
>
>watch recordings -> right arrow to highlight recording -> right arrow to 
>bring up the recording's menu -> select recording options -> edit recording 
>schedule
>
>and segfault.

I've been having this problem for awhile now (in 0.20-fixed) and finally 
brought it up in the debugger to see what was going on.

In PlaybackBox::doEditScheduled() a ScheduledRecording (record) is created 
which is loaded
in loadByProgram to contain a pointer to a ProgramInfo object (curitem).

Note that the object is not copied.. there is a pointer assignment:

void ScheduledRecording::loadByProgram(const ProgramInfo* proginfo)
{
    m_pginfo = proginfo;

So take note m_pginfo and set a breakpoint on the ProgramInfo
destructor when this==&m_pginfo.

You will see it is destroyed during processing in
PlaybackBox::updateShowTitles()

When you eventually try to use "schedRec" in
RecOptDialog::updateInfo the ProgramInfo object
is no longer valid and things go bad from there.

No idea what the real fix is since I am not familiar with the code but the 
following takes care of the crash for me:

Index: playbackbox.cpp
===================================================================
--- playbackbox.cpp     (revision 11748)
+++ playbackbox.cpp     (working copy)
@@ -3007,10 +3007,12 @@
     else
     {
         ScheduledRecording record;
-        record.loadByProgram(curitem);
+        ProgramInfo* proginfo = new ProgramInfo(*curitem);
+        record.loadByProgram(proginfo);
         record.exec();

         connected = FillList();
+        delete proginfo;
     }
}

_________________________________________________________________
Share your latest news with your friends with the Windows Live Spaces 
friends module. 
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mk



More information about the mythtv-dev mailing list