Bug 100564 - Crash after hiding Play Queue
Summary: Crash after hiding Play Queue
Alias: None
Product: juk
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Michael Pyne
Depends on:
Reported: 2005-03-01 17:44 UTC by Thomas McGuire
Modified: 2006-02-17 03:54 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Thomas McGuire 2005-03-01 17:44:51 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

To reproduce:
1. Start Juk
2. Enable Play Queue
3. Double-click Play Queue (empty, so nothing will happen)
4. Double-click any other playlist (will not work, perhaps 
   related to bug #100358)
5. Hide the Play Queue
6. Double-click the playlist again

Konsole shows:
>juk: ERROR: Couldn't resolve the mime type of "" -- this shouldn't happen.

Using host libthread_db library "/lib/libthread_db.so.1".
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 2040)]
[KCrash handler]
#4  0x00000000 in ?? ()
#5  0x080e9b75 in UpcomingPlaylist::UpcomingSequenceIterator::prepareToPlay (
    this=0x87639d0) at ../../../kdemultimedia/juk/upcomingplaylist.cpp:223
#6  0x080e7fb6 in TrackSequenceManager::nextItem (this=0x8335738)
    at ../../../kdemultimedia/juk/tracksequencemanager.cpp:99
#7  0x080ae428 in Playlist::playNext (this=0x82a9e88)
    at ../../../kdemultimedia/juk/playlist.cpp:486
#8  0x080c18ae in PlaylistCollection::playNext (this=0x824bf68)
    at ../../../kdemultimedia/juk/playlistcollection.cpp:123
#9  0x080aa121 in PlayerManager::play (this=0x81f7098, file=@0x811b330)
    at ../../../kdemultimedia/juk/playermanager.cpp:250
#10 0x080aa3e9 in PlayerManager::play (this=0x81f7098)
    at ../../../kdemultimedia/juk/playermanager.cpp:295
#11 0x080ab7b0 in PlayerManager::qt_invoke (this=0x81f7098, _id=4, 
    _o=0xbfffe670) at playermanager.moc:176
#12 0x41558013 in QObject::activate_signal (this=0x81ff238, clist=0x81ff488, 
    o=0xbfffe670) at kernel/qobject.cpp:2355
#13 0x41557eb2 in QObject::activate_signal (this=0x81ff238, signal=2)
    at kernel/qobject.cpp:2324
#14 0x40d6ac6e in KAction::activated (this=0x81ff238) at kaction.moc:171
#15 0x40d6a29d in KAction::slotActivated (this=0x81ff238)
    at ../../../kdelibs/kdeui/kaction.cpp:1102
#16 0x40d6a23b in KAction::activate (this=0x81ff238)
    at ../../../kdelibs/kdeui/kaction.cpp:1091
#17 0x080be95d in PlaylistBox::slotDoubleClicked (this=0x824bec8)
    at ../../../kdemultimedia/juk/playlistbox.cpp:654
#18 0x080bfc48 in PlaylistBox::qt_invoke (this=0x824bec8, _id=110, 
    _o=0xbfffe7b0) at playlistbox.moc:160
#19 0x41558013 in QObject::activate_signal (this=0x824bec8, clist=0x822c628, 
    o=0xbfffe7b0) at kernel/qobject.cpp:2355
#20 0x418c742f in QListView::doubleClicked (this=0x824bec8, t0=0x82ee310)
    at .moc/debug-shared-mt/moc_qlistview.cpp:397
#21 0x40d9d742 in KListView::contentsMouseDoubleClickEvent (this=0x824bec8, 
    e=0xbfffe860) at ../../../kdelibs/kdeui/klistview.cpp:874
#22 0x4167de4b in QScrollView::viewportMouseDoubleClickEvent (this=0x824bec8, 
    e=0xbfffed20) at widgets/qscrollview.cpp:1768
#23 0x4167d454 in QScrollView::eventFilter (this=0x824bec8, obj=0x822dae8, 
    e=0xbfffed20) at widgets/qscrollview.cpp:1507
#24 0x4164721f in QListView::eventFilter (this=0x824bec8, o=0x822dae8, 
    e=0xbfffed20) at widgets/qlistview.cpp:3841
#25 0x41555a7c in QObject::activate_filters (this=0x822dae8, e=0xbfffed20)
    at kernel/qobject.cpp:902
#26 0x415558ee in QObject::event (this=0x822dae8, e=0xbfffed20)
    at kernel/qobject.cpp:735
#27 0x41590531 in QWidget::event (this=0x822dae8, e=0xbfffed20)
    at kernel/qwidget.cpp:4658
#28 0x414f50b7 in QApplication::internalNotify (this=0xbffff210, 
    receiver=0x822dae8, e=0xbfffed20) at kernel/qapplication.cpp:2635
