[GNC] GnuCash crashes when generating Equity Statement

Jakub Sygnowski sygnowski at gmail.com
Tue Jun 29 05:38:50 EDT 2021


Thank you for taking a look. The report is the same one as in
reports/standard/equity-statement.scm. I copied it (and modified the name,
guid, etc.) to not mess with the original one.

I have since discovered where the problem was, though! It was due to having
a lot (5 or 6) of significant numbers in the stock, like 57.7891045.
Somewhere deep down there
<https://github.com/Gnucash/gnucash/blob/985a6420fce4a828ac6b8b255fba6e5e776ded93/libgnucash/engine/gnc-numeric.cpp#L1099>,
the conversion to the original currency failed as it was not fitting into
an int64 and returning #f instead. If I knew Scheme a bit better, I'd be
happy to fix it and show a more meaningful error.

I am still quite confused about the report itself anyway though. When
generating it, I see:
Capital, 29/06/21 £69,251.60

Yet, in the Net total, I see a different (smaller) number, £62,251.60.

I made sure that in both places I use "last price". I also observed that if
I deselected "Expenses" account, the total capital goes down to ~40k, even
though the total in this account is <1k. Any idea why I may see the
discrepancy? When looking at the "assets over time" or "net worth", the
report is showing the same total as the main window. The raport I'd like to
generate is "the increase in the value of the capital, not taking into
account income".

Thank you!
Jakub


On Tue, 29 Jun 2021 at 03:09, Christopher Lam <christopher.lck at gmail.com>
wrote:

> The clue is in the report file name; there's never been an equity report
> in the example folder. Where did you get the report from?
>
> gnucash/reports/example/equity.scm
>
> On Tue, 29 Jun 2021, 9:54 am Jakub Sygnowski, <sygnowski at gmail.com> wrote:
>
>> Hi all,
>> I have a problem with GnuCash where it's crashing when generating Equity
>> Statement.
>>
>> I verified the report works on an empty book, so likely the problem is
>> with
>> my data. I traced it back to gnc:sum-collector-commodity
>> <
>> https://github.com/Gnucash/gnucash/blob/maint/gnucash/report/commodity-utilities.scm#L900
>> >,
>> where one of the commodities gets exchanged to #f which causes the error.
>> I
>> looked at the price database for its entries, but they look fine to me.
>>
>> Any idea what could have gone wrong here?
>> Thank you!
>>
>> Version: 4.4
>> Stacktrace:
>> An error occurred while running the report.
>>
>>           19 (apply-smob/0 #<thunk 7f1c6c731ea0>)
>> In c-interface.scm:
>>      35:4 18 (gnc:call-with-error-handling _ _)
>> In ice-9/boot-9.scm:
>>   1731:15 17 (with-exception-handler #<procedure 7f1c5d4d0b10 at
>> ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
>>   1736:10 16 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>> In c-interface.scm:
>>     40:37 15 (_)
>> In unknown file:
>>           14 (eval-string "(gnc:report-run 0)" #<undefined>)
>> In ice-9/boot-9.scm:
>>    2806:4 13 (save-module-excursion _)
>> In ice-9/eval-string.scm:
>>      38:6 12 (read-and-eval #<input: string 7f1c5d4ca230> #:lang _)
>> In report-core.scm:
>>     772:4 11 (gnc:report-run _)
>> In c-interface.scm:
>>      74:2 10 (gnc:backtrace-if-exception _ . _)
>>      35:4  9 (gnc:call-with-error-handling _ _)
>> In ice-9/boot-9.scm:
>>   1731:15  8 (with-exception-handler #<procedure 7f1c5d4d09f0 at
>> ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
>>   1736:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>> In c-interface.scm:
>>     39:40  6 (_)
>> In report-core.scm:
>>    774:29  5 (_)
>>    756:25  4 (gnc:report-render-html #<<report> type:
>> "bce0c0d9eb31431c9b61a933becb9aea" id: 0 options: #<procedure dispatch
>> (k…>
>> …)
>> In gnucash/reports/example/equity.scm:
>>     295:8  3 (equity-statement-renderer _)
>> In gnucash/report/commodity-utilities.scm:
>>     890:2  2 (gnc:my-collector-comm #<procedure 7f1c5d512060 at
>> report-utilities.scm:374:4 (action commodity amount)> #<swig-po…> …)
>> In unknown file:
>>            1 (+ -12380177/50 0 0 0 5833/100 -1409929/10 33448/25
>> 10270387/100 156399/20 101067/10 1392361/100 67913/4 542029/50 0 …)   <-
>> there is "#f" further down the line here
>> In ice-9/boot-9.scm:
>>   1669:16  0 (raise-exception _ #:continuable? _)
>>
>> In procedure +: Wrong type: #f
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> If you are using Nabble or Gmane, please see
>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>>
>


More information about the gnucash-user mailing list