Bug 193780

Summary: Closing akregator causes crash (incl. Kontact-with-akregator)
Product: [Applications] akregator Reporter: Michał Kudła <m1k0>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: crash CC: alboz, bruno, cfeck, DBA, dreibh, frederic.coiffier, heri+kde, hrvoje.senjan, jemand, kde, marko.gabriel.cz, maxim.stargazer, mourka, mpyne, nicotra.andrea, rasasi78, sayeed.ka, sven.burmeister, xosecalvo, yodayado, yohan.pereira
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Unlisted Binaries   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: New crash information added by DrKonqi
New crash information added by DrKonqi
Valgrind log of Akregator shut down.
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi
New crash information added by DrKonqi

Description Michał Kudła 2009-05-23 17:40:41 UTC
Application that crashed: kontact
Version of the application: 4.3.0 pre
KDE Version: 4.2.87 (KDE 4.2.87 (KDE 4.3 >= 20090519))
Qt Version: 4.5.1
Operating System: Linux 2.6.28-gentoo-r2 i686
Distribution: "Gentoo Base System release 2.0.0"

What I was doing when the application crashed:
crash after luanch Kontact with KMail.
Thi is done after I lost may all configs after loosing my free space on hard disk

 -- Backtrace:
Application: Kontact (kontact), signal: Segmentation fault
[KCrash Handler]
#6  0x50734900 in ?? ()
#7  0xad1304f2 in Akregator::Feed::unread (this=0x95f2c80) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/feed.cpp:742
#8  0xad13927c in Akregator::Folder::updateUnreadCount (this=0x91330c8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/folder.cpp:310
#9  0xad139af6 in Akregator::Folder::removeChild (this=0x91330c8, node=0x9213fe8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/folder.cpp:255
#10 0xad1381a0 in Akregator::TreeNode::emitSignalDestroyed (this=0x9213fe8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/treenode.cpp:73
#11 0xad132ed2 in ~Feed (this=0x9213fe8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/feed.cpp:319
#12 0xad13b641 in qDeleteAll<QList<Akregator::TreeNode*>::const_iterator> (begin={i = 0xbfeba6ac}, end={i = 0xbfeba6a8}) at /usr/include/qt4/QtCore/qalgorithms.h:350
#13 0xad13b9f8 in qDeleteAll<QList<Akregator::TreeNode*> > (c=@0x8f826cc) at /usr/include/qt4/QtCore/qalgorithms.h:358
#14 0xad13b1d9 in ~FolderPrivate (this=0x8f826c8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/folder.cpp:68
#15 0xad13b28c in ~Folder (this=0x91330c8) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/folder.cpp:95
#16 0xad1400fd in Akregator::FeedList::setRootNode (this=0x91cad90, folder=0x0) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/feedlist.cpp:435
#17 0xad140adf in ~FeedList (this=0x91cad90) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/feedlist.cpp:315
#18 0xad17fe28 in boost::checked_delete<Akregator::FeedList> (x=0x95f2dc0) at /usr/include/boost/checked_delete.hpp:34
#19 0xad17feca in boost::detail::sp_counted_impl_p<Akregator::FeedList>::dispose (this=0x920d638) at /usr/include/boost/detail/sp_counted_impl.hpp:78
#20 0xad124a6c in boost::detail::sp_counted_base::release (this=0x920d638) at /usr/include/boost/detail/sp_counted_base_gcc_x86.hpp:145
#21 0xad124a9f in ~shared_count (this=0x9224df0) at /usr/include/boost/detail/shared_count.hpp:204
#22 0xad127146 in ~shared_ptr (this=0x9224dec) at /usr/include/boost/shared_ptr.hpp:148
#23 0xad1274fd in ~ArticleDeleteJob (this=0x9224de0) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/articlejobs.h:66
#24 0xb5c2bb1d in QObjectPrivate::deleteChildren () from /usr/lib/qt4/libQtCore.so.4
#25 0xb5c334fc in QObject::~QObject () from /usr/lib/qt4/libQtCore.so.4
#26 0xb1d73c9c in ~Command (this=0x91b4310) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/interfaces/command.cpp:52
#27 0xad16326a in ~ExpireItemsCommand (this=0x91b4310) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/expireitemscommand.cpp:111
#28 0xb5c2bb1d in QObjectPrivate::deleteChildren () from /usr/lib/qt4/libQtCore.so.4
#29 0xb608b8d2 in QWidget::~QWidget () from /usr/lib/qt4/libQtGui.so.4
#30 0xad195abc in ~MainWidget (this=0x87efe78) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/mainwidget.cpp:102
#31 0xb6e3de47 in ~Part (this=0x87e5840, __vtt_parm=0xad1f45e8) at /var/tmp/portage/kde-base/kdelibs-4.2.87/work/kdelibs-4.2.87/kparts/part.cpp:208
#32 0xb6e3dfd3 in ~ReadOnlyPart (this=0x87e5840, __vtt_parm=0xad1f45e4) at /var/tmp/portage/kde-base/kdelibs-4.2.87/work/kdelibs-4.2.87/kparts/part.cpp:459
#33 0xad18e6b2 in ~Part (this=0x87e5840) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/akregator/src/akregator_part.cpp:315
#34 0xb77ca545 in ~Plugin (this=0x865a430, __vtt_parm=0x29) at /var/tmp/portage/kde-base/kontactinterfaces-4.2.87/work/kontactinterfaces-4.2.87/kontactinterfaces/plugin.cpp:86
#35 0xb1b5743e in ~AkregatorPlugin (this=0x865a430) at /var/tmp/portage/kde-base/akregator-4.2.87/work/akregator-4.2.87/kontact/plugins/akregator/akregator_plugin.cpp:65
#36 0xb77e7902 in ~MainWindow (this=0x8173648) at /var/tmp/portage/kde-base/kontact-4.2.87/work/kontact-4.2.87/kontact/src/mainwindow.cpp:271
#37 0xb5c2b7e5 in qDeleteInEventHandler () from /usr/lib/qt4/libQtCore.so.4
#38 0xb5c2d3eb in QObject::event () from /usr/lib/qt4/libQtCore.so.4
#39 0xb6094458 in QWidget::event () from /usr/lib/qt4/libQtGui.so.4
#40 0xb642799f in QMainWindow::event () from /usr/lib/qt4/libQtGui.so.4
#41 0xb69ec293 in KMainWindow::event (this=0x9d24918, ev=0x9d24918) at /var/tmp/portage/kde-base/kdelibs-4.2.87/work/kdelibs-4.2.87/kdeui/widgets/kmainwindow.cpp:1094
#42 0xb6a27eec in KXmlGuiWindow::event (this=0x8173648, ev=0x9d24918) at /var/tmp/portage/kde-base/kdelibs-4.2.87/work/kdelibs-4.2.87/kdeui/xmlgui/kxmlguiwindow.cpp:131
#43 0xb6040f1c in QApplicationPrivate::notify_helper () from /usr/lib/qt4/libQtGui.so.4
#44 0xb6049b0a in QApplication::notify () from /usr/lib/qt4/libQtGui.so.4
#45 0xb69203d0 in KApplication::notify (this=0xbfec2de8, receiver=0x8173648, event=0x9d24918) at /var/tmp/portage/kde-base/kdelibs-4.2.87/work/kdelibs-4.2.87/kdeui/kernel/kapplication.cpp:302
#46 0xb5c1db72 in QCoreApplication::notifyInternal () from /usr/lib/qt4/libQtCore.so.4
#47 0xb5c1e4b2 in QCoreApplicationPrivate::sendPostedEvents () from /usr/lib/qt4/libQtCore.so.4
#48 0xb5c1e64e in QCoreApplication::sendPostedEvents () from /usr/lib/qt4/libQtCore.so.4
#49 0xb5c45d80 in ?? () from /usr/lib/qt4/libQtCore.so.4
#50 0x00000000 in ?? ()
Comment 1 Christophe Marin 2009-10-23 17:02:51 UTC
*** Bug 197845 has been marked as a duplicate of this bug. ***
Comment 2 Nicolas L. 2010-06-25 15:32:37 UTC
*** Bug 242757 has been marked as a duplicate of this bug. ***
Comment 3 Christophe Marin 2010-07-05 14:26:14 UTC
*** Bug 243567 has been marked as a duplicate of this bug. ***
Comment 4 Christophe Marin 2010-10-18 14:38:33 UTC
*** Bug 254479 has been marked as a duplicate of this bug. ***
Comment 5 Christophe Marin 2011-02-06 14:00:32 UTC
*** Bug 265518 has been marked as a duplicate of this bug. ***
Comment 6 S. Burmeister 2011-02-21 17:07:17 UTC
Created attachment 57418 [details]
New crash information added by DrKonqi

