Bug 327663 - crash on reports
Summary: crash on reports
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.6.3
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords: drkonqi
: 301817 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-11-15 18:10 UTC by marcelo
Modified: 2014-09-24 19:31 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description marcelo 2013-11-15 18:10:03 UTC
Application: kmymoney (4.6.3)
KDE Platform Version: 4.10.5
Qt Version: 4.8.4
Operating System: Linux 3.8.0-19-generic i686
Distribution: Linux Mint 15 Olivia

-- Information about the crash:
- What I was doing when the application crashed: I was reviewing a report and  using the links to edit the book. The system crashed and my db file was totaly lost! (0 kb). This happend already twice.

The crash can be reproduced sometimes.

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Segmentation fault
Using host libthread_db library "/lib/i386-linux-gnu/libthread_db.so.1".
[Current thread is 1 (Thread 0xb3cd0740 (LWP 4640))]

Thread 2 (Thread 0xa4359b40 (LWP 5184)):
#0  0xb772d424 in __kernel_vsyscall ()
#1  0xb516d9db in poll () from /lib/i386-linux-gnu/libc.so.6
#2  0xb46b62db in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb46a76d0 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb46a7c2b in g_main_loop_run () from /lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb24abbca in ?? () from /usr/lib/i386-linux-gnu/libgio-2.0.so.0
#6  0xb46ccfc3 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#7  0xb67afd78 in start_thread () from /lib/i386-linux-gnu/libpthread.so.0
#8  0xb517cfee in clone () from /lib/i386-linux-gnu/libc.so.6

