Bug 302607 - Immediate crash when starting
Summary: Immediate crash when starting
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: general (show other bugs)
Version: 2.5.0
Platform: Debian testing Linux
: NOR crash
Target Milestone: 2.6
Assignee: Amarok Developers
URL:
Keywords:
: 302650 303966 310171 312312 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-06-27 04:10 UTC by Aaron Hughes
Modified: 2012-12-30 16:03 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.6


Attachments
The patch prevents a playlist scanning crash during startup (485 bytes, patch)
2012-07-14 17:55 UTC, bjoernv
Details
New crash information added by DrKonqi (8.11 KB, text/plain)
2012-07-24 21:22 UTC, Marco
Details
New crash information added by DrKonqi (7.89 KB, text/plain)
2012-12-30 15:32 UTC, cad-heinrich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Hughes 2012-06-27 04:10:38 UTC
Application: amarok (2.5.0)
KDE Platform Version: 4.8.3 (4.8.3)
Qt Version: 4.8.2
Operating System: Linux 3.2.0-2-amd64 x86_64
Distribution: Debian GNU/Linux testing (wheezy)

-- Information about the crash:
- What I was doing when the application crashed:

I attempted to start Amarok from the KDE menu and it crashed as the splash screen was being displayed.  The same behavior was seen when starting it from the command line.

The crash can be reproduced every time.

-- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0x7f2f9365d780 (LWP 11059))]

Thread 4 (Thread 0x7f2f6c51b700 (LWP 11062)):
#0  0x00007f2f8ff6ca93 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f2f871a0e3f in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#2  0x00007f2f8719239c in pa_mainloop_poll () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#3  0x00007f2f871929f9 in pa_mainloop_iterate () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#4  0x00007f2f87192ab0 in pa_mainloop_run () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#5  0x00007f2f871a0def in ?? () from /usr/lib/x86_64-linux-gnu/libpulse.so.0
#6  0x00007f2f7eab6423 in ?? () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-2.0.so
#7  0x00007f2f8c797b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#8  0x00007f2f8ff776dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()

Thread 3 (Thread 0x7f2f686ca700 (LWP 11064)):
#0  0x00007f2f8ff6ca93 in *__GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f2f899474d4 in ?? () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#2  0x00007f2f899475f4 in g_main_context_iteration () from /lib/x86_64-linux-gnu/libglib-2.0.so.0
#3  0x00007f2f908ee306 in QEventDispatcherGlib::processEvents (this=0x1b23470, flags=...) at kernel/qeventdispatcher_glib.cpp:426
#4  0x00007f2f908be92f in QEventLoop::processEvents (this=this@entry=0x7f2f686c9df0, flags=...) at kernel/qeventloop.cpp:149
#5  0x00007f2f908bebb8 in QEventLoop::exec (this=0x7f2f686c9df0, flags=...) at kernel/qeventloop.cpp:204
#6  0x00007f2f907c1d70 in QThread::exec (this=<optimized out>) at thread/qthread.cpp:501
#7  0x00007f2f9089f23f in QInotifyFileSystemWatcherEngine::run (this=0x1af9fe0) at io/qfilesystemwatcher_inotify.cpp:248
#8  0x00007f2f907c4d0b in QThreadPrivate::start (arg=0x1af9fe0) at thread/qthread_unix.cpp:307
#9  0x00007f2f8c797b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#10 0x00007f2f8ff776dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#11 0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f2f651ba700 (LWP 11065)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162
#1  0x00007f2f907c520b in wait (time=18446744073709551615, this=0x1d8f490) at thread/qwaitcondition_unix.cpp:86
#2  QWaitCondition::wait (this=<optimized out>, mutex=0x1d8f610, time=18446744073709551615) at thread/qwaitcondition_unix.cpp:158
#3  0x00007f2f8dd36301 in ThreadWeaver::WeaverImpl::blockThreadUntilJobsAreBeingAssigned (this=0x1d8f340, th=0x1d8f9d0) at ../../../threadweaver/Weaver/WeaverImpl.cpp:365
#4  0x00007f2f8dd38b4b in ThreadWeaver::WorkingHardState::applyForWork (this=0x1d8d4a0, th=0x1d8f9d0) at ../../../threadweaver/Weaver/WorkingHardState.cpp:71
#5  0x00007f2f8dd379bf in ThreadWeaver::ThreadRunHelper::run (this=this@entry=0x7f2f651b9e20, parent=0x1d8f340, th=th@entry=0x1d8f9d0) at ../../../threadweaver/Weaver/Thread.cpp:87
#6  0x00007f2f8dd37a4b in ThreadWeaver::Thread::run (this=0x1d8f9d0) at ../../../threadweaver/Weaver/Thread.cpp:142
#7  0x00007f2f907c4d0b in QThreadPrivate::start (arg=0x1d8f9d0) at thread/qthread_unix.cpp:307
#8  0x00007f2f8c797b50 in start_thread (arg=<optimized out>) at pthread_create.c:304
#9  0x00007f2f8ff776dd in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f2f9365d780 (LWP 11059)):
[KCrash Handler]
#6  Playlist::TrackNavigator::queueIds (this=0x1db9f50, ids=...) at ../../src/playlist/navigators/TrackNavigator.cpp:61
#7  0x00007f2f92388e4f in Playlist::TrackNavigator::queueId (this=0x1db9f50, id=0) at ../../src/playlist/navigators/TrackNavigator.cpp:51
#8  0x00007f2f9230abfa in Playlist::Actions::queue (this=this@entry=0x1d9f8c0, rows=...) at ../../src/playlist/PlaylistActions.cpp:400
#9  0x00007f2f9230d7c7 in Playlist::Actions::restoreDefaultPlaylist (this=this@entry=0x1d9f8c0) at ../../src/playlist/PlaylistActions.cpp:514
#10 0x00007f2f9230dce2 in Playlist::Actions::init (this=this@entry=0x1d9f8c0) at ../../src/playlist/PlaylistActions.cpp:94
#11 0x00007f2f9230dd40 in Playlist::Actions::instance () at ../../src/playlist/PlaylistActions.cpp:59
#12 0x00007f2f92655169 in MainWindow::createActions (this=this@entry=0x1ad0da0) at ../../src/MainWindow.cpp:697
#13 0x00007f2f9265f1f2 in MainWindow::MainWindow (this=0x1ad0da0) at ../../src/MainWindow.cpp:145
#14 0x00007f2f92639598 in App::continueInit (this=this@entry=0x7ffff3496280) at ../../src/App.cpp:545
#15 0x00007f2f9263ae67 in App::App (this=0x7ffff3496280) at ../../src/App.cpp:185
#16 0x0000000000408f3d in main (argc=1, argv=0x7ffff34963e8) at ../../src/main.cpp:301

