Bug 340552 - kmymoney crashes while attempting to save changes to local file
Summary: kmymoney crashes while attempting to save changes to local file
Status: RESOLVED DUPLICATE of bug 324447
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.6.6
Platform: Ubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 14:42 UTC by Bob Mroczka
Modified: 2015-02-04 15:11 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Mroczka 2014-11-01 14:42:34 UTC
Crash leaves the kmy file empty requiring restoration from an older backup.

Reproducible: Sometimes

Steps to Reproduce:
1.  attempt to save changes
2.
3.

Actual Results:  
segfault

Expected Results:  
To save changes without crashing

Application: kmymoney (4.6.4)
KDE Platform Version: 4.14.2
Qt Version: 4.8.6
Operating System: Linux 3.13.0-37-generic i686
Distribution: Ubuntu 14.04.1 LTS

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

I was saving my changes when crashed occurred.  Crash leaves the kmy file empty requiring restoration from an older backup.

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 0xb3f4e740 (LWP 8001))]

Thread 2 (Thread 0xb0312b40 (LWP 8002)):
#0  0xb4803126 in g_mutex_unlock () from /lib/i386-linux-gnu/libglib-2.0.so.0
#1  0xb47bdfa8 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#2  0xb47be468 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb47be528 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb618d95f in QEventDispatcherGlib::processEvents (this=0xafa00468, flags=...) at kernel/qeventdispatcher_glib.cpp:436
#5  0xb615c823 in QEventLoop::processEvents (this=this@entry=0xb0312258, flags=...) at kernel/qeventloop.cpp:149
#6  0xb615cb49 in QEventLoop::exec (this=this@entry=0xb0312258, flags=...) at kernel/qeventloop.cpp:204
#7  0xb604923d in QThread::exec (this=this@entry=0x9218278) at thread/qthread.cpp:537
#8  0xb613cc44 in QInotifyFileSystemWatcherEngine::run (this=0x9218278) at io/qfilesystemwatcher_inotify.cpp:265
#9  0xb604bb6f in QThreadPrivate::start (arg=0x9218278) at thread/qthread_unix.cpp:349
#10 0xb4894f70 in start_thread (arg=0xb0312b40) at pthread_create.c:312
#11 0xb52a24ce in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:129

