Bug 263087

Summary: Crash after account name change
Product: [Applications] kmymoney Reporter: Jared B <jared.bishop>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: crash CC: agander93, arto.kemppainen, debaux.manuel, lordcain2nd, mail, peer.frank, rvalkass, tilda
Priority: NOR    
Version: 4.5.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Anon files to recreate

Description Jared B 2011-01-14 00:34:17 UTC
Application: kmymoney (4.5.2)
KDE Platform Version: 4.5.1 (KDE 4.5.1)
Qt Version: 4.7.0
Operating System: Linux 2.6.35-24-generic i686
Distribution: Ubuntu 10.10

-- Information about the crash:
- What I was doing when the application crashed:
Changed the name of 2 accounts in the accounts page.
Went of ledger view of one account.
Selected transaction with an emtpy payee that was a transfer from one account to the other (both accounts had new names). Crash.

The crash does not seem to be reproducible.

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Segmentation fault
[Current thread is 1 (Thread 0xb7794710 (LWP 3563))]

Thread 2 (Thread 0xb27d7b70 (LWP 3564)):
#0  0x03464e36 in clock_gettime () from /lib/librt.so.1
#1  0x01a7b50b in do_gettime () at tools/qelapsedtimer_unix.cpp:105
#2  qt_gettime () at tools/qelapsedtimer_unix.cpp:119
#3  0x01b526e5 in QTimerInfoList::updateCurrentTime (this=0x994baf4) at kernel/qeventdispatcher_unix.cpp:339
#4  0x01b5272a in QTimerInfoList::timerWait (this=0x994baf4, tm=...) at kernel/qeventdispatcher_unix.cpp:442
#5  0x01b507a8 in timerSourcePrepareHelper (src=<value optimized out>, timeout=0xb27d70bc) at kernel/qeventdispatcher_glib.cpp:136
#6  0x01b5083d in timerSourcePrepare (source=0x0, timeout=0x3468ff4) at kernel/qeventdispatcher_glib.cpp:169
#7  0x04f95e6a in g_main_context_prepare () from /lib/libglib-2.0.so.0
#8  0x04f96279 in ?? () from /lib/libglib-2.0.so.0
#9  0x04f96848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#10 0x01b5059f in QEventDispatcherGlib::processEvents (this=0x994e0f0, flags=...) at kernel/qeventdispatcher_glib.cpp:417
#11 0x01b20609 in QEventLoop::processEvents (this=0xb27d7290, flags=) at kernel/qeventloop.cpp:149
#12 0x01b20a8a in QEventLoop::exec (this=0xb27d7290, flags=...) at kernel/qeventloop.cpp:201
#13 0x01a1cb7e in QThread::exec (this=0x994b2d0) at thread/qthread.cpp:490
#14 0x01aff35b in QInotifyFileSystemWatcherEngine::run (this=0x994b2d0) at io/qfilesystemwatcher_inotify.cpp:248
#15 0x01a1fdf9 in QThreadPrivate::start (arg=0x994b2d0) at thread/qthread_unix.cpp:266
#16 0x00705cc9 in start_thread () from /lib/libpthread.so.0
#17 0x00bed69e in clone () from /lib/libc.so.6

