Summary: | Crash when pressing stop from the tray [@ TextScrollingWidget::requirePlainText] | ||
---|---|---|---|
Product: | [Applications] amarok | Reporter: | Cyrille Dunant <cyrille.dunant> |
Component: | Context View | Assignee: | Amarok Developers <amarok-bugs-dist> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | andrey.raygorodskiy, arthur, gaboo, jclavel, leonardo.la.malfa, lfranchi, rara, saschpe, simon.esneault, slashdevdsp, valorie.zimmerman, wonko |
Priority: | NOR | ||
Version: | 2.3.1-GIT | ||
Target Milestone: | 2.3.2 | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 2.3.2 | |
Attachments: |
New crash information added by DrKonqi
New crash information added by DrKonqi New crash information added by DrKonqi |
Description
Cyrille Dunant
2010-08-05 03:02:26 UTC
*** Bug 246779 has been marked as a duplicate of this bug. *** Also happens with other applets... Created attachment 50010 [details]
New crash information added by DrKonqi
amarok (2.3-GIT) on KDE Platform 4.5.00 (KDE 4.5.0) using Qt 4.6.3
- What I was doing when the application crashed:
erased several tracks from a dynamic playlist
-- Backtrace (Reduced):
#6 TextScrollingWidget::requirePlainText (this=0x0) at /usr/src/debug/amarok/src/context/widgets/TextScrollingWidget.cpp:109
#7 0x00007fc04b0d2d69 in TextScrollingWidget::setText (this=0x0, text=...) at /usr/src/debug/amarok/src/context/widgets/TextScrollingWidget.cpp:84
#8 0x00007fc01667f9c4 in SimilarArtistsApplet::enginePlaybackEnded (this=0x1bb7860, finalPosition=<value optimized out>, trackLength=<value optimized out>)
at /usr/src/debug/amarok/src/context/applets/similarartists/SimilarArtistsApplet.cpp:264
#9 0x00007fc043962ec3 in Engine::EngineSubject::playbackEnded (this=<value optimized out>, finalPosition=1648, trackLength=292000, reason=Engine::EngineObserver::EndedStopped)
at /usr/src/debug/amarok/src/core/engine/EngineObserver.cpp:149
#10 0x00007fc04b71bee6 in EngineController::stop (this=0x97f360, forceInstant=false) at /usr/src/debug/amarok/src/EngineController.cpp:539
Created attachment 50118 [details]
New crash information added by DrKonqi
amarok (2.3-GIT) on KDE Platform 4.5.00 (KDE 4.5.0) using Qt 4.6.3
- What I was doing when the application crashed:
starting an internet radio station and resizing the (mis-painted) plasma dock widget
-- Backtrace (Reduced):
#6 TextScrollingWidget::requirePlainText (this=0x0) at /usr/src/debug/amarok/src/context/widgets/TextScrollingWidget.cpp:109
#7 0x00007f084237ed69 in TextScrollingWidget::setText (this=0x0, text=...) at /usr/src/debug/amarok/src/context/widgets/TextScrollingWidget.cpp:84
#8 0x00007f080deea9c4 in SimilarArtistsApplet::enginePlaybackEnded (this=0x1b64840, finalPosition=<value optimized out>, trackLength=<value optimized out>)
at /usr/src/debug/amarok/src/context/applets/similarartists/SimilarArtistsApplet.cpp:264
#9 0x00007f083ac0eec3 in Engine::EngineSubject::playbackEnded (this=<value optimized out>, finalPosition=4401, trackLength=0, reason=Engine::EngineObserver::EndedStopped)
at /usr/src/debug/amarok/src/core/engine/EngineObserver.cpp:149
#10 0x00007f08429c7ee6 in EngineController::stop (this=0x9853b0, forceInstant=false) at /usr/src/debug/amarok/src/EngineController.cpp:539
Sascha, thank you for the feedback. We don't need more backtraces, these are all the same anyway and the bug is already confirmed. The crash happens because the SimilarArtistsApplet is instantiated twice for some reason, but init() is only called once (and only one applet is shown). m_headerLabel is initialized in init(), so if init() is not called, m_headerLabel becomes the Null pointer which causes the crash. I did not find out yet why the applet is instantiated twice. (In reply to comment #6) > The crash happens because the SimilarArtistsApplet is instantiated twice for > some reason, but init() is only called once (and only one applet is shown). > m_headerLabel is initialized in init(), so if init() is not called, > m_headerLabel becomes the Null pointer which causes the crash. > I did not find out yet why the applet is instantiated twice. Could this be related to bug 245513? I think I remember the problem was the same... *** Bug 248477 has been marked as a duplicate of this bug. *** *** Bug 248724 has been marked as a duplicate of this bug. *** Here's some debug output showing how sometimes applets are loaded twice on startup, once by the Plasma::Corona (implicitly, we don't want that), and once by loadConfig (explicitly, what we want). amarok: BEGIN: virtual void ContextDock::polish() amarok: BEGIN: Context::VerticalToolbarContainment::VerticalToolbarContainment(QObject*, const QVariantList&) amarok: applet containment has corona: QObject(0x0) amarok: END__: Context::VerticalToolbarContainment::VerticalToolbarContainment(QObject*, const QVariantList&) - Took 0.0002s amarok: setting applets geom to QRectF(0,0 591x842) amarok: BEGIN: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) amarok: END__: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) - Took 0.00012s amarok: BEGIN: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) amarok: END__: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) - Took 7.1e-05s amarok: setting applets geom to QRectF(0,0 591x842) amarok: BEGIN: void ContextDock::createContextView(Plasma::Containment*) amarok: BEGIN: ContextSubject::ContextSubject() amarok: END__: ContextSubject::ContextSubject() - Took 8.8e-05s amarok: BEGIN: Context::ContextView::ContextView(Plasma::Containment*, Plasma::Corona*, QWidget*) amarok: BEGIN: virtual void Context::VerticalToolbarContainment::setView(Context::ContextView*) amarok: END__: virtual void Context::VerticalToolbarContainment::setView(Context::ContextView*) - Took 7.2e-05s amarok: BEGIN: void Context::AppletsListWidget::updateList() amarok: BEGIN: int Context::AppletsListWidget::maximumVisibleAppletsOnList() const amarok: model row count: 12 amarok: icon average size: 87.1667 amarok: visible rect size: 0 amarok: listTotalSize: 926 amarok: END__: int Context::AppletsListWidget::maximumVisibleAppletsOnList() const - Took 0.00018s amarok: visible icons: 0 amarok: END__: void Context::AppletsListWidget::updateList() - Took 0.00041s amarok: BEGIN: virtual void Context::AppletExplorer::resizeEvent(QGraphicsSceneResizeEvent*) amarok: BEGIN: virtual void Context::AppletsListWidget::resizeEvent(QGraphicsSceneResizeEvent*) amarok: BEGIN: int Context::AppletsListWidget::maximumVisibleAppletsOnList() const amarok: model row count: 12 amarok: icon average size: 87.1667 amarok: visible rect size: 46 amarok: listTotalSize: 926 amarok: END__: int Context::AppletsListWidget::maximumVisibleAppletsOnList() const - Took 0.00011s amarok: END__: virtual void Context::AppletsListWidget::resizeEvent(QGraphicsSceneResizeEvent*) - Took 0.00017s amarok: END__: virtual void Context::AppletExplorer::resizeEvent(QGraphicsSceneResizeEvent*) - Took 0.00031s amarok: END__: Context::ContextView::ContextView(Plasma::Containment*, Plasma::Corona*, QWidget*) - Took 0.49s amarok: applettoolbar created with a real containment amarok: BEGIN: void Context::ContextView::showHome() amarok: BEGIN: virtual void Context::VerticalToolbarContainment::loadConfig(const KConfigGroup&) amarok: plugins.size(): 5 amarok: Adding applet: "currenttrack" amarok: BEGIN: virtual Plasma::Applet* Context::VerticalToolbarContainment::addApplet(const QString&, int) amarok: BEGIN: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) amarok: END__: CurrentTrack::CurrentTrack(QObject*, const QVariantList&) - Took 8.5e-05s amarok: BEGIN: virtual void CurrentTrack::init() QGraphicsLinearLayout::removeAt: invalid index 1 amarok: BEGIN: CurrentEngine::CurrentEngine(QObject*, const QList<QVariant>&) amarok: BEGIN: void CurrentEngine::update() amarok: END__: void CurrentEngine::update() - Took 3.5e-05s amarok: END__: CurrentEngine::CurrentEngine(QObject*, const QList<QVariant>&) - Took 0.0002s amarok: BEGIN: virtual bool CurrentEngine::sourceRequestEvent(const QString&) amarok: END__: virtual bool CurrentEngine::sourceRequestEvent(const QString&) - Took 9e-05s amarok: BEGIN: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&) amarok: END__: void CurrentTrack::dataUpdated(const QString&, const QHash<QString, QVariant>&) - Took 3.7e-05s amarok: END__: virtual void CurrentTrack::init() - Took 0.1s amarok: layout told to add applet at -1 amarok: BEGIN: int Context::VerticalAppletLayout::minIndexWithAppletOnScreen(int) amarok: END__: int Context::VerticalAppletLayout::minIndexWithAppletOnScreen(int) - Took 3.9e-05s amarok: emitting addApplet with location 0 amarok: BEGIN: void Context::AppletToolbar::appletAdded(Plasma::Applet*, int) amarok: inserting applet icon in position 0 amarok: BEGIN: void Context::ToolbarView::appletAdded(Plasma::Applet*, int) amarok: END__: void Context::ToolbarView::appletAdded(Plasma::Applet*, int) - Took 7.3e-05s amarok: END__: void Context::AppletToolbar::appletAdded(Plasma::Applet*, int) - Took 0.0022s amarok: END__: virtual Plasma::Applet* Context::VerticalToolbarContainment::addApplet(const QString&, int) - Took 0.12s commit f7221fc674ec3fde1671954b989c12999ee3bd1c Author: Mark Kretschmann <kretschmann@kde.org> Date: Wed Aug 25 19:38:14 2010 +0200 Fix crash caused by applets being loaded twice. Behind our backs Plasma always stores the containment state in "amarok-appletsrc", including loaded applets. When Amarok crashes then the applet list will remain, and on next startup Plasma tries to load the applets in addition to our own loading, which again crashes. BUG: 246756 diff --git a/ChangeLog b/ChangeLog index 8cae766..53afc74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ VERSION 2.3.2 * Use system date/time format for default name when saving user playlists. BUGFIXES: + * Fixed potential crashes related to Applet loading. (BR 246756) * Fixed incorrect layout of applets on startup. * Fixed Collection Browser not properly updating after a full rescan, necessitating Amarok to be closed and reopened. Fixes various bugs. diff --git a/src/context/ContextScene.cpp b/src/context/ContextScene.cpp index adaff4e..f35e20b 100644 --- a/src/context/ContextScene.cpp +++ b/src/context/ContextScene.cpp @@ -20,6 +20,7 @@ #include "amarokconfig.h" #include "core/support/Debug.h" +#include <KStandardDirs> #include <plasma/containment.h> #include <plasma/theme.h> @@ -42,6 +43,12 @@ ContextScene::~ContextScene() void ContextScene::loadDefaultSetup() { + // Delete amarok-appletsrc config file (created by Plasma), because Plasma tries + // to load all applets listed in there, which can lead to duplicated applets which are + // not correctly initialized, and all sorts of crashes. + // See: BUG 246756 + QFile::remove( KStandardDirs::locateLocal( "config", "amarok-appletsrc", false ) ); + Plasma::Containment* c = addContainment( "amarok_containment_vertical" ); c->setScreen( -1 ); c->setFormFactor( Plasma::Planar ); *** Bug 249053 has been marked as a duplicate of this bug. *** *** Bug 248199 has been marked as a duplicate of this bug. *** *** Bug 247042 has been marked as a duplicate of this bug. *** *** Bug 249494 has been marked as a duplicate of this bug. *** *** Bug 249654 has been marked as a duplicate of this bug. *** commit a9c47b78a37b1c846495f759be3f3924a7ad7741 Author: Mark Kretschmann <kretschmann@kde.org> Date: Tue Sep 7 11:29:25 2010 +0200 Revert "Fix crash caused by applets being loaded twice." This reverts commit 5cf4947428c2b8e60c0e2ad6822c996676c71603. This reverts commit 330dbaebf6097320672ebfa80a91f92a6112ac75. This reverts commit f7221fc674ec3fde1671954b989c12999ee3bd1c. I seem to have fewer layout issues in the Context View without this patch, so it's probably better to remove it. However, some applets still show with wrong size, e.g. the VideoClip applet. We'll have to wait for the Plasma fixes in KDE 4.5.2. CCBUG: 246756 diff --git a/src/context/ContextScene.cpp b/src/context/ContextScene.cpp index 3ecf6f9..adaff4e 100644 --- a/src/context/ContextScene.cpp +++ b/src/context/ContextScene.cpp @@ -20,7 +20,6 @@ #include "amarokconfig.h" #include "core/support/Debug.h" -#include <KStandardDirs> #include <plasma/containment.h> #include <plasma/theme.h> @@ -43,17 +42,6 @@ ContextScene::~ContextScene() void ContextScene::loadDefaultSetup() { - // WORKAROUND for a bug in KDE 4.5.0 and 4.5.1: - // Delete amarok-appletsrc config file (created by Plasma), because Plasma tries - // to load all applets listed in there, which can lead to crashes due to applets - // being loaded twice. - // See: BUG 246756 - if( ( KDE::versionMajor() == 4 && KDE::versionMinor() == 5 && KDE::versionRelease() == 0 ) || - ( KDE::versionMajor() == 4 && KDE::versionMinor() == 5 && KDE::versionRelease() == 1 ) ) - { - QFile::remove( KStandardDirs::locateLocal( "config", "amarok-appletsrc", false ) ); - } - Plasma::Containment* c = addContainment( "amarok_containment_vertical" ); c->setScreen( -1 ); c->setFormFactor( Plasma::Planar ); Reopening, as the fix had to be reverted. Created attachment 51456 [details]
New crash information added by DrKonqi
amarok (2.3-GIT) on KDE Platform 4.5.1 (KDE 4.5.1) using Qt 4.7.0
- What I was doing when the application crashed:
Played a podcast, when the podcast ended, tha crash happend
Reproducible every time.
-- Backtrace (Reduced):
#6 0x00007f2553708322 in TextScrollingWidget::requirePlainText (this=0x0) at /home/myriam/kde/src/amarok/src/context/widgets/TextScrollingWidget.cpp:109
#7 0x00007f2553708278 in TextScrollingWidget::setText (this=0x0, text=...) at /home/myriam/kde/src/amarok/src/context/widgets/TextScrollingWidget.cpp:84
#8 0x00007f24fd164812 in SimilarArtistsApplet::enginePlaybackEnded (this=0x2b96540, finalPosition=0, trackLength=0)
at /home/myriam/kde/src/amarok/src/context/applets/similarartists/SimilarArtistsApplet.cpp:264
#9 0x00007f255476b2c4 in Engine::EngineSubject::playbackEnded (this=0x1103990, finalPosition=0, trackLength=0, reason=Engine::EngineObserver::EndedStopped)
at /home/myriam/kde/src/amarok/src/core/engine/EngineObserver.cpp:149
#10 0x00007f2553b0be02 in EngineController::slotQueueEnded (this=0x1103990) at /home/myriam/kde/src/amarok/src/EngineController.cpp:992
*** Bug 251187 has been marked as a duplicate of this bug. *** For reference, the Plasma patch for this issue is here: http://websvn.kde.org/?view=revision&revision=1169026 commit b73baeadaca62251be5c38d9f26e1779b0600a84 Author: Mark Kretschmann <kretschmann@kde.org> Date: Sun Sep 12 18:47:54 2010 +0200 Fix crash caused by applets being loaded twice. Behind our backs Plasma always stores the containment state in "amarok-appletsrc", including loaded applets. When Amarok crashes then the applet list will remain, and on next startup Plasma tries to load the applets in addition to our own loading, which again crashes. NOTE: This is a re-commit of a reverted patch. We can use this now since the layout issues have also been worked around. BUG: 246756 diff --git a/src/context/ContextScene.cpp b/src/context/ContextScene.cpp index adaff4e..3ecf6f9 100644 --- a/src/context/ContextScene.cpp +++ b/src/context/ContextScene.cpp @@ -20,6 +20,7 @@ #include "amarokconfig.h" #include "core/support/Debug.h" +#include <KStandardDirs> #include <plasma/containment.h> #include <plasma/theme.h> @@ -42,6 +43,17 @@ ContextScene::~ContextScene() void ContextScene::loadDefaultSetup() { + // WORKAROUND for a bug in KDE 4.5.0 and 4.5.1: + // Delete amarok-appletsrc config file (created by Plasma), because Plasma tries + // to load all applets listed in there, which can lead to crashes due to applets + // being loaded twice. + // See: BUG 246756 + if( ( KDE::versionMajor() == 4 && KDE::versionMinor() == 5 && KDE::versionRelease() == 0 ) || + ( KDE::versionMajor() == 4 && KDE::versionMinor() == 5 && KDE::versionRelease() == 1 ) ) + { + QFile::remove( KStandardDirs::locateLocal( "config", "amarok-appletsrc", false ) ); + } + Plasma::Containment* c = addContainment( "amarok_containment_vertical" ); c->setScreen( -1 ); c->setFormFactor( Plasma::Planar ); |