Bug 285310 - Uncaught exception in mymoneyseqaccessmgr.cpp:820
Summary: Uncaught exception in mymoneyseqaccessmgr.cpp:820
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 4.5.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-30 12:02 UTC by schlatter@phys.ethz.ch
Modified: 2011-10-30 14:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Anonymous file to reproduce bug, 2 screenshots with uncaught exceptions. (329.03 KB, application/x-gzip)
2011-10-30 12:02 UTC, schlatter@phys.ethz.ch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description schlatter@phys.ethz.ch 2011-10-30 12:02:37 UTC
Created attachment 65043 [details]
Anonymous file to reproduce bug, 2 screenshots with uncaught exceptions.

Version:           4.5.3 (using KDE 4.7.2) 
OS:                Linux

Certain transactions lead to an uncaught exception when trying to delete them.
In some cases this happens only when two transaction are deleted simultaneously but does not happen when each is deleted seperately. In the later case, deletion of one entry leads to removal of both entries.

Context: This bug (these bugs?) occur in a file that was built over several years (2002-2011) and contains a couple of 1000 transactions. I have stripped it of as many transactions, accounts etc. as possible to help narrow down the problem.

In the original (non-anonymized) file, the two transactions look strange: Deposits are zero, From, Category, and Memo fields are all empty strings.

Reproducible: Always

Steps to Reproduce:
Part I:
Open UncaughtException.anon.xml
Open Accounts:Asset:A000108:A000003
Select both transactions
right-click->delete
Confirm to delete reconciled splits
Confirm delete
Confirm error message
---------------
Part II:
Select 1st transaction seperately
right-click delete
Confirm twice
------------
Part III:
Open Accounts:A000108:A000002
right-click on "new" transaction => delete
Confirm error message

Actual Results:  
Part I:
Deletion results in an uncaught exception (screenshot1.png)
Part II:
Deletion of 1st entry results in removal of both entries
Part III:
Deletion of "new" entry results in uncaught exception (screenshot2.png)

Expected Results:  
No uncaught exceptions.
Deletion of transaction 1 results in deletion of transaction 1 only, not transactions 1 as well as 2
The "new" transaction should not be deleteable at all.

OS: Linux (i686) release 3.0.0-12-generic-pae
Compiler: gcc
Remark: As soon as the file UncaughtException.anon.xml is opened, it is immediately marked as [modified] in title bar.
Comment 1 Thomas Baumgart 2011-10-30 14:20:39 UTC
Part I and Part III are valid bugs. Part II works as designed.

The problem is, that in this special case we have two splits referring to the same account. This is actually valid (though I doubt you can create such a transaction with recent versions of KMyMoney other than importing from different sources). Thus, deleting one entry of the transaction automatically *must* delete the other one (Part II).

I know how to fix this will also backport it to the stable branch.

p.s. Thanks for the detailed analysis and anon file provided. Having it, it was easy to see what's going on.
Comment 2 Thomas Baumgart 2011-10-30 14:25:00 UTC
SVN commit 1261602 by tbaumgart:

BUG: 285310

Make sure not to try to delete the same transaction twice in case of multiple selected transactions.
Don't allow to delete the empty transaction at the end of the ledger.



 M  +21 -4     kmymoney.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1261602
Comment 3 Thomas Baumgart 2011-10-30 14:33:11 UTC
SVN commit 1261603 by tbaumgart:

BUG: 285310

Make sure not to try to delete the same transaction twice in case of multiple selected transactions.
Don't allow to delete the empty transaction at the end of the ledger.

Backported to stable branch



 M  +21 -4     kmymoney.cpp  


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