Bug 246340 - Amarok crash on quit
Summary: Amarok crash on quit
Status: RESOLVED DUPLICATE of bug 245513
Alias: None
Product: amarok
Classification: Applications
Component: Context View/Albums (show other bugs)
Version: 2.3.1-GIT
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
: 246540 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-31 11:27 UTC by s.zelman
Modified: 2010-08-07 01:12 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
New crash information added by DrKonqi (29.41 KB, text/plain)
2010-08-01 22:23 UTC, Frédéric COIFFIER
Details
proposed patch (1.33 KB, patch)
2010-08-06 20:47 UTC, Martin Blumenstingl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description s.zelman 2010-07-31 11:27:28 UTC
Application: amarok (2.3.1)
KDE Platform Version: 4.4.95 (KDE 4.4.95 (KDE 4.5 >= 20100723))
Qt Version: 4.6.3
Operating System: Linux 2.6.34-ARCH x86_64
Distribution (Platform): Archlinux Packages

-- Information about the crash:
- What I was doing when the application crashed:
I try start Amarok, program don't start (don't display app window).

- Custom settings of the application:
I have Amarok splash screen disabled, i have all music data on another computer, accessable via NFS (wifi).

The crash can be reproduced some of the time.

-- Backtrace:
Application: Amarok (amarok), signal: Segmentation fault
[Current thread is 1 (Thread 0x7fdac1b9d780 (LWP 16166))]

Thread 3 (Thread 0x7fdaa68de710 (LWP 16224)):
#0  0x00007fdabcc8540c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fdabfc96b4b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007fdabb6ff1d6 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fdabb701583 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fdabb70047f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fdabb700508 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fdabfc96485 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007fdabcc80cb0 in start_thread () from /lib/libpthread.so.0
#8  0x00007fdabe81a7ad in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7fdaa2e74710 (LWP 16225)):
#0  0x00007fdabcc8540c in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/libpthread.so.0
#1  0x00007fdabfc96b4b in QWaitCondition::wait(QMutex*, unsigned long) () from /usr/lib/libQtCore.so.4
#2  0x00007fdabb6ff1d6 in ?? () from /usr/lib/libthreadweaver.so.4
#3  0x00007fdabb701583 in ?? () from /usr/lib/libthreadweaver.so.4
#4  0x00007fdabb70047f in ?? () from /usr/lib/libthreadweaver.so.4
#5  0x00007fdabb700508 in ThreadWeaver::Thread::run() () from /usr/lib/libthreadweaver.so.4
#6  0x00007fdabfc96485 in ?? () from /usr/lib/libQtCore.so.4
#7  0x00007fdabcc80cb0 in start_thread () from /lib/libpthread.so.0
#8  0x00007fdabe81a7ad in clone () from /lib/libc.so.6
#9  0x0000000000000000 in ?? ()

Thread 1 (Thread 0x7fdac1b9d780 (LWP 16166)):
[KCrash Handler]
#6  0x00007fdabf7436c4 in QGraphicsProxyWidget::widget() const () from /usr/lib/libQtGui.so.4
#7  0x00007fda9d9d1be0 in Albums::~Albums() () from /usr/lib/kde4/amarok_context_applet_albums.so
#8  0x00007fda9d9d1c29 in Albums::~Albums() () from /usr/lib/kde4/amarok_context_applet_albums.so
#9  0x00007fdabfd8e65d in QObject::event(QEvent*) () from /usr/lib/libQtCore.so.4
#10 0x00007fdabf77a51b in QGraphicsWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#11 0x00007fdabf175854 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#12 0x00007fdabf17993a in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#13 0x00007fdac15c4146 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#14 0x00007fdabfd7cd3c in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#15 0x00007fdabfd8049a in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQtCore.so.4
#16 0x00007fdabfda5323 in ?? () from /usr/lib/libQtCore.so.4
#17 0x00007fdab72bdb33 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#18 0x00007fdab72be310 in g_main_context_iterate () from /usr/lib/libglib-2.0.so.0
#19 0x00007fdab72be5ad in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#20 0x00007fdabfda582f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#21 0x00007fdabf21537e in ?? () from /usr/lib/libQtGui.so.4
#22 0x00007fdabfd7c122 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#23 0x00007fdabfd7c35c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#24 0x00007fdac1649fac in KWallet::Wallet::openWallet(QString const&, unsigned long, KWallet::Wallet::OpenType) () from /usr/lib/libkdeui.so.5
#25 0x00007fdaa4256b72 in LastFmServiceConfig::LastFmServiceConfig() () from /usr/lib/kde4/amarok_service_lastfm.so
#26 0x00007fdaa42446f7 in LastFmServiceFactory::createLastFmService() () from /usr/lib/kde4/amarok_service_lastfm.so
#27 0x00007fdaa42448ed in LastFmServiceFactory::init() () from /usr/lib/kde4/amarok_service_lastfm.so
#28 0x00007fdac0a2d2f5 in ServicePluginManager::init() () from /usr/lib/libamaroklib.so.1
#29 0x00007fdac0dc8927 in MainWindow::init() () from /usr/lib/libamaroklib.so.1
#30 0x00007fdac0dc9b81 in MainWindow::MainWindow() () from /usr/lib/libamaroklib.so.1
#31 0x00007fdac0d817b5 in App::continueInit() () from /usr/lib/libamaroklib.so.1
#32 0x00007fdac0d848df in App::App() () from /usr/lib/libamaroklib.so.1
#33 0x00000000004080ad in _start ()