Thread 1 (Thread 0xb3cd0740 (LWP 4640)):
[KCrash Handler]
#6  QString::operator= (this=this@entry=0xba7f430, other=...) at tools/qstring.cpp:1410
#7  0xb649e8b5 in QDomAttrPrivate::setNodeValue (this=0xba7f410, v=...) at dom/qdom.cpp:4137
#8  0xb64a6024 in QDomElementPrivate::setAttribute (this=0xba7c558, aname=..., newValue=...) at dom/qdom.cpp:4479
#9  0xb76c6280 in MyMoneyReport::write (this=0xba658c0, e=..., doc=0xaef4838, anonymous=false) at /build/buildd/kmymoney-4.6.3/kmymoney/mymoney/mymoneyreport.cpp:362
#10 0xb76c7041 in MyMoneyReport::writeXML (this=0xba7f430, document=..., parent=...) at /build/buildd/kmymoney-4.6.3/kmymoney/mymoney/mymoneyreport.cpp:741
#11 0x08418b93 in MyMoneyStorageXML::writeReports (this=0xaef47e8, parent=...) at /build/buildd/kmymoney-4.6.3/kmymoney/mymoney/storage/mymoneystoragexml.cpp:776
#12 0x084172f7 in MyMoneyStorageXML::writeFile (this=0xaef47e8, qf=0xbdb99f8, storage=0xbfb70c58) at /build/buildd/kmymoney-4.6.3/kmymoney/mymoney/storage/mymoneystoragexml.cpp:515
#13 0x080deee5 in KMyMoneyView::saveToLocalFile (this=0x93e6598, localFile=..., pWriter=0xaef47e8, plaintext=false, keyList=...) at /build/buildd/kmymoney-4.6.3/kmymoney/views/kmymoneyview.cpp:1190
#14 0x080e0013 in KMyMoneyView::saveFile (this=0x93e6598, url=..., keyList=...) at /build/buildd/kmymoney-4.6.3/kmymoney/views/kmymoneyview.cpp:1265
#15 0x080b46cf in KMyMoneyApp::slotFileSave (this=0x9376b08) at /build/buildd/kmymoney-4.6.3/kmymoney/kmymoney.cpp:1575
#16 0x080b48a7 in KMyMoneyApp::slotAutoSave (this=this@entry=0x9376b08) at /build/buildd/kmymoney-4.6.3/kmymoney/kmymoney.cpp:6779
#17 0x080cd228 in KMyMoneyApp::qt_static_metacall (_o=0x9376b08, _c=QMetaObject::InvokeMetaMethod, _id=25, _a=0xbfb711ec) at /build/buildd/kmymoney-4.6.3/obj-i686-linux-gnu/kmymoney/kmymoney.moc:403
#18 0xb6068b56 in QMetaObject::activate (sender=sender@entry=0x98d5818, m=m@entry=0xb61bd4b8 <QTimer::staticMetaObject>, local_signal_index=local_signal_index@entry=0, argv=argv@entry=0x0) at kernel/qobject.cpp:3539
#19 0xb60bbee5 in QTimer::timeout (this=this@entry=0x98d5818) at .moc/release-shared/moc_qtimer.cpp:148
#20 0xb6072126 in QTimer::timerEvent (this=0x98d5818, e=0xbfb716f0) at kernel/qtimer.cpp:280
#21 0xb606e2d4 in QObject::event (this=0x98d5818, e=0xbfb716f0) at kernel/qobject.cpp:1156
#22 0xb54c3c7c in QApplicationPrivate::notify_helper (this=0x908ca28, receiver=0x98d5818, e=0xbfb716f0) at kernel/qapplication.cpp:4567
#23 0xb54c6b94 in QApplication::notify (this=0xbfb716f0, receiver=0x98d5818, e=0xbfb716f0) at kernel/qapplication.cpp:3949
#24 0xb6bea491 in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdeui.so.5
#25 0xb605290e in QCoreApplication::notifyInternal (this=0x90826d0, receiver=0x98d5818, event=event@entry=0xbfb716f0) at kernel/qcoreapplication.cpp:946
#26 0xb60878c0 in sendEvent (event=0xbfb716f0, receiver=<optimized out>) at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#27 QTimerInfoList::activateTimers (this=this@entry=0x908c9f4) at kernel/qeventdispatcher_unix.cpp:622
#28 0xb60845a8 in timerSourceDispatch (source=0x908c9c0) at kernel/qeventdispatcher_glib.cpp:186
#29 timerSourceDispatch (source=0x908c9c0) at kernel/qeventdispatcher_glib.cpp:180
#30 0xb60845e2 in idleTimerSourceDispatch (source=0x9089e28) at kernel/qeventdispatcher_glib.cpp:233
#31 0xb46a73b3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#32 0xb46a7750 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#33 0xb46a7831 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#34 0xb6084c21 in QEventDispatcherGlib::processEvents (this=this@entry=0x905de90, flags=...) at kernel/qeventdispatcher_glib.cpp:424
#35 0xb557aa0a in QGuiEventDispatcherGlib::processEvents (this=0x905de90, flags=...) at kernel/qguieventdispatcher_glib.cpp:204
#36 0xb60513ec in QEventLoop::processEvents (this=this@entry=0xbfb71978, flags=...) at kernel/qeventloop.cpp:149
#37 0xb60516e1 in QEventLoop::exec (this=this@entry=0xbfb71978, flags=...) at kernel/qeventloop.cpp:204
#38 0xb60573fa in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1218
#39 0xb54c1fc4 in QApplication::exec () at kernel/qapplication.cpp:3828
#40 0x0808a3e0 in runKMyMoney (splash=0x9235cc8, a=<optimized out>) at /build/buildd/kmymoney-4.6.3/kmymoney/main.cpp:282
#41 0x08088931 in main (argc=1, argv=0xbfb71de4) at /build/buildd/kmymoney-4.6.3/kmymoney/main.cpp:181

Possible duplicates by query: bug 322971.

Reported using DrKonqi
Comment 1 Cristian Oneț 2013-11-15 18:15:51 UTC
It seems that this is caused by the auto save feature, util we can fix it you can disable it and stick with the manual backups just to be safe.
Comment 2 marcelo 2013-11-15 18:33:29 UTC
Thanks for the help

Marcelo


Em 15-11-2013 16:15, Cristian Oneț escreveu:
> https://bugs.kde.org/show_bug.cgi?id=327663
>
> Cristian Oneț <onet.cristian@gmail.com> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |onet.cristian@gmail.com
>
> --- Comment #1 from Cristian Oneț <onet.cristian@gmail.com> ---
> It seems that this is caused by the auto save feature, util we can fix it you
> can disable it and stick with the manual backups just to be safe.
>
Comment 3 Cristian Oneț 2014-07-31 09:49:59 UTC
There are a lot of auto save related bugs, this would really need to be fixed.
Comment 4 Cristian Oneț 2014-07-31 09:50:37 UTC
*** Bug 301817 has been marked as a duplicate of this bug. ***
Comment 5 Marcelo Ricardo Leitner 2014-08-14 13:08:48 UTC
Application: kmymoney (4.6.6)
KDE Platform Version: 4.13.3
Qt Version: 4.8.6
Operating System: Linux 3.15.8-200.fc20.x86_64 x86_64
Distribution: "Fedora release 20 (Heisenbug)"