This bug may be a duplicate of or related to bug 280769.

Possible duplicates by query: bug 280769.

Reported using DrKonqi
Comment 1 Aaron Hughes 2012-06-27 11:15:50 UTC
I think I had songs in the queue when I last closed Amarok.  Is there a way to clear the queue without running Amarok?
Comment 2 Myriam Schweingruber 2012-06-28 17:41:35 UTC
You should be able to remove the queue by erasing this file: $HOME/.kde/share/apps/amarok/current.xspf

Not much we can do unfortunately if this is due to a corrupt playlist file. Could you please tell if this solved the issue?
Comment 3 Myriam Schweingruber 2012-06-28 17:42:14 UTC
*** Bug 302650 has been marked as a duplicate of this bug. ***
Comment 4 Aaron Hughes 2012-06-28 23:09:32 UTC
(In reply to comment #2)
> You should be able to remove the queue by erasing this file:
> $HOME/.kde/share/apps/amarok/current.xspf
> 
> Not much we can do unfortunately if this is due to a corrupt playlist file.
> Could you please tell if this solved the issue?

I looked at that file and there was 1 item in the queue.  I edited the file to remove all items from the queue and that fixed the problem.

  <extension application="http://amarok.kde.org">
    <queue/>
  </extension>

Thanks for your help.
Comment 5 Myriam Schweingruber 2012-06-28 23:28:15 UTC
Thank you for the fast feedback :)
Comment 6 bjoernv 2012-07-14 17:55:43 UTC
Created attachment 72523 [details]
The patch prevents a playlist scanning crash during startup

My Amarok also crashed in Playlist::TrackNavigator::queueIds. Editing or deleting the file $HOME/.kde/share/apps/amarok/current.xspf did not solve the crash.

In a debugging session I found, that the variable track can be NULL in  Playlist::TrackNavigator::queueIds:

void
Playlist::TrackNavigator::queueIds( const QList<quint64> &ids )
{
    Meta::TrackPtr track;
    foreach( quint64 id, ids )
    {
        track = m_model->trackForId( id );
        if( !m_queue.contains( id ) && track->isPlayable() )
            m_queue.enqueue( id );
    }
}

