Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#2746 closed defect (fixed)

Frontend SEGV editing search rules via watch recordings.

Reported by: Stuart Auchterlonie Owned by: Stuart Auchterlonie
Priority: minor Milestone: 0.21
Component: mythtv Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Attempting to edit a recording rule via the watch recordings screen causes a segfault if the show is recorded via a search rule. Shows scheduled using a standard rule (by title etc) work just fine.

Backtrace is attached

(gdb) bt
#0  0x08072212 in QShared::ref (this=0xffffffff) at qshared.h:49
#1  0xb68d2f95 in QString::operator= () from /usr/lib/libqt-mt.so.3
#2  0xb785e2e0 in ProgramInfo::ToMap (this=0x8380580, progMap=@0x855e2e4, showrerecord=false) at programinfo.cpp:445
#3  0xb796d2f3 in ScheduledRecording::ToMap (this=0x8423710, progMap=@0x855e2e4) at scheduledrecording.cpp:271
#4  0xb795836f in RecOptDialog::updateInfo (this=0x855e168, p=0xbfe8cfb0) at sr_dialog.cpp:168
#5  0xb79586b3 in RecOptDialog::paintEvent (this=0x855e168, e=0xbfe8d440) at sr_dialog.cpp:98
#6  0xb65f1091 in QWidget::event () from /usr/lib/libqt-mt.so.3
#7  0xb654c87a in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#8  0xb654d5f5 in QApplication::notify () from /usr/lib/libqt-mt.so.3
#9  0xb64de06f in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#10 0xb64d26a1 in QETWidget::translatePaintEvent () from /usr/lib/libqt-mt.so.3
#11 0xb64d7d1e in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#12 0xb64f12a2 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#13 0xb6565255 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#14 0xb654b3b9 in QApplication::enter_loop () from /usr/lib/libqt-mt.so.3
#15 0xb6f4fd24 in MythDialog::exec (this=0x855e168) at mythdialogs.cpp:135
#16 0xb6ed5e61 in ConfigurationDialog::exec (this=0xbfe8d954, saveOnAccept=true, doLoad=false) at settings.cpp:1081
#17 0xb796d1a0 in ScheduledRecording::exec (this=0x8423710, saveOnExec=true, doLoad=false) at scheduledrecording.cpp:738
#18 0x080991ac in PlaybackBox::doEditScheduled (this=0xbfe8e4f0) at playbackbox.cpp:3216
#19 0x0811c5bb in PlaybackBox::qt_invoke (this=0xbfe8e4f0, _id=94, _o=0xbfe8da8c) at moc_playbackbox.cpp:421
#20 0xb65b654b in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#21 0xb65b6fdc in QObject::activate_signal () from /usr/lib/libqt-mt.so.3
#22 0xb6950b9c in QButton::pressed () from /usr/lib/libqt-mt.so.3
#23 0xb6ecbbd2 in MythPushButton::keyPressEvent (this=0x84302b0, e=0xbfe8e000) at mythwidgets.cpp:1085
#24 0xb65f0eb1 in QWidget::event () from /usr/lib/libqt-mt.so.3
#25 0xb654c87a in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#26 0xb654cc0d in QApplication::notify () from /usr/lib/libqt-mt.so.3
#27 0xb64de06f in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#28 0xb64d1daf in QETWidget::translateKeyEvent () from /usr/lib/libqt-mt.so.3
#29 0xb64d7d07 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#30 0xb64f12a2 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#31 0xb6565255 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#32 0xb654b3b9 in QApplication::enter_loop () from /usr/lib/libqt-mt.so.3
#33 0xb6f4fd24 in MythDialog::exec (this=0xbfe8e4f0) at mythdialogs.cpp:135
#34 0x08068a64 in startPlayback () at main.cpp:197
#35 0x0806cb9b in TVMenuCallback (data=0x8201358, selection=@0x8347670) at main.cpp:292
#36 0xb6db3451 in MythThemedMenuPrivate::handleAction (this=0x8347640, action=@0x8351550) at myththemedmenu.cpp:2098
#37 0xb6db3983 in MythThemedMenuPrivate::keyHandler (this=0x8347640, actions=@0xbfe8ec38, fullexit=true) at myththemedmenu.cpp:1840
#38 0xb6db40f5 in MythThemedMenuPrivate::keyPressHandler (this=0x8347640, e=0xbfe8f240) at myththemedmenu.cpp:1746
#39 0xb6db4187 in MythThemedMenu::keyPressEvent (this=0x8357b38, e=0xbfe8f240) at myththemedmenu.cpp:2271
#40 0xb6d6af9a in MythMainWindow::eventFilter (this=0x82d1f88, e=0xbfe8f240) at mythmainwindow.cpp:1111
#41 0xb65b36b0 in QObject::activate_filters () from /usr/lib/libqt-mt.so.3
#42 0xb65b372e in QObject::event () from /usr/lib/libqt-mt.so.3
#43 0xb65f0b9a in QWidget::event () from /usr/lib/libqt-mt.so.3
#44 0xb654c87a in QApplication::internalNotify () from /usr/lib/libqt-mt.so.3
#45 0xb654cc0d in QApplication::notify () from /usr/lib/libqt-mt.so.3
#46 0xb64de06f in QApplication::sendSpontaneousEvent () from /usr/lib/libqt-mt.so.3
#47 0xb64d1daf in QETWidget::translateKeyEvent () from /usr/lib/libqt-mt.so.3
#48 0xb64d7d07 in QApplication::x11ProcessEvent () from /usr/lib/libqt-mt.so.3
#49 0xb64f12a2 in QEventLoop::processEvents () from /usr/lib/libqt-mt.so.3
#50 0xb6565255 in QEventLoop::enterLoop () from /usr/lib/libqt-mt.so.3
#51 0xb656517a in QEventLoop::exec () from /usr/lib/libqt-mt.so.3
#52 0xb654b38d in QApplication::exec () from /usr/lib/libqt-mt.so.3
#53 0x08071cd5 in main (argc=3, argv=0xbfe8fcf4) at main.cpp:1208

Digging deeper programinfo.cpp:445 title is NULL. scheduledrecording.cpp:271 much of m_pginfo is also NULL which isn't really surprising given that the search based rules won't know this information.

Change History (5)

comment:1 in reply to:  description Changed 17 years ago by mikerice1969 at comcast dot net

Replying to stuarta:

Just adding what I know about this problem...

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;
}
}

comment:2 Changed 17 years ago by Stuart Auchterlonie

Owner: changed from Isaac Richards to Stuart Auchterlonie

I'll take a closer look using the information you've provided.

comment:3 Changed 17 years ago by Stuart Auchterlonie

(In [12170]) Refs #2746. Fixes frontend SEGV when editing a custom recording rule via the watch recordings screen.

Thanks to mikerice1969 at comcast dot net for additional work tracking this down and providing a patch.

NOTE: this is a 0.20-fixes candidate.

comment:4 Changed 17 years ago by Stuart Auchterlonie

Resolution: fixed
Status: newclosed

(In [12171]) Closes #2746. Backports [12170] to 0.20-fixes. This fixes a frontend SEGV when editing recording schedules via the watch recordings screen.

Thanks to mikerice1969 at comcast dot net for additional work tracking this down and providing a patch.

comment:5 Changed 17 years ago by Stuart Auchterlonie

(In [12172]) Refs #2746. Grrr. Remove some debugging code that snuck in....

Note: See TracTickets for help on using tickets.