-- Information about the crash:
- What I was doing when the application crashed:

Just manually (clicked on Save button) saving a file. Auto-backup was on, keeping 5 files in history. Auto-save is off.

The crash can be reproduced every time.

-- Backtrace:
Application: KMyMoney (kmymoney), signal: Segmentation fault
Using host libthread_db library "/lib64/libthread_db.so.1".
81	T_PSEUDO (SYSCALL_SYMBOL, SYSCALL_NAME, SYSCALL_NARGS)
[KCrash Handler]
#6  QString::operator= (this=this@entry=0x73d7860, other=...) at tools/qstring.cpp:1410
#7  0x0000003d2a0157e3 in QDomAttrPrivate::setNodeValue (this=0x73d7820, v=...) at dom/qdom.cpp:4137
#8  0x0000003d2a01b965 in QDomElementPrivate::setAttribute (this=0x73d45a0, aname=..., newValue=...) at dom/qdom.cpp:4479
#9  0x0000003d2a01b9dd in QDomElement::setAttribute (this=<optimized out>, name=..., value=...) at dom/qdom.cpp:4829
#10 0x00000037bdc64b7f in MyMoneyReport::write (this=this@entry=0x73d2f80, e=..., doc=doc@entry=0x52fde20, anonymous=anonymous@entry=false) at /usr/src/debug/kmymoney-4.6.6/kmymoney/mymoney/mymoneyreport.cpp:370
#11 0x00000037bdc65820 in MyMoneyReport::writeXML (this=0x73d2f80, document=..., parent=...) at /usr/src/debug/kmymoney-4.6.6/kmymoney/mymoney/mymoneyreport.cpp:749
#12 0x000000000078f2b1 in MyMoneyStorageXML::writeReports (this=0x5023a90, parent=...) at /usr/src/debug/kmymoney-4.6.6/kmymoney/mymoney/storage/mymoneystoragexml.cpp:776
#13 0x0000000000790cf3 in MyMoneyStorageXML::writeFile (this=0x5023a90, qf=0x5132100) at /usr/src/debug/kmymoney-4.6.6/kmymoney/mymoney/storage/mymoneystoragexml.cpp:515
#14 0x00000000004b0d11 in KMyMoneyView::saveToLocalFile (this=this@entry=0x295f740, localFile=..., pWriter=pWriter@entry=0x5023a90, plaintext=plaintext@entry=false, keyList=...) at /usr/src/debug/kmymoney-4.6.6/kmymoney/views/kmymoneyview.cpp:1190
#15 0x00000000004b1ead in KMyMoneyView::saveFile (this=0x295f740, url=..., keyList=...) at /usr/src/debug/kmymoney-4.6.6/kmymoney/views/kmymoneyview.cpp:1265
#16 0x000000000048b27c in KMyMoneyApp::slotFileSave (this=0x27291c0) at /usr/src/debug/kmymoney-4.6.6/kmymoney/kmymoney.cpp:1579
#17 0x0000000000497a28 in KMyMoneyApp::qt_static_metacall (_o=0x27291c0, _c=<optimized out>, _id=<optimized out>, _a=0x7fffcada2b60) at /usr/src/debug/kmymoney-4.6.6/x86_64-redhat-linux-gnu/kmymoney/kmymoney.moc:490
#18 0x0000003d2979b37a in QMetaObject::activate (sender=sender@entry=0x2881fa0, m=m@entry=0x3d2baa1840 <QAction::staticMetaObject>, local_signal_index=local_signal_index@entry=1, argv=argv@entry=0x7fffcada2b60) at kernel/qobject.cpp:3567
#19 0x0000003d2afc4862 in QAction::triggered (this=this@entry=0x2881fa0, _t1=false) at .moc/release-shared/moc_qaction.cpp:276
#20 0x0000003d2afc63f7 in QAction::activate (this=0x2881fa0, event=<optimized out>) at kernel/qaction.cpp:1257
#21 0x0000003d2b3920e6 in QAbstractButtonPrivate::click (this=this@entry=0x28e8180) at widgets/qabstractbutton.cpp:530
#22 0x0000003d2b39222c in QAbstractButton::mouseReleaseEvent (this=0x27c2280, e=0x7fffcada30d0) at widgets/qabstractbutton.cpp:1123
#23 0x0000003d2b453aea in QToolButton::mouseReleaseEvent (this=<optimized out>, e=<optimized out>) at widgets/qtoolbutton.cpp:723
#24 0x0000003d2b01dcc8 in QWidget::event (this=0x27c2280, event=0x7fffcada30d0) at kernel/qwidget.cpp:8389
#25 0x0000003d2afcae5c in QApplicationPrivate::notify_helper (this=0x25b7d20, receiver=0x27c2280, e=0x7fffcada30d0) at kernel/qapplication.cpp:4565
#26 0x0000003d2afd18f1 in QApplication::notify (this=this@entry=0x25ad390, receiver=receiver@entry=0x27c2280, e=e@entry=0x7fffcada30d0) at kernel/qapplication.cpp:4108
#27 0x00000037bb04a59a in KApplication::notify (this=0x25ad390, receiver=0x27c2280, event=0x7fffcada30d0) at /usr/src/debug/kdelibs-4.13.3/kdeui/kernel/kapplication.cpp:311
#28 0x0000003d297868fd in QCoreApplication::notifyInternal (this=0x25ad390, receiver=0x27c2280, event=0x7fffcada30d0) at kernel/qcoreapplication.cpp:953
#29 0x0000003d2afd1067 in QApplicationPrivate::sendMouseEvent (receiver=0x27c2280, event=0x7fffcada30d0, alienWidget=0x27c2280, nativeWidget=0x27e68f0, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true) at ../../src/corelib/kernel/qcoreapplication.h:231
#30 0x0000003d2b04663b in QETWidget::translateMouseEvent (this=0x27e68f0, event=<optimized out>) at kernel/qapplication_x11.cpp:4540
#31 0x0000003d2b0450ac in QApplication::x11ProcessEvent (this=0x25ad390, event=event@entry=0x7fffcada3440) at kernel/qapplication_x11.cpp:3663
#32 0x0000003d2b06cac4 in x11EventSourceDispatch (s=s@entry=0x25be9b0, callback=0x0, user_data=0x0) at kernel/qguieventdispatcher_glib.cpp:148
#33 0x000000394b0492a6 in g_main_dispatch (context=0x25be8f0) at gmain.c:3066
#34 g_main_context_dispatch (context=context@entry=0x25be8f0) at gmain.c:3642
#35 0x000000394b049628 in g_main_context_iterate (context=context@entry=0x25be8f0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713
#36 0x000000394b0496dc in g_main_context_iteration (context=0x25be8f0, may_block=1) at gmain.c:3774
#37 0x0000003d297b541e in QEventDispatcherGlib::processEvents (this=0x258aca0, flags=...) at kernel/qeventdispatcher_glib.cpp:450
#38 0x0000003d2b06cc46 in QGuiEventDispatcherGlib::processEvents (this=<optimized out>, flags=...) at kernel/qguieventdispatcher_glib.cpp:207
#39 0x0000003d2978538f in QEventLoop::processEvents (this=this@entry=0x7fffcada3830, flags=...) at kernel/qeventloop.cpp:149
#40 0x0000003d297856dd in QEventLoop::exec (this=this@entry=0x7fffcada3830, flags=...) at kernel/qeventloop.cpp:204
#41 0x0000003d2978ada9 in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#42 0x0000003d2afc94dc in QApplication::exec () at kernel/qapplication.cpp:3823
#43 0x0000000000457981 in runKMyMoney (splash=splash@entry=0x27469d0, a=0x25ad390) at /usr/src/debug/kmymoney-4.6.6/kmymoney/main.cpp:282
#44 0x00000000004562b6 in main (argc=1, argv=0x7fffcada42d8) at /usr/src/debug/kmymoney-4.6.6/kmymoney/main.cpp:181

