Reply to topic

Zero divide in Net Worth Chart

zebulon
Registered Member
Posts
264
Karma
2
OS

Zero divide in Net Worth Chart

Sun Jun 17, 2012 9:53 pm
I am getting a floating point exception when generating a net worth graph.
It occurs only if I include a particular investment account.
It occurs only for graphs that go back about two years in time or more.
Failure is not deterministic. That is, when trying to find a date after which the problem does not occur, I am getting inconsistent behavior. I am running KMM under gdb, which makes it easy to restart. A given date may work once and fail next. Random behavior occurs when the starting date is sometime during 2010; If it is 2009 or older, it fails more often. The behavior does not depend on whether I check the option "convert to base currency." I did not find an existing bug, but the traceback is below.

Example of one gdb session:

test 1: default graph (start 01/01/2012): OK
test 2: start date is 01/01/2010: OK
test 3: start date is 01/01/2009: fail; rerun
test 4: default graph: OK
test 5: start date is 01/01/2010: fail; rerun
test 6: default graph: OK
test 7: start date is 01/01/2010: OK
test 8: start date is 12/31/2009: OK
test 9: start date is 07/01/2009: fail; rerun
test 10: default graph OK
test 11: start date is 01/01/2010: OK
test 12: start date is 07/01/2009: fail

One problem is that I cannot delete nor reconfigure a saved Custom Net Worth Graph.

This is KMM 1.0.5

Program received signal SIGFPE, Arithmetic exception.
0x01f1d79b in __divdi3 () from /lib/libgcc_s.so.1
(gdb) bt
#0 0x01f1d79b in __divdi3 () from /lib/libgcc_s.so.1
#1 0x0014ad18 in MyMoneyMoney::reduce() const ()
from .../kmymoney2-1.0.5/kmymoney2/mymoney/.libs/libkmm_mymoney.so.5
#2 0x08280afb in reports::PivotTable::convertToDeepCurrency() ()
#3 0x0828510f in reports::PivotTable::init() ()
#4 0x08286245 in reports::PivotTable::PivotTable(MyMoneyReport const&) ()
#5 0x0821a6d8 in KReportsView::KReportTab::updateReport() ()
#6 0x0821a852 in KReportsView::KReportTab::show() ()
#7 0x01794bfe in QWidgetStack::raiseWidget(QWidget*) () from /usr/lib/libqt-mt.so.3
#8 0x01780bfb in QTabWidget::showPage(QWidget*) () from /usr/lib/libqt-mt.so.3
#9 0x082181c3 in KReportsView::slotConfigure() ()
#10 0x08224638 in KReportsView::qt_invoke(int, QUObject*) ()
#11 0x0164d19a in QObject::activate_signal(QConnectionList*, QUObject*) () from /usr/lib/libqt-mt.so.3
#12 0x0164f168 in QObject::activate_signal(int) () from /usr/lib/libqt-mt.so.3
#13 0x019b360c in QButton::clicked() () from /usr/lib/libqt-mt.so.3
#14 0x016e83e0 in QButton::mouseReleaseEvent(QMouseEvent*) () from /usr/lib/libqt-mt.so.3
#15 0x01686d81 in QWidget::event(QEvent*) () from /usr/lib/libqt-mt.so.3
#16 0x015e83d7 in QApplication::internalNotify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#17 0x015e94f5 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#18 0x0128878b in KApplication::notify(QObject*, QEvent*) () from /usr/lib/libkdecore.so.4
#19 0x015826ce in QApplication::sendSpontaneousEvent(QObject*, QEvent*) () from /usr/lib/libqt-mt.so.3
#20 0x0157f439 in QETWidget::translateMouseEvent(_XEvent const*) () from /usr/lib/libqt-mt.so.3
#21 0x0157e237 in QApplication::x11ProcessEvent(_XEvent*) () from /usr/lib/libqt-mt.so.3
#22 0x01592884 in QEventLoop::processEvents(unsigned int) () from /usr/lib/libqt-mt.so.3
#23 0x016013b0 in QEventLoop::enterLoop() () from /usr/lib/libqt-mt.so.3
#24 0x01601256 in QEventLoop::exec() () from /usr/lib/libqt-mt.so.3
---Type <return> to continue, or q <return> to quit---
#25 0x015e8a2f in QApplication::exec() () from /usr/lib/libqt-mt.so.3
#26 0x08197615 in main ()
zebulon
Registered Member
Posts
264
Karma
2
OS

