Bug 231626 - Clicking Amarok URL crashes Amarok - segfault
Summary: Clicking Amarok URL crashes Amarok - segfault
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Tools/Bookmark Manager (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-22 09:56 UTC by Valorie Zimmerman
Modified: 2010-03-28 15:41 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.3.1


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valorie Zimmerman 2010-03-22 09:56:23 UTC
Application: amarok (2.2-GIT)
KDE Platform Version: 4.4.1 (KDE 4.4.1)
Qt Version: 4.6.2
Operating System: Linux 2.6.31-20-generic x86_64
Distribution: Ubuntu 9.10

-- Information about the crash:
Clicked amarok://navigate/internet%2FMagnatune.com?filter=artist%3A%22Leda%20Atomica%22&levels=artist-album  for an instant crash of today's git build. The same URL works if clicked while Amarok is running, and properly opens the album in Magnatune. When pasted into the Magnatune search bar, the album isn't opened.

The crash can be reproduced every time.

 -- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
The current source language is "auto; currently c".
[Current thread is 1 (Thread 0x7f7a8edbc810 (LWP 19026))]

Thread 8 (Thread 0x7f7a77e21910 (LWP 19027)):
#0  pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:220
#1  0x00007f7a7cbd6c91 in metronom_sync_loop (this=0x21a4860) at metronom.c:870
#2  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#3  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#4  0x0000000000000000 in ?? ()

Thread 7 (Thread 0x7f7a762a0910 (LWP 19028)):
#0  0x00007f7a8bcf1656 in pthread_mutex_unlock (mutex=0x21bb478) at forward.c:184
#1  0x00007f7a851dfdae in g_main_context_prepare () from /lib/libglib-2.0.so.0
#2  0x00007f7a851e0191 in ?? () from /lib/libglib-2.0.so.0
#3  0x00007f7a851e06c0 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#4  0x00007f7a8c630386 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#5  0x00007f7a8c605732 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#6  0x00007f7a8c605b0c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#7  0x00007f7a8c50fd59 in QThread::exec() () from /usr/lib/libQtCore.so.4
#8  0x00007f7a7ce32570 in Phonon::Xine::XineThread::run (this=0x21ae9d0) at ../../xine/xinethread.cpp:143
#9  0x00007f7a8c512775 in ?? () from /usr/lib/libQtCore.so.4
#10 0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#11 0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#12 0x0000000000000000 in ?? ()
The current source language is "auto; currently asm".

Thread 6 (Thread 0x7f7a75a9f910 (LWP 19029)):
#0  0x00007f7a8bcd63c3 in *__GI___poll (fds=<value optimized out>, nfds=<value optimized out>, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x00007f7a7720720f in poll_func (ufds=0x21c3450, nfds=2, timeout=-1, userdata=0x21c3020) at pulse/thread-mainloop.c:75
#2  0x00007f7a771f75e6 in pa_mainloop_poll (m=0x21c3050) at pulse/mainloop.c:879
#3  0x00007f7a771f8eb9 in pa_mainloop_iterate (m=0x21c3050, block=<value optimized out>, retval=0x0) at pulse/mainloop.c:961
#4  0x00007f7a771f8f70 in pa_mainloop_run (m=0x21c3050, retval=0x0) at pulse/mainloop.c:979
#5  0x00007f7a7720712b in thread (userdata=0x20efd20) at pulse/thread-mainloop.c:94
#6  0x00007f7a76fc8050 in internal_thread_func (userdata=0x21c31d0) at pulsecore/thread-posix.c:72
#7  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#8  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#9  0x0000000000000000 in ?? ()
The current source language is "auto; currently c".

Thread 5 (Thread 0x7f7a7129d910 (LWP 19030)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f7a7cbe7983 in fifo_peek_int (this_gen=<value optimized out>) at audio_out.c:348
#2  fifo_peek (this_gen=<value optimized out>) at audio_out.c:388
#3  ao_loop (this_gen=<value optimized out>) at audio_out.c:1015
#4  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 4 (Thread 0x7f7a6bfff910 (LWP 19031)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f7a7cbe7983 in fifo_peek_int (this_gen=<value optimized out>) at audio_out.c:348
#2  fifo_peek (this_gen=<value optimized out>) at audio_out.c:388
#3  ao_loop (this_gen=<value optimized out>) at audio_out.c:1015
#4  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()
The current source language is "auto; currently asm".

Thread 3 (Thread 0x7f7a6b7fe910 (LWP 19032)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f7a7cbe7983 in fifo_peek_int (this_gen=<value optimized out>) at audio_out.c:348
#2  fifo_peek (this_gen=<value optimized out>) at audio_out.c:388
#3  ao_loop (this_gen=<value optimized out>) at audio_out.c:1015
#4  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7f7a6affd910 (LWP 19033)):
#0  pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:261
#1  0x00007f7a7cbe7983 in fifo_peek_int (this_gen=<value optimized out>) at audio_out.c:348
#2  fifo_peek (this_gen=<value optimized out>) at audio_out.c:388
#3  ao_loop (this_gen=<value optimized out>) at audio_out.c:1015
#4  0x00007f7a8a137a04 in start_thread (arg=<value optimized out>) at pthread_create.c:300
#5  0x00007f7a8bce280d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#6  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7f7a8edbc810 (LWP 19026)):
[KCrash Handler]
#5  BrowserWidget::list (this=0x0) at /home/valorie/kde/src/amarok/src/browsers/BrowserWidget.cpp:55
#6  0x00007f7a8df82704 in NavigationUrlRunner::run (this=<value optimized out>, url=<value optimized out>) at /home/valorie/kde/src/amarok/src/amarokurls/NavigationUrlRunner.cpp:48
#7  0x00007f7a8df7d7bd in AmarokUrlHandler::run (this=<value optimized out>, url=) at /home/valorie/kde/src/amarok/src/amarokurls/AmarokUrlHandler.cpp:116
#8  0x00007f7a8df783e3 in AmarokUrl::run (this=0x7fff1f6bac50) at /home/valorie/kde/src/amarok/src/amarokurls/AmarokUrl.cpp:116
#9  0x00007f7a8dfed0be in App::handleCliArgs () at /home/valorie/kde/src/amarok/src/App.cpp:318
#10 0x00007f7a8dfee6b1 in App::newInstance (this=0x7fff1f6bd8d0) at /home/valorie/kde/src/amarok/src/App.cpp:939
#11 0x00007f7a8e7db056 in ?? () from /usr/lib/libkdeui.so.5
#12 0x00007f7a8e7db696 in ?? () from /usr/lib/libkdeui.so.5
#13 0x00007f7a8a37225e in ?? () from /usr/lib/libQtDBus.so.4
#14 0x00007f7a8a3734cf in ?? () from /usr/lib/libQtDBus.so.4
#15 0x00007f7a8a373fad in ?? () from /usr/lib/libQtDBus.so.4
#16 0x00007f7a8a374248 in ?? () from /usr/lib/libQtDBus.so.4
#17 0x00007f7a8c616b49 in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#18 0x00007f7a8cf8631d in QApplication::event(QEvent*) () from /usr/lib/libQtGui.so.4
#19 0x00007f7a8dfe695c in App::event (this=0x0, event=0x7fff1f6baa10) at /home/valorie/kde/src/amarok/src/App.cpp:906
#20 0x00007f7a8cf8212c in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#21 0x00007f7a8cf8871b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#22 0x00007f7a8dfe6f7a in App::notify (this=0x0, receiver=0x7fff1f6baa10, event=0x276cf80) at /home/valorie/kde/src/amarok/src/App.cpp:917
#23 0x00007f7a8c606e0c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#24 0x00007f7a8c609587 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#25 0x00007f7a8c6307f3 in ?? () from /usr/lib/libQtCore.so.4
#26 0x00007f7a851dcbce in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#27 0x00007f7a851e0598 in ?? () from /lib/libglib-2.0.so.0
#28 0x00007f7a851e06c0 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#29 0x00007f7a8c630333 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#30 0x00007f7a8d031f0e in ?? () from /usr/lib/libQtGui.so.4
#31 0x00007f7a8c605732 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#32 0x00007f7a8c605b0c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#33 0x00007f7a8d44b5fe in QDialog::exec() () from /usr/lib/libQtGui.so.4
#34 0x00007f7a85cefd98 in KBuildSycocaProgressDialog::rebuildKSycoca(QWidget*) () from /usr/lib/libkio.so.5
#35 0x00007f7a8de88797 in CollectionManager::init (this=<value optimized out>) at /home/valorie/kde/src/amarok/src/collection/CollectionManager.cpp:154
#36 0x00007f7a8de88f94 in CollectionManager (this=0x26782b0) at /home/valorie/kde/src/amarok/src/collection/CollectionManager.cpp:117
#37 0x00007f7a8de89088 in CollectionManager::instance () at /home/valorie/kde/src/amarok/src/collection/CollectionManager.cpp:94
#38 0x00007f7a8dda20f2 in SqlPodcastProvider (this=0x2758020) at /home/valorie/kde/src/amarok/src/podcasts/sql/SqlPodcastProvider.cpp:74
#39 0x00007f7a8df250a3 in PlaylistManager (this=0x2743010) at /home/valorie/kde/src/amarok/src/playlistmanager/PlaylistManager.cpp:70
#40 0x00007f7a8df251c8 in PlaylistManager::instance () at /home/valorie/kde/src/amarok/src/playlistmanager/PlaylistManager.cpp:54
#41 0x00007f7a8dc89e51 in Model (this=0x2607430, parent=<value optimized out>) at /home/valorie/kde/src/amarok/src/playlist/PlaylistModel.cpp:71
#42 0x00007f7a8dc8fdc4 in ModelStack (this=0x2621c30) at /home/valorie/kde/src/amarok/src/playlist/PlaylistModelStack.cpp:63
#43 0x00007f7a8dc8ff58 in Playlist::ModelStack::instance () at /home/valorie/kde/src/amarok/src/playlist/PlaylistModelStack.cpp:46
#44 0x00007f7a8dc8ffa9 in The::playlist () at /home/valorie/kde/src/amarok/src/playlist/PlaylistModelStack.cpp:28
#45 0x00007f7a8df6f865 in StatusBar (this=0x26057e0, parent=<value optimized out>) at /home/valorie/kde/src/amarok/src/statusbar/StatusBar.cpp:89
#46 0x00007f7a8e01bd33 in MainWindow (this=0x2604150) at /home/valorie/kde/src/amarok/src/MainWindow.cpp:158
#47 0x00007f7a8dfe8a05 in App::continueInit (this=0x7fff1f6bd8d0) at /home/valorie/kde/src/amarok/src/App.cpp:664
#48 0x00007f7a8dfeb951 in App (this=0x7fff1f6bd8d0) at /home/valorie/kde/src/amarok/src/App.cpp:211
#49 0x0000000000408768 in main (argc=2, argv=0x7fff1f6bf848) at /home/valorie/kde/src/amarok/src/main.cpp:235
The current source language is "auto; currently c".

Reported using DrKonqi
Comment 1 Nikolaj Hald Nielsen 2010-03-28 15:28:34 UTC
commit 4f3679d43f26c5a798694dbc82da4f14f518a4cb
Author: Nikolaj Hald Nielsen <nhn@kde.org>
Date:   Sun Mar 28 15:21:02 2010 +0200

    Delay running amarokurls passed on startup until the entire app has had a chance to initialize itself. This fixes a crash.
    
    BUG: 231626

diff --git a/src/App.cpp b/src/App.cpp
index df6a77f..7677f9b 100644
--- a/src/App.cpp
+++ b/src/App.cpp
@@ -109,6 +109,8 @@ extern void setupEventHandler_mac(long);
 #include "TestDirectoryLoader.h"
 #endif // DEBUG
 
+QStringList App::s_delayedAmarokUrls = QStringList();
+
 AMAROK_EXPORT KAboutData aboutData( "amarok", 0,
     ki18n( "Amarok" ), AMAROK_VERSION,
     ki18n( "The audio player for KDE" ), KAboutData::License_GPL,
@@ -307,8 +309,7 @@ App::handleCliArgs() //static
             }
             else if( url.protocol() == "amarok" )
             {
-                AmarokUrl aUrl( url.url() );
-                aUrl.run();
+                s_delayedAmarokUrls.append( url.url() );
             }
             else
             {
@@ -783,6 +784,15 @@ App::continueInit()
 
     // Using QTimer, so that we won't block the GUI
     QTimer::singleShot( 0, this, SLOT( checkCollectionScannerVersion() ) );
+
+    //and now we can run any amarokurls provided on startup, as all components should be initialized by now!
+    foreach( QString urlString, s_delayedAmarokUrls )
+    {
+        AmarokUrl aUrl( urlString );
+        aUrl.run();
+    }
+    s_delayedAmarokUrls.clear();
+    
 }
 
 void App::checkCollectionScannerVersion()  // SLOT
diff --git a/src/App.h b/src/App.h
index 0c1c961..4e6c4b0 100644
--- a/src/App.h
+++ b/src/App.h
@@ -112,6 +112,8 @@ class AMAROK_EXPORT App : public KUniqueApplication
         QPointer<MainWindow>    m_mainWindow;
         Amarok::TrayIcon        *m_tray;
         MediaDeviceManager      *m_mediaDeviceManager;
+
+        static QStringList       s_delayedAmarokUrls;
 };
 
 #define pApp static_cast<App*>(kapp)
diff --git a/src/browsers/BrowserWidget.cpp b/src/browsers/BrowserWidget.cpp
index fb2337d..011d0d2 100644
--- a/src/browsers/BrowserWidget.cpp
+++ b/src/browsers/BrowserWidget.cpp
@@ -26,6 +26,7 @@
 BrowserWidget::BrowserWidget( QWidget * parent )
     : KVBox( parent )
 {
+    DEBUG_BLOCK
     m_breadcrumbWidget = new BrowserBreadcrumbWidget( this );
     new HorizontalDivider( this );