Thread 1 (Thread 0xb3f4e740 (LWP 8001)):
[KCrash Handler]
#7  ref (this=0x2) at ../../include/QtCore/../../src/corelib/arch/qatomic_i386.h:120
#8  QString (other=..., this=0xbffa5934) at ../../include/QtCore/../../src/corelib/tools/qstring.h:726
#9  encodeText (str=..., s=..., encodeQuotes=encodeQuotes@entry=true, performAVN=performAVN@entry=true, encodeEOLs=encodeEOLs@entry=false) at dom/qdom.cpp:4182
#10 0xb659a09e in QDomElementPrivate::save (this=0x12d2edf8, s=..., depth=4, indent=1) at dom/qdom.cpp:4619
#11 0xb659a582 in save (indent=<optimized out>, depth=4, s=..., this=<optimized out>) at dom/qdom.cpp:1919
#12 QDomElementPrivate::save (this=0x12d2e1f0, s=..., depth=3, indent=1) at dom/qdom.cpp:4652
#13 0xb659a582 in save (indent=<optimized out>, depth=3, s=..., this=<optimized out>) at dom/qdom.cpp:1919
#14 QDomElementPrivate::save (this=0x12d2dbd8, s=..., depth=2, indent=1) at dom/qdom.cpp:4652
#15 0xb659a582 in save (indent=<optimized out>, depth=2, s=..., this=<optimized out>) at dom/qdom.cpp:1919
#16 QDomElementPrivate::save (this=0x9783f50, s=..., depth=1, indent=1) at dom/qdom.cpp:4652
#17 0xb659a582 in save (indent=<optimized out>, depth=1, s=..., this=<optimized out>) at dom/qdom.cpp:1919
#18 QDomElementPrivate::save (this=0x978e9a8, s=..., depth=0, indent=1) at dom/qdom.cpp:4652
#19 0xb6593d6e in QDomDocumentPrivate::saveDocument (this=0x8ce6dd0, s=..., indent=1, encUsed=QDomNode::EncodingFromDocument) at dom/qdom.cpp:6477
#20 0xb6594072 in QDomNode::save (this=0x8ce6dd0, this@entry=0xbb8ab38, str=..., indent=indent@entry=1, encodingPolicy=encodingPolicy@entry=QDomNode::EncodingFromDocument) at dom/qdom.cpp:2712
#21 0xb65940b3 in QDomNode::save (this=this@entry=0xbb8ab38, str=..., indent=indent@entry=1) at dom/qdom.cpp:2691
#22 0xb659a91c in QDomDocument::toString (this=0xbb8ab38, indent=indent@entry=1) at dom/qdom.cpp:6853
#23 0x0841bd86 in MyMoneyStorageXML::writeFile (this=0x9790e88, qf=0xbd23228, storage=0x90b0554) at /build/buildd/kmymoney-4.6.4/kmymoney/mymoney/storage/mymoneystoragexml.cpp:524
#24 0x080ebc3d in KMyMoneyView::saveToLocalFile (this=0x8e9d850, localFile=..., pWriter=0x9790e88, plaintext=plaintext@entry=false, keyList=...) at /build/buildd/kmymoney-4.6.4/kmymoney/views/kmymoneyview.cpp:1190
#25 0x080ecfb8 in KMyMoneyView::saveFile (this=0x8e9d850, url=..., keyList=...) at /build/buildd/kmymoney-4.6.4/kmymoney/views/kmymoneyview.cpp:1265
#26 0x080c23fa in KMyMoneyApp::slotFileSave (this=this@entry=0x8d091d8) at /build/buildd/kmymoney-4.6.4/kmymoney/kmymoney.cpp:1579
#27 0x080d0226 in KMyMoneyApp::qt_static_metacall (_o=_o@entry=0x8d091d8, _c=_c@entry=QMetaObject::InvokeMetaMethod, _id=113, _a=0xbffa6158) at /build/buildd/kmymoney-4.6.4/obj-i686-linux-gnu/kmymoney/kmymoney.moc:491
#28 0xb61730f7 in QMetaObject::activate (sender=0x8ee5880, m=0xb5f46718 <QAction::staticMetaObject>, local_signal_index=1, argv=0xbffa6158) at kernel/qobject.cpp:3539
#29 0xb55e572d in QAction::triggered(bool) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#30 0xb55e7324 in QAction::activate(QAction::ActionEvent) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#31 0xb55e74b0 in QAction::event(QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#32 0xb6b356bd in KAction::event (this=0x8ee5880, event=0xbffa6498) at ../../kdeui/actions/kaction.cpp:131
#33 0xb55ec7f4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#34 0xb55f32d3 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#35 0xb6c241b4 in KApplication::notify (this=0x8c85a48, receiver=0x8ee5880, event=0xbffa6498) at ../../kdeui/kernel/kapplication.cpp:311
#36 0xb615de4a in QCoreApplication::notifyInternal (this=0x8c85a48, receiver=0x8ee5880, event=0xbffa6498) at kernel/qcoreapplication.cpp:953
#37 0xb56248bb in QShortcutMap::dispatchEvent(QKeyEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#38 0xb5624a3d in QShortcutMap::tryShortcutEvent(QObject*, QKeyEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#39 0xb55f4ca8 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#40 0xb6c241b4 in KApplication::notify (this=0x8c85a48, receiver=0x950adf0, event=0xbffa6798) at ../../kdeui/kernel/kapplication.cpp:311
#41 0xb615de4a in QCoreApplication::notifyInternal (this=0x8c85a48, receiver=0x950adf0, event=0xbffa6798) at kernel/qcoreapplication.cpp:953
#42 0xb55eac7d in qt_sendSpontaneousEvent(QObject*, QEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#43 0xb569e829 in QKeyMapper::sendKeyEvent(QWidget*, bool, QEvent::Type, int, QFlags<Qt::KeyboardModifier>, QString const&, bool, int, unsigned int, unsigned int, unsigned int, bool*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#44 0xb569ec18 in QKeyMapperPrivate::translateKeyEvent(QWidget*, _XEvent const*, bool) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#45 0xb5674da5 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#46 0xb56a1524 in x11EventSourceDispatch(_GSource*, int (*)(void*), void*) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#47 0xb47be1e3 in g_main_context_dispatch () from /lib/i386-linux-gnu/libglib-2.0.so.0
#48 0xb47be468 in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#49 0xb47be528 in g_main_context_iteration () from /lib/i386-linux-gnu/libglib-2.0.so.0
#50 0xb618d93b in QEventDispatcherGlib::processEvents (this=0x8c6ae28, flags=...) at kernel/qeventdispatcher_glib.cpp:434
#51 0xb56a15de in QGuiEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#52 0xb615c823 in QEventLoop::processEvents (this=this@entry=0xbffa6dc8, flags=...) at kernel/qeventloop.cpp:149
#53 0xb615cb49 in QEventLoop::exec (this=this@entry=0xbffa6dc8, flags=...) at kernel/qeventloop.cpp:204
#54 0xb61628fe in QCoreApplication::exec () at kernel/qcoreapplication.cpp:1225
#55 0xb55eaa24 in QApplication::exec() () from /usr/lib/i386-linux-gnu/libQtGui.so.4
#56 0x0808a2c1 in runKMyMoney (splash=splash@entry=0x8d87df8, a=0x8c85a48) at /build/buildd/kmymoney-4.6.4/kmymoney/main.cpp:282
#57 0x08088874 in main (argc=1, argv=0xbffa7224) at /build/buildd/kmymoney-4.6.4/kmymoney/main.cpp:181

