[kmymoney] [Bug 402708] New: Division by zero errors in investement reports

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Sun Dec 30 14:45:50 GMT 2018


https://bugs.kde.org/show_bug.cgi?id=402708

            Bug ID: 402708
           Summary: Division by zero errors in investement reports
           Product: kmymoney
           Version: git (master)
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: reports
          Assignee: kmymoney-devel at kde.org
          Reporter: zoltan1980 at gmail.com
  Target Milestone: ---

I get division by zero errors in three different places.

In investment performance report, triggered by having a negative investment
balance at the start of the report period (rather unconventional, but useful
under certain circumstances):

Thread 1 "kmymoney" received signal SIGFPE, Arithmetic exception.
0x00007fffeb28255a in __gmp_exception () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
(gdb) bt
#0  0x00007fffeb28255a in __gmp_exception () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#1  0x00007fffeb28258e in __gmp_divide_by_zero () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#2  0x00007fffeb29f425 in __gmpq_div () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#3  0x00007ffff163c6ab in AlkValue::operator/(AlkValue const&) const () from
/usr/lib/x86_64-linux-gnu/libalkimia5.so.7
#4  0x00007ffff6198df5 in MyMoneyMoney::operator/ (this=0x7fffffffc520, _b=...)
at ./kmymoney/mymoney/mymoneymoney.cpp:374
#5  0x00007fffc531ac20 in reports::QueryTable::helperROI (this=0x55555b1ee970,
buys=..., sells=..., startingBal=..., endingBal=..., cashIncome=...)
    at ./kmymoney/plugins/views/reports/core/querytable.cpp:1061
#6  0x00007fffc531ebde in reports::QueryTable::constructPerformanceRow
(this=0x55555b1ee970, account=..., result=..., all=...)
    at ./kmymoney/plugins/views/reports/core/querytable.cpp:1408
#7  0x00007fffc53209a6 in reports::QueryTable::constructAccountTable
(this=0x55555b1ee970) at
./kmymoney/plugins/views/reports/core/querytable.cpp:1518
#8  0x00007fffc530fb83 in reports::QueryTable::init (this=0x55555b1ee970) at
./kmymoney/plugins/views/reports/core/querytable.cpp:91
#9  0x00007fffc530fab6 in reports::QueryTable::QueryTable (this=0x55555b1ee970,
_report=...) at ./kmymoney/plugins/views/reports/core/querytable.cpp:77
#10 0x00007fffc52ac2ec in KReportTab::updateReport (this=0x55555b196f50) at
./kmymoney/plugins/views/reports/kreportsview_p.h:365
[...]

In capital gains report, triggered by add/remove shares transactions:

#0  0x00007fffeb28255a in __gmp_exception () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#1  0x00007fffeb28258e in __gmp_divide_by_zero () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#2  0x00007fffeb29f425 in __gmpq_div () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#3  0x00007ffff163c6ab in AlkValue::operator/(AlkValue const&) const () from
/usr/lib/x86_64-linux-gnu/libalkimia5.so.7
#4  0x00007ffff6198df5 in MyMoneyMoney::operator/ (this=0x7fffffffc970, _b=...)
at ./kmymoney/mymoney/mymoneymoney.cpp:374
#5  0x00007fffc531fa80 in reports::QueryTable::constructCapitalGainRow
(this=0x55555b20e020, account=..., result=...)
    at ./kmymoney/plugins/views/reports/core/querytable.cpp:1459
#6  0x00007fffc5320f7b in reports::QueryTable::constructAccountTable
(this=0x55555b20e020) at
./kmymoney/plugins/views/reports/core/querytable.cpp:1537
#7  0x00007fffc530fb83 in reports::QueryTable::init (this=0x55555b20e020) at
./kmymoney/plugins/views/reports/core/querytable.cpp:91
#8  0x00007fffc530fab6 in reports::QueryTable::QueryTable (this=0x55555b20e020,
_report=...) at ./kmymoney/plugins/views/reports/core/querytable.cpp:77
#9  0x00007fffc52ac2ec in KReportTab::updateReport (this=0x55555b618bd0) at
./kmymoney/plugins/views/reports/kreportsview_p.h:365
[...]

Under the same conditions after fixing the one above:

#0  0x00007fffeb28255a in __gmp_exception () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#1  0x00007fffeb28258e in __gmp_divide_by_zero () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#2  0x00007fffeb29f425 in __gmpq_div () from
/usr/lib/x86_64-linux-gnu/libgmp.so.10
#3  0x00007ffff163c6ab in AlkValue::operator/(AlkValue const&) const () from
/usr/lib/x86_64-linux-gnu/libalkimia5.so.7
#4  0x00007ffff6198df5 in MyMoneyMoney::operator/ (this=0x7fffffffcaa0, _b=...)
at ./kmymoney/mymoney/mymoneymoney.cpp:374
#5  0x00007fffc53120f0 in reports::QueryTable::constructTotalRows
(this=0x55555b223c30) at
./kmymoney/plugins/views/reports/core/querytable.cpp:362
#6  0x00007fffc5310cce in reports::QueryTable::init (this=0x55555b223c30) at
./kmymoney/plugins/views/reports/core/querytable.cpp:269
#7  0x00007fffc530fb36 in reports::QueryTable::QueryTable (this=0x55555b223c30,
_report=...) at ./kmymoney/plugins/views/reports/core/querytable.cpp:77
#8  0x00007fffc52ac36c in KReportTab::updateReport (this=0x55555b4f1500) at
./kmymoney/plugins/views/reports/kreportsview_p.h:365
[...]

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list