Possible duplicates by query: bug 327663.

Report to https://bugs.kde.org/
Comment 6 Marcelo Ricardo Leitner 2014-08-19 03:08:37 UTC
My crash is due to this report:

  <REPORT includesprice="0" includesactuals="0" columnsaredays="0" includestransfers="0" loans="0" id="R000001" comment="Relatório personalizado" columntype="months" rowtype="expenseincome" name="Receitas e despesas deste ano (Personalizado)" chartgridlines="1" includesaverageprice="0" includesmovingaverage="0" chartbydefault="0" skipZero="0" datelock="yeartodate" investments="0" charttype="line" favorite="1" showrowtotals="1" chartdatalabels="1" convertcurrency="1" chartlinewidth="2" detail="pie" includeschedules="0" tax="0" group="Income and Expenses" includesforecast="0" includeunused="0" mixedtime="0" type="pivottable 1.15">
   <ACCOUNTGROUP group="expense"/>
   <ACCOUNTGROUP group="income"/>
  </REPORT>

If I remove this one from my .kmy file, it works again just fine.

Interesting that I also have:

  <REPORT includesprice="0" includesactuals="0" columnsaredays="0" includestransfers="0" loans="0" id="R000003" comment="Relatório personalizado" columntype="months" rowtype="expenseincome" name="Receitas e despesas deste mês (Personalizado)" chartgridlines="1" includesaverageprice="0" includesmovingaverage="0" chartbydefault="0" skipZero="0" datelock="currentmonth" investments="0" charttype="line" favorite="0" showrowtotals="1" chartdatalabels="1" convertcurrency="1" chartlinewidth="2" detail="all" includeschedules="0" tax="0" group="Income and Expenses" includesforecast="0" includeunused="0" mixedtime="0" type="pivottable 1.15">
   <ACCOUNTGROUP group="expense"/>
   <ACCOUNTGROUP group="income"/>
  </REPORT>