Report to https://bugs.kde.org/
Comment 1 Cristian Oneț 2014-11-05 11:38:19 UTC

*** This bug has been marked as a duplicate of bug 324447 ***
Comment 2 Cristian Oneț 2014-11-05 16:18:24 UTC
Could you please give some more information like how often does this happen, do you remember what you were doing before this happened? Also providing an anonymous file would be nice.
Comment 3 Gilberto Caetano de Andrade 2015-02-03 20:23:19 UTC
I lost all my data because of this bug. I was just working with credit card account adding and tagging some records, when I clicked on save button and then it crashed.
It would be good add a cache version of kmy file, this way Kmymoney could recover my data not destroy all of them.

OpenSUSE 12.3 and Kmymoney 4.7.1 - kde4 4.10.5 "release 1"
Comment 4 allan 2015-02-03 23:51:01 UTC
(In reply to Gilberto Caetano de Andrade from comment #3)
> It would be good add a cache version of kmy file, this way Kmymoney could
> recover my data not destroy all of them.

Would not autosave help in these circumstances?

Can you produce an anon file, as requested in comment #2?
Comment 5 Gilberto Caetano de Andrade 2015-02-04 12:22:02 UTC
(In reply to allan from comment #4)
> (In reply to Gilberto Caetano de Andrade from comment #3)
> > It would be good add a cache version of kmy file, this way Kmymoney could
> > recover my data not destroy all of them.
> 
> Would not autosave help in these circumstances?
How? Kmymony destroy(empty completely) the kmy file file at the crash!

But if Kmymony had a cached version of my file ex.:
.cache/kmymoney/[kmy user file]
And we could help providing that file.

> Can you produce an anon file, as requested in comment #2?
Do you want the empty file?
Comment 6 Cristian Oneț 2015-02-04 13:33:57 UTC
(In reply to Gilberto Caetano de Andrade from comment #5)
> (In reply to allan from comment #4)
> > (In reply to Gilberto Caetano de Andrade from comment #3)
> > > It would be good add a cache version of kmy file, this way Kmymoney could
> > > recover my data not destroy all of them.
> > 
> > Would not autosave help in these circumstances?
> How? Kmymony destroy(empty completely) the kmy file file at the crash!
> 
> But if Kmymony had a cached version of my file ex.:
> .cache/kmymoney/[kmy user file]
> And we could help providing that file.

Did you know about the "Number of backups to keep (0=off)" option from the "General" settings page?

> 
> > Can you produce an anon file, as requested in comment #2?
> Do you want the empty file?
Comment 7 allan 2015-02-04 13:45:14 UTC
<snip>
> Did you know about the "Number of backups to keep (0=off)" option from the
> "General" settings page?

Also, you can specify the frequency of backup.

To stand a chance of finding a bug, some evidence will be needed.
Comment 8 Gilberto Caetano de Andrade 2015-02-04 14:03:42 UTC
(In reply to Cristian Oneț from comment #6)
> (In reply to Gilberto Caetano de Andrade from comment #5)
> > (In reply to allan from comment #4)
> > > (In reply to Gilberto Caetano de Andrade from comment #3)
> > > > It would be good add a cache version of kmy file, this way Kmymoney could
> > > > recover my data not destroy all of them.
> > > 
> > > Would not autosave help in these circumstances?
> > How? Kmymony destroy(empty completely) the kmy file file at the crash!
> > 
> > But if Kmymony had a cached version of my file ex.:
> > .cache/kmymoney/[kmy user file]
> > And we could help providing that file.
> 
> Did you know about the "Number of backups to keep (0=off)" option from the
> "General" settings page?
No! I used to read the manual[1] and do my work step by step. After the crash I've searched for something in the manual and didn't find anything about this option [2].
Where does it save these copies?

Now I've activated it, so if the crash occur I will send the file.
Regards

[1] https://docs.kde.org/stable/en/extragear-office/kmymoney/index.html
[2] https://docs.kde.org/stable/en/extragear-office/kmymoney/details.settings.html#details.settings.general.global
Comment 9 Cristian Oneț 2015-02-04 14:36:50 UTC
(In reply to Gilberto Caetano de Andrade from comment #8)
> (In reply to Cristian Oneț from comment #6)
> > (In reply to Gilberto Caetano de Andrade from comment #5)
> > > (In reply to allan from comment #4)
> > > > (In reply to Gilberto Caetano de Andrade from comment #3)
> > > > > It would be good add a cache version of kmy file, this way Kmymoney could
> > > > > recover my data not destroy all of them.
> > > > 
> > > > Would not autosave help in these circumstances?
> > > How? Kmymony destroy(empty completely) the kmy file file at the crash!
> > > 
> > > But if Kmymony had a cached version of my file ex.:
> > > .cache/kmymoney/[kmy user file]
> > > And we could help providing that file.
> > 
> > Did you know about the "Number of backups to keep (0=off)" option from the
> > "General" settings page?
> No! I used to read the manual[1] and do my work step by step. After the
> crash I've searched for something in the manual and didn't find anything
> about this option [2].

Jack: could you add a note to mention this to the user documentation TODO list?

> Where does it save these copies?

in the same directory as you kmymoney file. So for example "file.kmy" will have "file.kmy~1" as a backup (or something similar) just like a text editor would backup a text file after editing it.

> 
> Now I've activated it, so if the crash occur I will send the file.
> Regards
> 
> [1] https://docs.kde.org/stable/en/extragear-office/kmymoney/index.html
> [2]
> https://docs.kde.org/stable/en/extragear-office/kmymoney/details.settings.
> html#details.settings.general.global
Comment 10 allan 2015-02-04 15:11:20 UTC
<snip>
> > Did you know about the "Number of backups to keep (0=off)" option from the
> > "General" settings page?
> No! I used to read the manual[1] and do my work step by step. After the
> crash I've searched for something in the manual and didn't find anything
> about this option [2].
On that page, it's the second item under Global Options

Also see Backing up on the help menu - Using kmymoney for the first time/backing up.

> Where does it save these copies?

They go in the same folder as your .kmy file.
> 
> Now I've activated it, so if the crash occur I will send the file.
> Regards
> 
> [1] https://docs.kde.org/stable/en/extragear-office/kmymoney/index.html
> [2]
> https://docs.kde.org/stable/en/extragear-office/kmymoney/details.settings.
> html#details.settings.general.global