GNOME Bugzilla – Bug 612467
Void Base amount on advanced portfolio report
Last modified: 2018-06-29 22:36:41 UTC
Created attachment 155780 [details] screenshot Hi, I added one line on a stock account (the price, the total amount, automatically computing the number of stocks purchased), and then their is a void "base amount" on the advanced portfolio report (see screenshot attached: the black box are there for privaty reasons, the bug is in the red squares). When deleting the line, the report works well. The gnucash.trace content is : * WARN <qof.engine> [guid_init()] only got 2162 bytes. The identifiers might not be very random. * INFO <gnc.backend.dbi> [gnc_dbi_check_sqlite3_file] exists, does not have SQLite format string -> not DBI * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> ggaff: could not find signal handler 'gnc_xfer_dialog_fetch'. * WARN <gnc.gui> ggaff: could not find signal handler 'gnc_xfer_dialog_fetch'. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric. * WARN <gnc.gui> [PrintAmountInternal()] Bad numeric.
Dear all, here is an experiment to complete the bug For intial amount computing, FIFO and FILO work well (the base amount is not void). So the bug is in the "Mean" computation method for the base amount.
Bugs 603426, 612467, and 587875 all seem to be related, and I have the same problem. In the middle of calculating the basis in basis-builder there is an overflow in gnc-numeric-add. It happens in the first section commented as: ;; we have value and positive units, add units to basis The debugging printout goes something like this: * 09:19:25 DEBUG <gnc.scm> going in to basis list ((#<<gnc-numeric> num: 4855480 denom: 10000> . #<<gnc-numeric> num: 1073565383194004945 denom: 33935498851359267>))#<<gnc-numeric> num: 39210 denom: 10000>#<<gnc-numeric> num: 11896 denom: 100> * 09:19:25 DEBUG <gnc.scm> actually in basis-builder * 09:19:25 DEBUG <gnc.scm> b-list is ((#<<gnc-numeric> num: 4855480 denom: 10000> . #<<gnc-numeric> num: 1073565383194004945 denom: 33935498851359267>)) b-units is #<<gnc-numeric> num: 39210 denom: 10000> b-value is #<<gnc-numeric> num: 11896 denom: 100> b-method is average-basis * 09:19:25 DEBUG <gnc.scm> value, pos units, average-basis * 09:19:25 DEBUG <gnc.scm> new-units #<<gnc-numeric> num: 4894690 denom: 10000> new-tmp-mul #<<gnc-numeric> num: 6363128963367708899 denom: 414251694962881> new-value-num #<<gnc-numeric> num: -2 denom: 0> new-value-denom #<<gnc-numeric> num: 4894690 denom: 10000> * 09:19:25 DEBUG <gnc.scm> coming out of basis list ((#<<gnc-numeric> num: 4894690 denom: 10000> . #<<gnc-numeric> num: -1 denom: 0>)) When it's calculating the new value part (cdr) of the b-list it gets an overflow when summing the parts of the numerator together. eg here: (gnc-numeric-add b-value (gnc-numeric-mul (caar b-list) (cdar b-list) GNC-DENOM-AUTO GNC-RND-ROUND) GNC-DENOM-AUTO GNC-RND-ROUND)) You can fix it if you cheat and convert the terms to doubles, and the result back to a gnc-numeric. Is this an underlying weakness in the gnc-numeric library? Clif
(In reply to comment #1) > Dear all, > > here is an experiment to complete the bug > > For intial amount computing, FIFO and FILO work well (the base amount is not > void). > > So the bug is in the "Mean" computation method for the base amount. Since upgrading to 2.4.7, I now have blanks in the basis and Gain columns but only when using FILO and FIFO methods. Average works for me (although it is not useful since I need FILO). I have a data file that could be used to demo the bug, but I can't post it because it contains proprietary information. If someone is working on this and needs a data set that exposes the problem, I could make the file available as long as it is kept private.
This bug could be related to Bug 587875 and Bug 603426. To the reporters: Can you confirm that this still an issue, or whether this bug can be closed (maybe because it is covered with the above mentioned bugs)?
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 587875 ***
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=612467. Please update any external references or bookmarks.