and this one works just fine.
Comment 7 Cristian Oneț 2014-08-19 15:21:53 UTC
Thanks for the provided information, I managed to reproduce the crash using it.
Comment 8 Cristian Oneț 2014-08-19 15:32:05 UTC
OK, the fix is coming up, it's caused by a value that is not properly initialized in combination with the report that has an invalid 'detail' attribute. If you can't update from master after the fix is pushed a workaround is to make sure that the detail attribute has a value in [none,all,top,group,total,invalid] in your file.
Comment 9 Cristian Oneț 2014-08-19 15:36:59 UTC
Git commit 442e44a1bf70e07fd4cd85460d22a90d1accf398 by Cristian Oneț.
Committed on 19/08/2014 at 15:35.
Pushed by conet into branch 'master'.

Properly initialize a report object before reading it.

This way we make sure that it's valid even if the xml data is not.

M  +2    -0    kmymoney/mymoney/mymoneyreport.cpp

http://commits.kde.org/kmymoney/442e44a1bf70e07fd4cd85460d22a90d1accf398
Comment 10 Cristian Oneț 2014-08-19 15:37:28 UTC
Git commit e7b64d1488cfdfce7813dbbd7388f3f5ffcbd068 by Cristian Oneț.
Committed on 19/08/2014 at 15:35.
Pushed by conet into branch 'frameworks'.

Properly initialize a report object before reading it.

This way we make sure that it's valid even if the xml data is not.
(cherry picked from commit 442e44a1bf70e07fd4cd85460d22a90d1accf398)

M  +2    -0    kmymoney/mymoney/mymoneyreport.cpp

http://commits.kde.org/kmymoney/e7b64d1488cfdfce7813dbbd7388f3f5ffcbd068
Comment 11 Marcelo Ricardo Leitner 2014-08-19 15:43:28 UTC
Hah, I missed the difference on the detail attribute in there. Many thanks Cristian!
Comment 12 Cristian Oneț 2014-08-19 15:51:09 UTC
I also only spotted it with the help of the debugger. You're welcome.
Comment 13 Christian David 2014-09-24 19:31:00 UTC
Git commit 58944b69daeb8ae49c3ccf5916852b8efc9ce3d4 by Christian Dávid, on behalf of Cristian Oneț.
Committed on 19/08/2014 at 15:35.
Pushed by christiand into branch 'add-onlinebanking'.

Properly initialize a report object before reading it.

This way we make sure that it's valid even if the xml data is not.

M  +2    -0    kmymoney/mymoney/mymoneyreport.cpp

http://commits.kde.org/kmymoney/58944b69daeb8ae49c3ccf5916852b8efc9ce3d4