Re: Zero divide in Net Worth Chart

Sun Jan 27, 2013 8:20 pm
I made a copy of my kmy file and reopened all closed investments in order to get a report. I also updated some prices in this copy. Everything was OK. After exiting, I reopened this file a little later and got the following error:
Code: Select all
KCrash: Application 'kmymoney' crashing...
Could not find 'drkonqi' executable.
KCrash cannot reach kdeinit, launching directly.
This happens while computing the net worth upon startup. I re-opened the file under gdb and found exactly the same traceback as above.

So, there seems to be a link between the drkonqi message as signaled by several other users and the zero divide in the net worth. I am almost certain this crash is caused by investments containing a share split.
User avatar Hei Ku
Moderator
Posts
649
Karma
2
OS

Re: Zero divide in Net Worth Chart

Sun Jan 27, 2013 10:26 pm
There is a ton of fixes into reports after 1.0.5. Can you upgrade to 4.6.3?


Hei Ku, proud to be a member of the KMyMoney Development Team since January-2008
zebulon
Registered Member
Posts
264
Karma
2
OS

Re: Zero divide in Net Worth Chart

Sun Feb 03, 2013 2:44 am
Hei Ku wrote:Can you upgrade to 4.6.3?
Is it possible to have both installed at the same time? I tried building 4.6.3 from source but I'm getting install errors,
Code: Select all
CMake Error at /usr/share/cmake-2.8/Modules/FindKDE4.cmake:95 (FIND_PACKAGE):
  Could not find module FindKDE4Internal.cmake or a configuration file for
  package KDE4Internal.
...
CMake Error at CMakeLists.txt:55 (include):
  include could not find load file:
    KDE4Defaults

CMake Error at CMakeLists.txt:56 (include):
  include could not find load file:
    MacroLibrary

CMake Error at CMakeLists.txt:65 (find_package):
  Could not find module FindQGpgme.cmake or a configuration file for package
  QGpgme.
and some more.

Thanks.
User avatar Hei Ku
Moderator
Posts
649
Karma
2
OS

Re: Zero divide in Net Worth Chart

Sun Feb 03, 2013 2:56 am
It is possible to have both installed, IIRC, but it's not recommended to use the same file for such different versions.
The errors are due to missing devel packages. You need the kder4libs-devel and kdepimlibs-devel packages. The names may vary according to your specific distro.


Hei Ku, proud to be a member of the KMyMoney Development Team since January-2008
zebulon
Registered Member
Posts
264
Karma
2
OS
Just for what it is worth, the problems were caused by a stock split operation. Stock splits usually do not cause net worth charts to fail, but this one did. The reason is that it was not really a stock split. Some share was discontinued and converted into a different one with similar characteristics. I had entered this as a split with a very strange ratio. I suspect the report uses some kind of regularization which generated a floating-point exception because of the awkward split ratio. The proper solution, avoiding tax implications, is to define a "remove shares" operation for the old shares and an "add shares" operation for the new shares. After this, net worth charts worked fine.

 
Reply to topic

Bookmarks



Who is online

Registered users: alake, Alexa [Bot], Baidu [Spider], Bing [Bot], blue_bullet, chicken2jail, claydoh, colomar, Exabot [Bot], garthecho, ghevan, Google [Bot], google01103, Hans, inhiway, kainz.a, koriun, La Ninje, lazyit, Majestic-12 [Bot], mmistretta, nezumi, pedrorodriguez, private_lock, robinh, scummos, Tuukka, urgo, Uri_Herrera, wolfi323, Yahoo [Bot]