Opened 18 years ago

Closed 18 years ago

#2738 closed defect (fixed)

Crash in MythThemedMenuPrivate::ReloadTheme()

Reported by: bolek-mythtv@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

This is in SVN 11821.

The frontend setup crashes after the following steps to reproduce:

1. start mythfrontend
2. Go to Setup->Appearance
3. Press 'Esc'

Backtrace is not always exactly the same but always somewhere inside MythThemedMenuPrivate::ReloadTheme?():

(gdb) bt
#0  0x0031b029 in MythThemedMenu::ReloadExitKey (this=0x91be0c0)
    at myththemedmenu.cpp:2252
#1  0x0032adfa in MythThemedMenuPrivate::ReloadTheme (this=0x91f74f8)
    at myththemedmenu.cpp:1727
#2  0x0032af41 in MythThemedMenu::ReloadTheme (this=0x91b8960)
    at myththemedmenu.cpp:2259
#3  0x0806875a in reloadTheme () at main.cpp:629
#4  0x002e54b8 in MythMainWindow::ExitToMainMenu (this=0x9126470)
    at mythmainwindow.cpp:703
#5  0x002e56fb in MythMainWindow::customEvent (this=0x9126470, ce=0xa828aa0)
    at mythmainwindow.cpp:1210
#6  0x038e131e in QObject::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#7  0x0391ecfc in QWidget::event () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#8  0x03878e6b in QApplication::internalNotify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#9  0x0387a2e9 in QApplication::notify ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#10 0x03879d70 in QApplication::sendPostedEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#11 0x03879f26 in QApplication::sendPostedEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#12 0x03820d0a in QEventLoop::processEvents ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#13 0x038923f0 in QEventLoop::enterLoop ()
   from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#14 0x038922a6 in QEventLoop::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#15 0x0387897f in QApplication::exec () from /usr/lib/qt-3.3/lib/libqt-mt.so.3
#16 0x0806f28d in main (argc=1, argv=0xbfdcc414) at main.cpp:1208
(gdb) 

Change History (2)

comment:1 Changed 18 years ago by paulh

I can reproduce this also.

What seems to be happening is the stack of MythThemedMenu?'s are deleted and then referenced again later causing the crash.

Changing line 334 in programs/mythfrontend/main.cpp from

GetMythMainWindow()->JumpTo("Reload Theme");

to

GetMythMainWindow()->JumpTo("Reload Theme", false);

so the stack isn't deleted fixes the crash but the menu isn't redrawn properly if the theme was changed while in the settings.

comment:2 Changed 18 years ago by paulh

Resolution: fixed
Status: newclosed

(In [12373]) This fixes a problem where exiting the Appearance settings sometimes causes a segfault. It actually only affects the classic menu layout but it was only by luck the DVR and default layouts worked.

Basically this commit makes sure the AppearanceSettings? dialog is deleted and cleaned up before doing the JumpTo?("Reload Theme") so that when its detached from the MythMainWindow? it doesn't send an ExitToMainMenuEvent? which was causing all the problems.

It also only reloads the theme if the user completed the settings dialog by pressing "Finish".

Fixes #2860, #2580, #2738.

Note: See TracTickets for help on using tickets.