Bug 280071 - KMyMoney crashed when opening the 'Loan information' report after deleting the payee which is referenced by a loan
Summary: KMyMoney crashed when opening the 'Loan information' report after deleting th...
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.5.3
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-14 11:56 UTC by Pedro Vaz
Modified: 2011-08-17 17:18 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
New crash information added by DrKonqi (8.92 KB, text/plain)
2011-08-16 17:20 UTC, Pedro Vaz
Details
Anon file that produces this defect (486.79 KB, application/zip)
2011-08-16 17:35 UTC, Pedro Vaz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Vaz 2011-08-14 11:56:31 UTC
Application: kmymoney (4.5.3)
KDE Platform Version: 4.6.2 (4.6.2)
Qt Version: 4.7.2
Operating System: Linux 2.6.38-10-generic i686
Distribution: Ubuntu 11.04

-- Information about the crash:
When I select Loan Information report, KMyMoney always crashes

The crash can be reproduced every time.

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Aborted
[Current thread is 1 (Thread 0xb7754930 (LWP 2540))]

Thread 2 (Thread 0xb7528b70 (LWP 2542)):
#0  0x00b04326 in pthread_mutex_lock () from /lib/i386-linux-gnu/libpthread.so.0
#1  0x05f5f5a8 in g_main_context_acquire () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0x05f60dde in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0x05f6192b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0x01fec304 in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
#5  0x05f8a2df in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#6  0x00b01e99 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#7  0x009a573e in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 1 (Thread 0xb7754930 (LWP 2540)):
[KCrash Handler]
#7  0x00b72416 in __kernel_vsyscall ()
#8  0x008ffe71 in raise () from /lib/i386-linux-gnu/libc.so.6
#9  0x0090334e in abort () from /lib/i386-linux-gnu/libc.so.6
#10 0x006a80b5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#11 0x006a5fa5 in ?? () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#12 0x006a5fe2 in std::terminate() () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#13 0x006a614e in __cxa_throw () from /usr/lib/i386-linux-gnu/libstdc++.so.6
#14 0x0844af3e in MyMoneySeqAccessMgr::payee (this=0x91df270, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp:167
#15 0x00e2ea39 in MyMoneyObjectContainer::payee (this=0x8f65528, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/mymoneyobjectcontainer.cpp:200
#16 0x00df10ba in MyMoneyFile::payee (this=0xe5b56c, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/mymoneyfile.cpp:905
#17 0x0819129a in reports::ObjectInfoTable::constructAccountLoanTable (this=0xa3f1860) at /build/buildd/kmymoney-4.5.3/kmymoney/reports/objectinfotable.cpp:315
#18 0x08198103 in reports::ObjectInfoTable::init (this=0xa3f1860) at /build/buildd/kmymoney-4.5.3/kmymoney/reports/objectinfotable.cpp:84
#19 0x08198509 in reports::ObjectInfoTable::ObjectInfoTable (this=0xa3f1860, _report=...) at /build/buildd/kmymoney-4.5.3/kmymoney/reports/objectinfotable.cpp:69
#20 0x081123fd in KReportsView::KReportTab::updateReport (this=0xa3b3b28) at /build/buildd/kmymoney-4.5.3/kmymoney/views/kreportsview.cpp:184
#21 0x081124d2 in KReportsView::KReportTab::showEvent (this=0xa3b3b28, event=0xbfe61b70) at /build/buildd/kmymoney-4.5.3/kmymoney/views/kreportsview.cpp:158
#22 0x02c53262 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#23 0x02bfad24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#24 0x02bff97b in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#25 0x017743ca in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#26 0x01a920bb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#27 0x02c573b6 in QWidgetPrivate::show_helper() () from /usr/lib/libQtGui.so.4
#28 0x02c5771b in QWidget::setVisible(bool) () from /usr/lib/libQtGui.so.4
#29 0x02c35242 in QStackedLayout::setCurrentIndex(int) () from /usr/lib/libQtGui.so.4
#30 0x030abfed in QStackedWidget::setCurrentIndex(int) () from /usr/lib/libQtGui.so.4
#31 0x030bb36f in ?? () from /usr/lib/libQtGui.so.4
#32 0x030bb6b2 in QTabWidget::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtGui.so.4
#33 0x018760ea in KTabWidget::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libkdeui.so.5
#34 0x01a986ba in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#35 0x01aa84ff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#36 0x030af453 in QTabBar::currentChanged(int) () from /usr/lib/libQtGui.so.4
#37 0x030b3021 in QTabBar::setCurrentIndex(int) () from /usr/lib/libQtGui.so.4
#38 0x030b8b1d in QTabWidget::setCurrentIndex(int) () from /usr/lib/libQtGui.so.4
#39 0x0811198f in KReportsView::addReportTab (this=0x93595f0, report=...) at /build/buildd/kmymoney-4.5.3/kmymoney/views/kreportsview.cpp:1066
#40 0x0811b604 in KReportsView::qt_metacall (this=0x93595f0, _c=QMetaObject::InvokeMetaMethod, _id=<value optimized out>, _a=0xbfe61fb4) at /build/buildd/kmymoney-4.5.3/obj-i686-linux-gnu/kmymoney/views/kreportsview.moc:119
#41 0x01a986ba in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#42 0x01aa84ff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#43 0x031f0779 in QTreeWidget::itemDoubleClicked(QTreeWidgetItem*, int) () from /usr/lib/libQtGui.so.4
#44 0x031f07ed in ?? () from /usr/lib/libQtGui.so.4
#45 0x031f984e in QTreeWidget::qt_metacall(QMetaObject::Call, int, void**) () from /usr/lib/libQtGui.so.4
#46 0x01a986ba in QMetaObject::metacall(QObject*, QMetaObject::Call, int, void**) () from /usr/lib/libQtCore.so.4
#47 0x01aa84ff in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/libQtCore.so.4
#48 0x03177de3 in QAbstractItemView::doubleClicked(QModelIndex const&) () from /usr/lib/libQtGui.so.4
#49 0x031c0c67 in QTreeView::mouseDoubleClickEvent(QMouseEvent*) () from /usr/lib/libQtGui.so.4
#50 0x02c53156 in QWidget::event(QEvent*) () from /usr/lib/libQtGui.so.4
#51 0x030479f3 in QFrame::event(QEvent*) () from /usr/lib/libQtGui.so.4
#52 0x030d6062 in QAbstractScrollArea::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#53 0x03175227 in QAbstractItemView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#54 0x031bce83 in QTreeView::viewportEvent(QEvent*) () from /usr/lib/libQtGui.so.4
#55 0x030d8965 in ?? () from /usr/lib/libQtGui.so.4
#56 0x01a9225a in QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#57 0x02bfad00 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#58 0x02c00201 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQtGui.so.4
#59 0x017743ca in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#60 0x01a920bb in QCoreApplication::notifyInternal(QObject*, QEvent*) () from /usr/lib/libQtCore.so.4
#61 0x02bfbc3b in QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool) () from /usr/lib/libQtGui.so.4
#62 0x02c8704c in ?? () from /usr/lib/libQtGui.so.4
#63 0x02c859b5 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libQtGui.so.4
#64 0x02cb15f4 in ?? () from /usr/lib/libQtGui.so.4
#65 0x05f60aa8 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#66 0x05f61270 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#67 0x05f61524 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#68 0x01abf53c in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#69 0x02cb11e5 in ?? () from /usr/lib/libQtGui.so.4
#70 0x01a91289 in QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#71 0x01a91522 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
#72 0x01a95ecc in QCoreApplication::exec() () from /usr/lib/libQtCore.so.4
#73 0x02bf88e7 in QApplication::exec() () from /usr/lib/libQtGui.so.4
#74 0x08086c4f in main (argc=) at /build/buildd/kmymoney-4.5.3/kmymoney/main.cpp:260