Adding a check for track != NULL solved the problem for me. Amarok now starts without a crash.

Please take a look at the attached patch. 

Please consider to reopen this bug.
Comment 7 Myriam Schweingruber 2012-07-16 22:33:51 UTC
Your patch has not much to do with a corrupt playlist, I closed it based on your own feedback...

In any case, please submit patches to http://reviewboard.kde.org with a reference to the relevant bug report.
Comment 8 Marco 2012-07-24 21:22:21 UTC
Created attachment 72737 [details]
New crash information added by DrKonqi

amarok (2.5.0) on KDE Platform 4.8.4 (4.8.4) using Qt 4.8.1

I just started the application and it crashed unexpectedly

-- Backtrace (Reduced):
#7  Playlist::TrackNavigator::queueIds (this=0x9ed6490, ids=...) at ../../src/playlist/navigators/TrackNavigator.cpp:61
#8  0xb6c892ce in Playlist::TrackNavigator::queueId (this=0x9ed6490, id=0) at ../../src/playlist/navigators/TrackNavigator.cpp:51
#9  0xb6bf8dbe in Playlist::Actions::queue (this=0x9ec00a8, rows=...) at ../../src/playlist/PlaylistActions.cpp:400
#10 0xb6bfe89f in Playlist::Actions::restoreDefaultPlaylist (this=0x0) at ../../src/playlist/PlaylistActions.cpp:514
#11 0xb6bfed7a in Playlist::Actions::init (this=0x9ec00a8) at ../../src/playlist/PlaylistActions.cpp:94
Comment 9 Myriam Schweingruber 2012-07-25 03:22:59 UTC
*** Bug 303966 has been marked as a duplicate of this bug. ***
Comment 10 Ralf Engels 2012-08-08 16:00:41 UTC
Git commit 352c20df7abb396770f1f78dc868cb4b94d01789 by Ralf Engels.
Committed on 08/08/2012 at 17:53.
Pushed by rengels into branch 'master'.

Fix some more playlist related problems.

The assumption was that a playlist always contains valid tracks.
However that does not seem to be the case.

Scenario: Tracks are deleted from collection but not from playlist.

So, when handling playlist tracks, make sure that there is an actual
track object behind it.
FIXED-IN: 2.6

M  +2    -2    ChangeLog
M  +3    -0    src/core-impl/playlists/types/file/pls/PLSPlaylist.cpp
M  +2    -0    src/core-impl/playlists/types/file/xspf/XSPFPlaylist.cpp
M  +2    -0    src/playlist/navigators/TrackNavigator.cpp

http://commits.kde.org/amarok/352c20df7abb396770f1f78dc868cb4b94d01789
Comment 11 Myriam Schweingruber 2012-11-15 23:18:33 UTC
*** Bug 310171 has been marked as a duplicate of this bug. ***
Comment 12 Myriam Schweingruber 2012-12-28 20:12:18 UTC
*** Bug 312312 has been marked as a duplicate of this bug. ***
Comment 13 cad-heinrich 2012-12-30 15:32:17 UTC
Created attachment 76093 [details]
New crash information added by DrKonqi

amarok (2.5.0) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.1

Error appeared suddenly. No chance to start amarok.

-- Backtrace (Reduced):
#7  Playlist::TrackNavigator::queueIds (this=0x9e63d10, ids=...) at ../../src/playlist/navigators/TrackNavigator.cpp:61
#8  0x00fce2ce in Playlist::TrackNavigator::queueId (this=0x9e63d10, id=0) at ../../src/playlist/navigators/TrackNavigator.cpp:51
#9  0x00f3ddbe in Playlist::Actions::queue (this=0x9ee4d68, rows=...) at ../../src/playlist/PlaylistActions.cpp:400
#10 0x00f4389f in Playlist::Actions::restoreDefaultPlaylist (this=0x0) at ../../src/playlist/PlaylistActions.cpp:514
#11 0x00f43d7a in Playlist::Actions::init (this=0x9ee4d68) at ../../src/playlist/PlaylistActions.cpp:94
Comment 14 Myriam Schweingruber 2012-12-30 16:03:29 UTC
(In reply to comment #13)
> Created attachment 76093 [details]
> New crash information added by DrKonqi
> 
> amarok (2.5.0) on KDE Platform 4.8.5 (4.8.5) using Qt 4.8.1

Please do not add backtraces to a bug that is fixed in a version ahead of yours, instead install Amarok 2.6, the 2.5 version is rather outdated now.