Opened 15 years ago

Closed 14 years ago

#2578 closed defect (fixed)

MythMusic segfaults when activating the "Select music playlists" jumppoint twice

Reported by: david@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythmusic Version: 0.20
Severity: medium Keywords:
Cc: Ticket locked: no


I have a key bound to the "Select music playlists" jumppoint (using the 0.20-fixes branch). When activated, the music selection screen is shown, and a few seconds later the boxes are ticked for the tracks that are currently selected.

If I activate the same jumppoint again during that interval, mythfrontend segfaults.

I've looked at the code, and I'm not certain but it seems that the problem is that the current selections are filled in asynchronously, and if the jumppoint is activated again, Myth tries to destroy the current tree and playlist objects before they are finished loading which means that the "songs" QPtrList (private member of class Playlist) is not in a consistent state yet.

The backtrace is as follows....I can provide a fuller backtrace with debugging symbols later if necessary...

#0  0xb64aee48 in QGList::first () from /usr/lib/
#1  0xb25058ef in Playlist::removeAllWidgets () from /usr/lib/mythtv/plugins/
#2  0xb254a43e in DatabaseBox::~DatabaseBox () from /usr/lib/mythtv/plugins/
#3  0xb24dd7f3 in startDatabaseTree () from /usr/lib/mythtv/plugins/
#4  0xb24e1cfc in runMusicSelection () from /usr/lib/mythtv/plugins/
#5  0xb68f1010 in MythMainWindow::ExitToMainMenu () from /usr/lib/
#6  0xb68f4f30 in MythMainWindow::customEvent () from /usr/lib/
#7  0xb61f3f2c in QObject::event () from /usr/lib/
#8  0xb622caaf in QWidget::event () from /usr/lib/
#9  0xb6199e1f in QApplication::internalNotify () from /usr/lib/
#10 0xb619941e in QApplication::notify () from /usr/lib/
#11 0xb619ac16 in QApplication::sendPostedEvents () from /usr/lib/
#12 0xb619aa96 in QApplication::sendPostedEvents () from /usr/lib/
#13 0xb614292a in QEventLoop::processEvents () from /usr/lib/
#14 0xb61ac1d8 in QEventLoop::enterLoop () from /usr/lib/
#15 0xb61ac088 in QEventLoop::exec () from /usr/lib/
#16 0xb619a071 in QApplication::exec () from /usr/lib/
#17 0x0807451e in reloadTheme ()
#18 0xb5b80974 in __libc_start_main () from /lib/tls/
#19 0x08067661 in ?? ()

Attachments (1)

mythtv.2758.patch (565 bytes) - added by david@… 15 years ago.
Patch to fix the segfault

Download all attachments as: .zip

Change History (3)

Changed 15 years ago by david@…

Attachment: mythtv.2758.patch added

Patch to fix the segfault

comment:1 Changed 15 years ago by david@…

I've attached a patch which fixes this problem by ensuring that the loading threads are done before trying to clean up after them. Compiled and tested with the 0.20-fixes branch.

comment:2 Changed 14 years ago by paulh

Resolution: fixed
Status: newclosed

(In [12462]) In MythMusic's Select music playlists screen wait for the AllMusic? and PlaylistsContainer? loading threads to finish before exiting the screen. Prevents a segfault when activating the 'Select Music Playlists' jumppoint twice in quick succession.

Used a slightly different patch than the one on the ticket. Fixes #2578

Note: See TracTickets for help on using tickets.