Thread 1 (Thread 0xb7794710 (LWP 3563)):
[KCrash Handler]
#7  0x08fc3b36 in size (this=0x96a13c8, item=0xa7b3750, column=0) at ../../include/QtCore/../../src/corelib/tools/qlist.h:94
#8  count (this=0x96a13c8, item=0xa7b3750, column=0) at ../../include/QtCore/../../src/corelib/tools/qlist.h:267
#9  QTreeModel::index (this=0x96a13c8, item=0xa7b3750, column=0) at itemviews/qtreewidget.cpp:241
#10 0x08fc5f06 in index (this=0x969aae8, item=0xa7b3750, hint=QAbstractItemView::EnsureVisible) at ../../include/QtGui/private/../../../src/gui/itemviews/qtreewidget_p.h:224
#11 QTreeWidget::scrollToItem (this=0x969aae8, item=0xa7b3750, hint=QAbstractItemView::EnsureVisible) at itemviews/qtreewidget.cpp:3229
#12 0x082202c7 in KMyMoneySelector::slotShowSelected (this=0x969a868) at /build/buildd/kmymoney-4.5.2/kmymoney/widgets/kmymoneyselector.cpp:388
#13 0x08222a83 in KMyMoneySelector::qt_metacall (this=0x969a868, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0xbf971b3c) at /build/buildd/kmymoney-4.5.2/obj-i686-linux-gnu/kmymoney/widgets/kmymoneyselector.moc:101
#14 0x0820858a in kMyMoneyAccountSelector::qt_metacall (this=0x969a868, _c=QMetaObject::InvokeMetaMethod, _id=33, _a=0xbf971b3c) at /build/buildd/kmymoney-4.5.2/obj-i686-linux-gnu/kmymoney/widgets/kmymoneyaccountselector.moc:74
#15 0x01b278ca in QMetaObject::metacall (object=0x969a868, cl=3894674569, idx=33, argv=0xbf971b3c) at kernel/qmetaobject.cpp:237
#16 0x01b3a6ad in QMetaObject::activate (sender=0xa72d9e0, m=0x1c53188, local_signal_index=0, argv=0xe8240489) at kernel/qobject.cpp:3280
#17 0x01b3fa47 in QSingleShotTimer::timeout (this=0xa72d9e0) at .moc/release-shared/qtimer.moc:82
#18 0x01b3fb5c in QSingleShotTimer::timerEvent (this=0xa72d9e0) at kernel/qtimer.cpp:308
#19 0x01b34504 in QObject::event (this=0xa72d9e0, e=0x96a13c8) at kernel/qobject.cpp:1183
#20 0x0896dfdc in QApplicationPrivate::notify_helper (this=0x9467b78, receiver=0xa72d9e0, e=0xbf972070) at kernel/qapplication.cpp:4396
#21 0x0897404e in QApplication::notify (this=0x9467ac0, receiver=0xa72d9e0, e=0xbf972070) at kernel/qapplication.cpp:3798
#22 0x003b068a in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#23 0x01b21b3b in QCoreApplication::notifyInternal (this=0x9467ac0, receiver=0xa72d9e0, event=0xbf972070) at kernel/qcoreapplication.cpp:732
#24 0x01b53ad6 in sendEvent (this=0x946a994) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:215
#25 QTimerInfoList::activateTimers (this=0x946a994) at kernel/qeventdispatcher_unix.cpp:602
#26 0x01b50874 in timerSourceDispatch (source=0x946a960) at kernel/qeventdispatcher_glib.cpp:184
#27 0x04f92855 in g_main_context_dispatch () from /lib/libglib-2.0.so.0
#28 0x04f96668 in ?? () from /lib/libglib-2.0.so.0
#29 0x04f96848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#30 0x01b50565 in QEventDispatcherGlib::processEvents (this=0x944db78, flags=...) at kernel/qeventdispatcher_glib.cpp:415
#31 0x08a2fbe5 in QGuiEventDispatcherGlib::processEvents (this=0x944db78, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#32 0x01b20609 in QEventLoop::processEvents (this=0xbf972334, flags=) at kernel/qeventloop.cpp:149
#33 0x01b20a8a in QEventLoop::exec (this=0xbf972334, flags=...) at kernel/qeventloop.cpp:201
#34 0x01b2500f in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1009
#35 0x0896ce07 in QApplication::exec () at kernel/qapplication.cpp:3672
#36 0x080868a7 in main (argc=1, argv=0xbf9727c4) at /build/buildd/kmymoney-4.5.2/kmymoney/main.cpp:260