Reported using DrKonqi
Comment 1 Myriam Schweingruber 2010-07-31 13:17:45 UTC
Sorry, but your backtrace is not useful, as you are lacking debugging symbols. If you can reproduce this bug, please check here on how to get a valid backtrace:

http://techbase.kde.org/Development/Tutorials/Debugging/How_to_create_useful_crash_reports
Comment 2 Frédéric COIFFIER 2010-08-01 22:23:58 UTC
Created attachment 49736 [details]
New crash information added by DrKonqi

amarok (2.3.1) on KDE Platform 4.4.95 (KDE 4.4.95 (KDE 4.5 >= 20100723)) using Qt 4.6.3

- What I was doing when the application crashed:

Sometimes, Amarok crashes when it's launched during the restoration of a KDE session.

-- Backtrace (Reduced):
#6  QGraphicsProxyWidget::widget (this=0x100000001) at graphicsview/qgraphicsproxywidget.cpp:736
#7  0x00007f9c7e4cf470 in ~Albums (this=0x41c06a0, __in_chrg=<value optimized out>) at /var/tmp/portage/media-sound/amarok-2.3.1-r2/work/amarok-2.3.1/src/context/applets/albums/Albums.cpp:54
#8  0x00000035a977573d in QObject::event (this=<value optimized out>, e=<value optimized out>) at kernel/qobject.cpp:1223
#9  0x0000003639bdfcfb in QGraphicsWidget::event (this=<value optimized out>, event=<value optimized out>) at graphicsview/qgraphicswidget.cpp:1355
#10 0x00000036395bb3bc in QApplicationPrivate::notify_helper (this=<value optimized out>, receiver=<value optimized out>, e=<value optimized out>) at kernel/qapplication.cpp:4302
Comment 3 Myriam Schweingruber 2010-08-02 00:01:47 UTC
Thank you for the feedback.
Comment 4 Myriam Schweingruber 2010-08-04 09:17:20 UTC
*** Bug 246540 has been marked as a duplicate of this bug. ***
Comment 5 Myriam Schweingruber 2010-08-04 09:18:49 UTC
From duplicate: Amarok 2.3.1-git doesn't crash on start anymore, but crashes on quit.
Comment 6 Shlomi Fish 2010-08-04 10:43:48 UTC
This bug is annoying. How can it be fixed?
Comment 7 Myriam Schweingruber 2010-08-04 11:35:38 UTC
A workaround would be to disable the Albums applet, as there is a destructor problem with it, but of course that is just a workaround.
Comment 8 Shlomi Fish 2010-08-04 19:37:08 UTC
(In reply to comment #7)
> A workaround would be to disable the Albums applet, as there is a destructor
> problem with it, but of course that is just a workaround.

OK, I've disabled the albums applet (had to do it by editing the relevant line in "amarok_homerc" because Amarok still crashed on exit after disabling the Albums' applet using the GUI). However, Amarok still crashes. What should I do now?
Comment 9 Myriam Schweingruber 2010-08-04 21:11:45 UTC
Do you get the same backtrace?
Comment 10 Shlomi Fish 2010-08-04 21:36:45 UTC
(In reply to comment #9)
> Do you get the same backtrace?

I'm getting this backtrace:

[quote]
(gdb) bt
#0  0xb6f96727 in QGraphicsProxyWidget::setWidget (this=0x0, widget=0x0)
    at graphicsview/qgraphicsproxywidget.cpp:593
#1  0xa4ef5825 in LyricsApplet::~LyricsApplet (this=0x8ad4a18, 
    __in_chrg=<value optimized out>)
    at /mnt/old-mandriva/Download/unpack/KDE/amarok/git/amarok/src/context/applets/lyrics/LyricsApplet.cpp:67
#2  0xb6391df3 in qDeleteInEventHandler (o=0x0) at kernel/qobject.cpp:3980
#3  0xb6394250 in QObject::event (this=0x8ad4a18, e=0xa4efe7f0)
    at kernel/qobject.cpp:1194