Reported using DrKonqi
Comment 1 Cristian Oneț 2011-08-15 21:23:08 UTC
Could you please save the file in the anonymous data format http://kmymoney2.sourceforge.net/kde4/online-manual/details.formats.anonymous.html check that the crash can be reproduced with the anonymous file and attach it to this report or you could directly email it to me. This would make fixing this bug a lot easier. Thanks :).
Comment 2 Pedro Vaz 2011-08-16 17:20:42 UTC
Created attachment 62875 [details]
New crash information added by DrKonqi

kmymoney (4.5.3) on KDE Platform 4.6.2 (4.6.2) using Qt 4.7.2

- What I was doing when the application crashed:

Opened 9.Informatio -> Loan Information report and it always crashes

-- Backtrace (Reduced):
#14 0x0844af3e in MyMoneySeqAccessMgr::payee (this=0xb2e2e68, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/storage/mymoneyseqaccessmgr.cpp:167
#15 0x00257a39 in MyMoneyObjectContainer::payee (this=0xa4ee528, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/mymoneyobjectcontainer.cpp:200
#16 0x0021a0ba in MyMoneyFile::payee (this=0x28456c, id=...) at /build/buildd/kmymoney-4.5.3/kmymoney/mymoney/mymoneyfile.cpp:905
#17 0x0819129a in reports::ObjectInfoTable::constructAccountLoanTable (this=0xbdc8080) at /build/buildd/kmymoney-4.5.3/kmymoney/reports/objectinfotable.cpp:315
#18 0x08198103 in reports::ObjectInfoTable::init (this=0xbdc8080) at /build/buildd/kmymoney-4.5.3/kmymoney/reports/objectinfotable.cpp:84
Comment 3 Pedro Vaz 2011-08-16 17:35:03 UTC
Created attachment 62876 [details]
Anon file that produces this defect
Comment 4 Cristian Oneț 2011-08-16 18:20:00 UTC
Thanks for the input data but I'm still not able to reproduce it using the current version from trunk. But the code that crashes was not changed for a long time.