kontact (4.4.10) on KDE Platform 4.6.00 (4.6.0) using Qt 4.7.1

- What I was doing when the application crashed:

I just tried to log off and shut down. Nothing else.

-- Backtrace (Reduced):
#7  0x00000000004041bf in qDeleteAll<QList<KMainWindow*>::const_iterator> (argc=1, argv=0x7fff29933a48) at /usr/include/QtCore/qalgorithms.h:322
#8  qDeleteAll<QList<KMainWindow*> > (argc=1, argv=0x7fff29933a48) at /usr/include/QtCore/qalgorithms.h:330
#9  main (argc=1, argv=0x7fff29933a48) at /usr/src/debug/kdepim-4.4.10/kontact/src/main.cpp:225
Comment 7 Christophe Marin 2011-04-20 14:45:10 UTC
*** Bug 271338 has been marked as a duplicate of this bug. ***
Comment 8 Christophe Marin 2011-07-05 22:01:48 UTC
*** Bug 270623 has been marked as a duplicate of this bug. ***
Comment 9 Bruno Friedmann 2011-07-20 10:18:47 UTC
Created attachment 62012 [details]
New crash information added by DrKonqi

kontact (4.7 rc2) on KDE Platform 4.6.95 (4.7 RC2) "release 1" using Qt 4.7.3