Reported using DrKonqi
Comment 1 Jared B 2011-01-14 00:46:16 UTC
Just just had another crash of similar nature (though I was just navigating the ledger this time).

I upgraded to new libc packages that were released on the kubuntu repos yesterday. Could that be related?
Comment 2 Cristian Oneț 2011-05-13 12:09:02 UTC
*** Bug 267154 has been marked as a duplicate of this bug. ***
Comment 3 Cristian Oneț 2011-05-13 12:10:08 UTC
*** Bug 263259 has been marked as a duplicate of this bug. ***
Comment 4 Cristian Oneț 2011-05-13 12:11:24 UTC
*** Bug 271486 has been marked as a duplicate of this bug. ***
Comment 5 Cristian Oneț 2011-05-13 12:11:57 UTC
*** Bug 264030 has been marked as a duplicate of this bug. ***
Comment 6 Cristian Oneț 2011-05-13 12:14:14 UTC
Since this one appears to have a lot of duplicates, could we try to make this reproducible? An anon file would be nice :).
Comment 7 Jared B 2011-05-17 21:01:43 UTC
Created attachment 60088 [details]
Anon files to recreate

Anon file attached.

Bug 267154 probably has a better explaination of this as I didn't know what was causing it at the time I reported this:

"moving a transaction from one account to another fails: moving (right mouse
click) works, but KMM crashes when trying to open the target account".

It is reproducible - anon files attached.
Comment 8 Cristian Oneț 2011-05-17 23:32:39 UTC
(In reply to comment #7)
> Created an attachment (id=60088) [details]
> Anon files to recreate
> 
> Anon file attached.
> 
> Bug 267154 probably has a better explaination of this as I didn't know what was
> causing it at the time I reported this:
> 
> "moving a transaction from one account to another fails: moving (right mouse
> click) works, but KMM crashes when trying to open the target account".
> 
> It is reproducible - anon files attached.

Could you please state what transactions you move from which account where from the one in the anonymous file? I'm asking because moving transaction works fine here. I'm running SVN trunk.
Comment 9 Cristian Oneț 2011-05-18 10:48:08 UTC
Nevermind, I can see now what is going wrong, although I'm not able to reproduce it, just by looking at the code.

KMyMoneySelector::ensureItemVisible's implementation itself can cause the crash by storing a pointer and using it later. The problem is that it could become invalid by then. I'll fix this later today.
Comment 10 Cristian Oneț 2011-05-18 18:13:29 UTC
SVN commit 1232629 by conet:

BUG: 263087
Remove the delayed scroll to item because storing a pointer to a tree view item and using it later (after the event loop has run) is a good way to obtain a crash. The reason why the delayed scroll to item was used in the first place is no longer valid from what I can see (the selected item is highlighted correctly in the account combo). Anyway it's better to have an item that is not highlighted then a crash.

 M  +3 -3      kmymoneycompletion.cpp  
 M  +2 -23     kmymoneyselector.cpp  
 M  +0 -23     kmymoneyselector.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1232629
Comment 11 Cristian Oneț 2011-05-26 06:56:20 UTC
*** Bug 274162 has been marked as a duplicate of this bug. ***
Comment 12 Thomas Baumgart 2011-09-27 09:03:48 UTC
*** Bug 282750 has been marked as a duplicate of this bug. ***
Comment 13 Thomas Baumgart 2011-11-13 12:51:30 UTC
*** Bug 286438 has been marked as a duplicate of this bug. ***
Comment 14 Cristian Oneț 2012-01-06 10:16:09 UTC
*** Bug 282929 has been marked as a duplicate of this bug. ***
Comment 15 Cristian Oneț 2012-01-12 18:25:09 UTC
*** Bug 281311 has been marked as a duplicate of this bug. ***
Comment 16 Cristian Oneț 2012-02-08 08:34:30 UTC
*** Bug 293606 has been marked as a duplicate of this bug. ***