Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#405 Moving transactions may corrupt save file

1.0
open
nobody
5
2010-06-28
2010-06-28
Anonymous
No

Sometimes, when a set of transactions is moved from one category to another, and the prior category deleted, the software will appear to work fine for a while, and will save the datafile, but the saved data and the internal representation are corrupt and any attempt to load the datafile will thereafter cause a program crash. This happens in 1.02 (the latest version available for my distribution of Linux).
I cannot get a stacktrace as my distribution doesn't include the "drkonqi" tool.
Here are steps to reproduce:
Start with a well loaded datafile (seems to require at least several hundred transactions of various types; I use a file with about 1 year of real usage).
Create some transactions with split categories
In each split, include an amount for Test:Wrong, when it first pops up asking for a new category, make sure you MISCATEGORIZE this expense as income.
Try to include several transactions, it seems to require about 20-30 before it fails.
Create a new *expense* category titled Test:Right.
From the category view, open the ledger for Income:Test:Wrong
Ctrl-A select all transactions and right-click select move...to and select Expense:Test:Right
Go back to the Category list by clicking on the Categories icon.
Select the Income:Test parent category
right-click delete, select delete all when prompted
Save.
Quit
Reopen KMyMoney
In nearly every case, KMyMoney will crash after loading the datafile.
From what I can deduce without a functioning debugger, the transactions aren't moved properly to the new category (or some are missed), and they don't get moved when delete all is selected, so they end up in an indeterminate state and the software can't handle it, so it exits with an exception.
If you do NOT move the transactions, and delete the Income:Test:Wrong category directly, the dialog that pops up to recategorize the transactions works fine, and the datafile remains sane, so this only happens if the user is being extra careful (which is quite ironic, actually) to move transactions before deleting a category.

Discussion

  • Start kmymoney with kmymoney -n. Go to Home settings and uncheck everything. Open your file. Go to Save As, and select the anonymous file format and save it. Attach the .anon.xml file here.
    1.0.5 is the latest version, BTW.