Seems to bug in 4.7 and qt 4.73

-- Backtrace (Reduced):
#6  0x00007ffd623c35e4 in Akregator::Feed::unread (this=<optimized out>) at /usr/src/debug/kdepim-4.6.95/akregator/src/feed.cpp:749
#7  0x00007ffd623db240 in Akregator::Folder::updateUnreadCount (this=0x36bcef0) at /usr/src/debug/kdepim-4.6.95/akregator/src/folder.cpp:310
#8  0x00007ffd623db4dc in Akregator::Folder::removeChild (this=0x36bcef0, node=0xa1ed60) at /usr/src/debug/kdepim-4.6.95/akregator/src/folder.cpp:255
#9  0x00007ffd623d2505 in Akregator::TreeNode::emitSignalDestroyed (this=0xa1ed60) at /usr/src/debug/kdepim-4.6.95/akregator/src/treenode.cpp:74
#10 0x00007ffd623c56b9 in Akregator::Feed::~Feed (this=0xa1ed60, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.6.95/akregator/src/feed.cpp:319
Comment 10 Christophe Marin 2011-08-01 09:33:36 UTC
*** Bug 278742 has been marked as a duplicate of this bug. ***
Comment 11 Christophe Marin 2011-09-07 17:16:46 UTC
*** Bug 281564 has been marked as a duplicate of this bug. ***
Comment 12 Michael Pyne 2011-10-22 22:21:40 UTC
Confirming the bug as I now constantly seem to hit it. :(

This bug occurs for me on Akregator shutdown, even if I run akregator by itself. All that is required to reproduce for me is to quit the application.

After running it through Valgrind the issue seems to be (IMO) that some TreeNode* entry is being free'd twice during shutdown. Most likely seems to be that a TreeNode* is free'd directly and then as a child of a Folder::FolderPrivate somewhere (that was not updated from the first time the TreeNode* was deleted). I will attach the Valgrind log as well.

Is there any easy way to check how a Folder would end up hanging onto a Feed's child?
Comment 13 Michael Pyne 2011-10-22 22:25:21 UTC
Created attachment 64799 [details]
Valgrind log of Akregator shut down.

valgrind output from: valgrind --tool=memcheck --num-callers=40 --track-origins=yes akregator --nofork --nocrashhandler.

Seems to show in this case that FolderPrivate's dtor is trying to run qDeleteAll over a TreeNode* that had already been deleted by a Feed (feed.cpp:322)
Comment 14 Michael Pyne 2011-10-30 19:00:20 UTC
A potential fix is being reviewed at https://git.reviewboard.kde.org/r/102981/

The issue seems to be that the list iterator used by qDeleteAll is invalidated by the actions of the destructors of the items being deleted, which makes sense in retrospect since the "children" list seems to be getting modified as part of the delete action.
Comment 15 Christoph Feck 2011-11-04 14:47:49 UTC
Michael, did you try if the patch fixes this crash?
Comment 16 Christoph Feck 2011-11-04 14:48:27 UTC
*** Bug 285753 has been marked as a duplicate of this bug. ***
Comment 17 Michael Pyne 2011-11-04 21:24:03 UTC
I'm sorry, should have replied. The patch does indeed fix the crash-on-shutdown behavior from qDeleteAll for me.
Comment 18 Hrvoje Senjan 2011-11-05 07:28:42 UTC
Created attachment 65253 [details]
New crash information added by DrKonqi

akregator (4.7.3) on KDE Platform 4.7.3 (4.7.3) "release 457" using Qt 4.8.0

- What I was doing when the application crashed:

Closed akregator and drkonqi reported it crashed - using KDE 4.7.3 + qt 4.8

-- Backtrace (Reduced):
#6  0x00007fc20f9df823 in qDeleteAll<QList<Akregator::TreeNode*>::const_iterator> (end=<optimized out>, begin=<optimized out>) at /usr/include/QtCore/qalgorithms.h:322
#7  qDeleteAll<QList<Akregator::TreeNode*> > (c=...) at /usr/include/QtCore/qalgorithms.h:330
#8  Akregator::Folder::FolderPrivate::~FolderPrivate (this=0xcbb380, __in_chrg=<optimized out>) at /usr/src/debug/kdepim-4.7.3/akregator/src/folder.cpp:68
#9  0x00007fc20f9df8c0 in Akregator::Folder::~Folder (this=0xcac490, __in_chrg=<optimized out>) at /usr/src/debug/kdepim-4.7.3/akregator/src/folder.cpp:95
#10 0x00007fc20f9df909 in Akregator::Folder::~Folder (this=0xcac490, __in_chrg=<optimized out>) at /usr/src/debug/kdepim-4.7.3/akregator/src/folder.cpp:97
Comment 19 Christoph Feck 2011-11-07 20:36:32 UTC
Git commit 6ae89eee936159dd7d7ca3405fbe6d9d66d86ddd by Christoph Feck.
Committed on 07/11/2011 at 21:29.
Pushed by cfeck into branch 'KDE/4.7'.

Fix crash in Folder destructor

Especially visible with Qt 4.8.0 qDeleteAll() changes, but might also
fix older bugs.

BUG: 285938
CCBUG: 193780
FIXED-IN: 4.7.4
REVIEW: 102981
(cherry picked from commit 3497e5afe51490191825c7b7d475a5fc0702988d)

M  +4    -1    akregator/src/folder.cpp

http://commits.kde.org/kdepim/6ae89eee936159dd7d7ca3405fbe6d9d66d86ddd
Comment 20 Christoph Feck 2011-11-07 20:36:36 UTC
Git commit 3497e5afe51490191825c7b7d475a5fc0702988d by Christoph Feck.
Committed on 07/11/2011 at 21:29.
Pushed by cfeck into branch 'master'.

Fix crash in Folder destructor

Especially visible with Qt 4.8.0 qDeleteAll() changes, but might also
fix older bugs.

BUG: 285938
CCBUG: 193780
FIXED-IN: 4.7.4
REVIEW: 102981

M  +4    -1    akregator/src/folder.cpp

http://commits.kde.org/kdepim/3497e5afe51490191825c7b7d475a5fc0702988d
Comment 21 Simon 2011-11-08 18:32:55 UTC
Although it seems to be 1 day too late, I confirm that this patch solve the bug.
Comment 22 Christoph Feck 2011-11-08 20:34:55 UTC
Well, I was interested if the patch fixes _this_ bug, which seems to be unrelated to the Qt 4.8 qDeleteAll() changes. I would say let's keep this entry open until someone can confirm it also fixes the crash with Qt 4.7.x.
Comment 23 Hrvoje Senjan 2011-11-10 07:02:11 UTC
This also fixes it for me (using qt 4.8)
Comment 24 Christophe Marin 2011-12-03 18:58:44 UTC
*** Bug 288154 has been marked as a duplicate of this bug. ***
Comment 25 Bruno Friedmann 2011-12-06 17:13:42 UTC
Created attachment 66440 [details]
New crash information added by DrKonqi

kontact (4.8 beta2) on KDE Platform 4.7.4 (4.7.4) "release 8" using Qt 4.8.0

- What I was doing when the application crashed: on a 4.8 beta2 after letting kontact open, I ask for shutdown, then the crash occurs

-- Backtrace (Reduced):
#6  0x00007f7e06502ce0 in Akregator::Feed::unread (this=<optimized out>) at /usr/src/debug/kdepim-git/akregator/src/feed.cpp:753
#7  0x00007f7e0651a8e0 in Akregator::Folder::updateUnreadCount (this=0x5c00a40) at /usr/src/debug/kdepim-git/akregator/src/folder.cpp:313
#8  0x00007f7e0651ac5a in Akregator::Folder::removeChild (this=0x5c00a40, node=0x5b02000) at /usr/src/debug/kdepim-git/akregator/src/folder.cpp:258
#9  0x00007f7e06511d35 in Akregator::TreeNode::emitSignalDestroyed (this=0x5b02000) at /usr/src/debug/kdepim-git/akregator/src/treenode.cpp:74
#10 0x00007f7e065052a9 in Akregator::Feed::~Feed (this=0x5b02000, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-git/akregator/src/feed.cpp:323
Comment 26 Bruno Friedmann 2012-02-03 07:43:15 UTC
Created attachment 68454 [details]
New crash information added by DrKonqi

kontact (4.8.0) on KDE Platform 4.8.00 (4.8.0 "release 462" using Qt 4.8.0

- What I was doing when the application crashed:
At shutdown time, you get a kontact crash, under 4.8

-- Backtrace (Reduced):
#7  0x00007f209fb1a8e0 in Akregator::Folder::updateUnreadCount (this=0x4814d40) at /usr/src/debug/kdepim-4.8.0/akregator/src/folder.cpp:313
#8  0x00007f209fb1ac5a in Akregator::Folder::removeChild (this=0x4814d40, node=0x4816710) at /usr/src/debug/kdepim-4.8.0/akregator/src/folder.cpp:258
#9  0x00007f209fb11d35 in Akregator::TreeNode::emitSignalDestroyed (this=0x4816710) at /usr/src/debug/kdepim-4.8.0/akregator/src/treenode.cpp:74
#10 0x00007f209fb052a9 in Akregator::Feed::~Feed (this=0x4816710, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.8.0/akregator/src/feed.cpp:323
#11 0x00007f209fb054e9 in Akregator::Feed::~Feed (this=0x4816710, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.8.0/akregator/src/feed.cpp:326
Comment 27 Bruno Friedmann 2012-02-22 07:24:57 UTC
Created attachment 68998 [details]
New crash information added by DrKonqi

kontact (4.8.0) on KDE Platform 4.8.00 (4.8.0 "release 2" using Qt 4.8.0

- What I was doing when the application crashed: Ask shutdown, kontact was open at that time. Once kwin stop, you get the crash immediately.

Is there anything we can do to help you to debug it more ?

-- Backtrace (Reduced):
#7  0x00007f936f0ce8e0 in Akregator::Folder::updateUnreadCount (this=0x48aa700) at /usr/src/debug/kdepim-4.8.0/akregator/src/folder.cpp:313
#8  0x00007f936f0cec5a in Akregator::Folder::removeChild (this=0x48aa700, node=0x48a7020) at /usr/src/debug/kdepim-4.8.0/akregator/src/folder.cpp:258
#9  0x00007f936f0c5d35 in Akregator::TreeNode::emitSignalDestroyed (this=0x48a7020) at /usr/src/debug/kdepim-4.8.0/akregator/src/treenode.cpp:74
#10 0x00007f936f0b92a9 in Akregator::Feed::~Feed (this=0x48a7020, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.8.0/akregator/src/feed.cpp:323
#11 0x00007f936f0b94e9 in Akregator::Feed::~Feed (this=0x48a7020, __in_chrg=<optimized out>, __vtt_parm=<optimized out>) at /usr/src/debug/kdepim-4.8.0/akregator/src/feed.cpp:326
Comment 28 Raúl 2012-06-03 07:48:05 UTC
Hi. https://bugs.kde.org/show_bug.cgi?id=285938 looks like a dupe of this but I don't understand why the one I'm referring to is fixed whereas this one is.
Regards,
Comment 29 Christoph Feck 2012-06-04 00:54:00 UTC
Raúl, bug 285938 was caused by an update to Qt 4.8.0, while this one is much older, and thus probably has a different cause.
Comment 30 Raúl 2012-06-09 14:52:16 UTC
Cristoph, thanks for you clarification. I applied the suggested commit to the Debian version which is currently 4.4.11 and the crash doesn't appear. Now I don't know whose crash I have been seeing.
How do you see this bug different to https://bugs.kde.org/show_bug.cgi?id=285938 so I could triage which one I see?
Also anyone could reproduce this bug with the proposed patch applied?
Thanks
Comment 31 Christophe Marin 2012-08-14 21:24:36 UTC
*** Bug 300135 has been marked as a duplicate of this bug. ***
Comment 32 Jekyll Wu 2013-09-26 12:10:12 UTC
*** Bug 325320 has been marked as a duplicate of this bug. ***
Comment 33 Jekyll Wu 2013-11-19 14:14:54 UTC
*** Bug 324513 has been marked as a duplicate of this bug. ***
Comment 34 Denis Kurz 2016-09-24 19:43:23 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of akregator (version 5.0 or later, as part of KDE Applications 15.08 or later), it gets closed in about three months.
Comment 35 Denis Kurz 2017-01-07 22:05:17 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.