#29 0x414f486d in QApplication::notify (this=0xbffff210, receiver=0x822dae8, 
    e=0xbfffed20) at kernel/qapplication.cpp:2421
#30 0x4102cf10 in KApplication::notify (this=0xbffff210, receiver=0x822dae8, 
    event=0xbfffed20) at ../../../kdelibs/kdecore/kapplication.cpp:549
#31 0x41488efd in QApplication::sendSpontaneousEvent (receiver=0x822dae8, 
    event=0xbfffed20) at qapplication.h:494
#32 0x41481e4b in QETWidget::translateMouseEvent (this=0x822dae8, 
    event=0xbffff0b0) at kernel/qapplication_x11.cpp:4304
#33 0x4147faac in QApplication::x11ProcessEvent (this=0xbffff210, 
    event=0xbffff0b0) at kernel/qapplication_x11.cpp:3455
#34 0x4149a7cc in QEventLoop::processEvents (this=0x819dc38, flags=4)
    at kernel/qeventloop_x11.cpp:192
#35 0x4150937a in QEventLoop::enterLoop (this=0x819dc38)
    at kernel/qeventloop.cpp:198
#36 0x41509296 in QEventLoop::exec (this=0x819dc38)
    at kernel/qeventloop.cpp:145
#37 0x414f5237 in QApplication::exec (this=0xbffff210)
    at kernel/qapplication.cpp:2758
#38 0x080a3fb8 in main (argc=1, argv=0xbffff384)
    at ../../../kdemultimedia/juk/main.cpp:93
Comment 1 Philip Rodrigues 2006-02-17 00:02:43 UTC
I get a crash with 3.5 branch r504903, but my backtrace is different (so I won't mark as NEW). Oh, at second look, perhaps it is the same. Here's the backtrace anyway:

System configuration startup check disabled.

[New LWP 100139]
[Switching to LWP 100139]
0x2a5ba8db in nanosleep () from /lib/libc.so.6
#0  0x2a5ba8db in nanosleep () from /lib/libc.so.6
#1  0x2a5081a1 in _nanosleep () from /usr/lib/libpthread.so.2
#2  0x2a59e9ea in sleep () from /lib/libc.so.6
#3  0x2a4fe2af in sleep () from /usr/lib/libpthread.so.2
#4  0x29459f54 in KCrash::startDrKonqi (argv=0xbfbfd640, argc=17)
    at /home/phil/kdesrc/kdelibs/kdecore/kcrash.cpp:311
#5  0x29459c76 in KCrash::defaultCrashHandler (sig=11)
    at /home/phil/kdesrc/kdelibs/kdecore/kcrash.cpp:228
#6  0x2a503f08 in sigaction () from /usr/lib/libpthread.so.2
#7  0xbfbfff94 in ?? ()
#8  0x0000000b in ?? ()
#9  0x0816e1e4 in TrackSequenceManager::nextItem (this=0x81c6f20)
    at /home/phil/kdesrc/kdemultimedia/juk/tracksequencemanager.cpp:96
#10 0x0811dcba in Playlist::playNext (this=0x8642d98)
    at /home/phil/kdesrc/kdemultimedia/juk/playlist.cpp:491
#11 0x081366b8 in PlaylistCollection::playNext (this=0x8336c30)
    at /home/phil/kdesrc/kdemultimedia/juk/playlistcollection.cpp:130
#12 0x08117f0d in PlayerManager::play (this=0x81c6d20, file=@0x81c5538)
    at /home/phil/kdesrc/kdemultimedia/juk/playermanager.cpp:285
#13 0x081182dd in PlayerManager::play (this=0x81c6d20)
    at /home/phil/kdesrc/kdemultimedia/juk/playermanager.cpp:331
#14 0x08119a6c in PlayerManager::qt_invoke (this=0x81c6d20, _id=4, 
    _o=0xbfbfdcd0) at playermanager.moc:181
#15 0x29896ab0 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#16 0x29897121 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#17 0x290f903a in KAction::activated (this=0x82d41e0) at kaction.moc:176
#18 0x290f8661 in KAction::slotActivated (this=0x82d41e0)
    at /home/phil/kdesrc/kdelibs/kdeui/kaction.cpp:1102
#19 0x290f85fd in KAction::activate (this=0x82d41e0)
    at /home/phil/kdesrc/kdelibs/kdeui/kaction.cpp:1091
#20 0x08132657 in PlaylistBox::slotDoubleClicked (this=0x8336b90)
    at /home/phil/kdesrc/kdemultimedia/juk/playlistbox.cpp:644
#21 0x081341c4 in PlaylistBox::qt_invoke (this=0x8336b90, _id=110, 
    _o=0xbfbfde20) at playlistbox.moc:155
#22 0x29896ab0 in QObject::activate_signal ()
   from /usr/X11R6/lib/libqt-mt.so.3
