Bug 328967 - An exception in a slot called by a signal emitted in MyMoneyFile::commitTransaction() causes a crash with useless error message
Summary: An exception in a slot called by a signal emitted in MyMoneyFile::commitTrans...
Status: REPORTED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: git (master)
Platform: Compiled Sources All
: NOR wishlist
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-18 15:33 UTC by Christian David
Modified: 2013-12-18 15:33 UTC (History)
0 users

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 Christian David 2013-12-18 15:33:10 UTC
An exception in a slot called by a signal emitted in MyMoneyFile::commitTransaction() causes a crash in a way that it is really hard for a developer to find the root of all evil.

The reason is that the MyMoneyFileTransaction can have m_needRollback == true even if the commit was finished and MyMoneyFile::d->m_inTransaction was set false already.

An uncaught exception causes the MyMoneyFileTransaction to be destructed which starts a rollback then. MyMoneyFile::rollbackTransaction() detects that no transaction was started (because it is finished already). This leads to another exception which makes it really hard to find the bug.

During normal usage this should not happen anyway and the data is as save as in any other uncaught exception. It is unlikly that this leads to other bugs. Just reported it here because a bug based on this is really hard to find and share my experience. A fix is not urgent nor necessary.

Reproducible: Always

Steps to Reproduce:
1. connect a slot to any signal of MyMoneyFile (which is emitted during commitTransaction())
2. throw an exception in this slot
3. change data & commit a transaction in a way that your slot called
Actual Results:  
KMyMoney crashes with unusable error message.

Expected Results:  
Crash with usable error message.