Looking at the stack trace the explanation is that the loan data contains a payee id which is not present in the payees list and that causes the exception to be thrown.

Now looking at the xml file you've attached (I've tested it first but it did not crash) I see that the payees of each loan (A000339 with P000076 and A000308 with P000228) are correct and present in the payees list. Are you sure that your version crashes with the same file? The only way I could obtain your crash is by deleting the payee referenced by the loan and then opening the report, is this what you've done?
Comment 5 Cristian Oneț 2011-08-16 18:21:56 UTC
Thomas, this is a case if dangling references in the engine, will you look at it?
Comment 6 Pedro Vaz 2011-08-16 18:31:40 UTC
Encomendar um para o Músico ☺


On Aug 16, 2011, at 20:21 , Cristian Onet wrote:

> https://bugs.kde.org/show_bug.cgi?id=280071
> 
> 
> 
> 
> 
> --- Comment #5 from Cristian Onet <onet cristian gmail com>  2011-08-16 18:21:56 ---
> Thomas, this is a case if dangling references in the engine, will you look at
> it?
> 
> -- 
> Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug.
> You reported the bug.
Comment 7 Cristian Oneț 2011-08-17 17:17:00 UTC
SVN commit 1247865 by conet:

BUG: 280071
A payee could be referenced by a loan account. When a payee is deleted consider this reference also and update it according to the user's reassignment choice.

Fixed the payee deletion code and added a step in the consistency check to fix files that where affected by this issue. 

 M  +27 -3     kmymoney.cpp  
 M  +17 -3     mymoney/mymoneyfile.cpp  
 M  +1 -4      reports/objectinfotable.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1247865
Comment 8 Cristian Oneț 2011-08-17 17:18:43 UTC
SVN commit 1247866 by conet:

BUG: 280071
A payee could be referenced by a loan account. When a payee is deleted consider this reference also and update it according to the user's reassignment choice.

Fixed the payee deletion code and added a step in the consistency check to fix files that where affected by this issue. 
Backported to the stable branch.

 M  +27 -3     kmymoney.cpp  
 M  +17 -3     mymoney/mymoneyfile.cpp  
 M  +1 -4      reports/objectinfotable.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1247866