#23 0x29ba508f in QListView::doubleClicked ()
   from /usr/X11R6/lib/libqt-mt.so.3
#24 0x2912ee1e in KListView::contentsMouseDoubleClickEvent (this=0x8336b90, 
    e=0xbfbfdee0) at /home/phil/kdesrc/kdelibs/kdeui/klistview.cpp:877
#25 0x299981c0 in QScrollView::viewportMouseDoubleClickEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#26 0x2999a1b6 in QScrollView::eventFilter ()
   from /usr/X11R6/lib/libqt-mt.so.3
#27 0x2996cae8 in QListView::eventFilter () from /usr/X11R6/lib/libqt-mt.so.3
#28 0x2989400c in QObject::activate_filters ()
   from /usr/X11R6/lib/libqt-mt.so.3
#29 0x298940d2 in QObject::event () from /usr/X11R6/lib/libqt-mt.so.3
#30 0x298c92b2 in QWidget::event () from /usr/X11R6/lib/libqt-mt.so.3
#31 0x2983b039 in QApplication::internalNotify ()
   from /usr/X11R6/lib/libqt-mt.so.3
#32 0x2983b2e5 in QApplication::notify () from /usr/X11R6/lib/libqt-mt.so.3
#33 0x293c5677 in KApplication::notify (this=0xbfbfe8a0, receiver=0x83325d0, 
    at /home/phil/kdesrc/kdelibs/kdecore/kapplication.cpp:550
#34 0x297dcd1b in QETWidget::translateMouseEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#35 0x297dbc9b in QApplication::x11ProcessEvent ()
   from /usr/X11R6/lib/libqt-mt.so.3
#36 0x297ed3c4 in QEventLoop::processEvents ()
   from /usr/X11R6/lib/libqt-mt.so.3
#37 0x2984f493 in QEventLoop::enterLoop () from /usr/X11R6/lib/libqt-mt.so.3
#38 0x2984f3ec in QEventLoop::exec () from /usr/X11R6/lib/libqt-mt.so.3
#39 0x2983a374 in QApplication::exec () from /usr/X11R6/lib/libqt-mt.so.3
#40 0x08110add in main (argc=7, argv=0xbfbfea10)
    at /home/phil/kdesrc/kdemultimedia/juk/main.cpp:95
Comment 2 Michael Pyne 2006-02-17 02:22:08 UTC
Confirmed in KDE 3.5 branch.  I will try to investigate and fix.

I'm surprised I didn't notice this bug report sooner, the steps to reproduce were exactly what was required, outstanding bug report. :)
Comment 3 Michael Pyne 2006-02-17 03:54:26 UTC
SVN commit 510372 by mpyne:

Fix bug 100564 (Crash after hiding Play Queue) in JuK.

Some of the involved code was of dubious design.  Unfortunately, I was the one who wrote it.

The problem was that JuK uses a class to handle choosing the next playlist
item, which is independant of the playlist code (a separate class).  But when
using the Play Queue, those functions are combined using two special classes
for that purpose.

When de-selecting the Play Queue, if an item wasn't already playing, I forgot to re-install
the default track selector class, and now there was a split where none was expected, and
things degenerated from there.

CC'ing Carsten again for changelog update, please.


 M  +18 -6     upcomingplaylist.cpp  
 M  +1 -1      upcomingplaylist.h  

--- branches/KDE/3.5/kdemultimedia/juk/upcomingplaylist.cpp #510371:510372
@@ -44,6 +44,8 @@
 void UpcomingPlaylist::initialize()
+    // Prevent duplicate initialization.
@@ -126,16 +128,26 @@
-    m_active = false;
+    m_active = false; // Allow re-initialization.
-    if(!m_oldIterator || !playingItem())
+    if(!m_oldIterator)
+    // Install the old track iterator.
+    manager()->installIterator(m_oldIterator);
+    // If we have an item that is currently playing, allow it to keep playing.
+    // Otherwise, just reset to the default iterator (probably not playing
+    // anything.)
+    // XXX: Reset to the last playing playlist?
-    m_oldIterator->setCurrent(playingItem()->collectionItem());
-    manager()->installIterator(m_oldIterator);
-    manager()->nextItem();
-    setPlaying(manager()->nextItem(), true);
+    if(playingItem())
+        m_oldIterator->setCurrent(playingItem()->collectionItem());
+    setPlaying(manager()->currentItem(), true);
--- branches/KDE/3.5/kdemultimedia/juk/upcomingplaylist.h #510371:510372
@@ -195,7 +195,7 @@
     virtual void reset();
-     * This function readys the UpcomingSequenceIterator for playback, by
+     * This function readies the UpcomingSequenceIterator for playback, by
      * making sure the parent UpcomingPlaylist has items to play if it is
      * empty.