#4  0xb6fdbb44 in QGraphicsWidget::event (this=0x8ad4a18, event=0x8ad5298)
    at graphicsview/qgraphicswidget.cpp:1404
#5  0xb68b7e6c in QApplicationPrivate::notify_helper (this=0x8153d60, receiver=
    0x8ad4a18, e=0x8ad5298) at kernel/qapplication.cpp:4389
#6  0xb68bfc08 in QApplication::notify (this=0xbfffdd48, receiver=0x8ad4a18, e=
    0x8ad5298) at kernel/qapplication.cpp:4270
#7  0xb7d7e671 in KApplication::notify (this=0xbfffdd48, receiver=0x8ad4a18, 
    event=0x8ad5298)
    at /usr/src/debug/kdelibs-4.4.95/kdeui/kernel/kapplication.cpp:309
#8  0xb6380bae in QCoreApplication::notifyInternal (this=0xbfffdd48, receiver=
    0x8ad4a18, event=0x8ad5298) at kernel/qcoreapplication.cpp:732
#9  0xb6384e8c in sendEvent (receiver=0x0, event_type=52, data=0x80628f8)
    at kernel/qcoreapplication.h:215
#10 QCoreApplicationPrivate::sendPostedEvents (receiver=0x0, event_type=52, 
    data=0x80628f8) at kernel/qcoreapplication.cpp:1373
---Type <return> to continue, or q <return> to quit---
#11 0xb638504c in QCoreApplication::sendPostedEvents (receiver=0x0, event_type=
    52) at kernel/qcoreapplication.cpp:1266
#12 0xb6385160 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1016
#13 0xb68b6b54 in QApplication::exec () at kernel/qapplication.cpp:3665
#14 0x080526c7 in main (argc=3, argv=0xbfffe5d4)
    at /mnt/old-mandriva/Download/unpack/KDE/amarok/git/amarok/src/main.cpp:237
(gdb) frame 1
#1  0xa4ef5825 in LyricsApplet::~LyricsApplet (this=0x8ad4a18, 
    __in_chrg=<value optimized out>)
    at /mnt/old-mandriva/Download/unpack/KDE/amarok/git/amarok/src/context/applets/lyrics/LyricsApplet.cpp:67
67          m_proxy->setWidget( 0 );

[/quote]
Comment 11 Myriam Schweingruber 2010-08-04 21:42:34 UTC
Same destructor problem as bug 245513

*** This bug has been marked as a duplicate of bug 245513 ***
Comment 12 Martin Blumenstingl 2010-08-06 20:47:22 UTC
Created attachment 49889 [details]
proposed patch

Hi,

I've discussed this bug with Leo Franchi yesterday.
We are not sure why the null-pointer happens exactly, but we have a possible solution.

The reason why the LyricsApplet and the AlbumApplet are crashing is because a QGraphicsProxyWidget is accessed in their destructors.
Someone tried to free the memory of the QGraphicsProxyWidget's widget().

Unfortunately it's not necessary to clean up the widget() on your own, as Qt's documentation suggests:
http://doc.trolltech.com/4.4/qgraphicsproxywidget.html#dtor.QGraphicsProxyWidget

My solution was to remove the memory cleanup from the destructors.
Could more people please test my patch and report if it works (the patch should apply against the latest git master)?

Regards,
Martin
Comment 13 Shlomi Fish 2010-08-07 00:01:15 UTC
(In reply to comment #12)
> Created an attachment (id=49889) [details]
> proposed patch
> 
> Hi,
> 
> I've discussed this bug with Leo Franchi yesterday.
> We are not sure why the null-pointer happens exactly, but we have a possible
> solution.
> 
> The reason why the LyricsApplet and the AlbumApplet are crashing is because a
> QGraphicsProxyWidget is accessed in their destructors.
> Someone tried to free the memory of the QGraphicsProxyWidget's widget().
> 
> Unfortunately it's not necessary to clean up the widget() on your own, as Qt's
> documentation suggests:
> http://doc.trolltech.com/4.4/qgraphicsproxywidget.html#dtor.QGraphicsProxyWidget
> 
> My solution was to remove the memory cleanup from the destructors.
> Could more people please test my patch and report if it works (the patch should
> apply against the latest git master)?
> 

I'm on Mandriva Cooker and tried your patch and the lyrics applet crashed Amarok after I tried to remove it using the X button in the applets task bar. I can get you a backtrace tomorrow. 

> Regards,
> Martin
Comment 14 Myriam Schweingruber 2010-08-07 01:12:19 UTC
Please continue the discussions on bug 245513