GNOME Bugzilla – Bug 492137
Lot scrubber doesn't add splits to existing lots correctly
Last modified: 2018-06-29 21:53:35 UTC
My change in R16370 which made Timespec signed instead of unsigned broke the lot scrubber. It does not correctly add splits to existing lots. You can see this by opening a stock account which has a buy transaction in a lot and a corresponding sell transaction that is not in a lot. If you then open the lot viewer and tell to scrub the account, it will create a new lot with a negative balance rather than adding the split for the sell transaction to the existing lot. I fixed this and will attach a patch.
Created attachment 98264 [details] [review] Patch to fix the lot scrubber for signed Timespec
Comment on attachment 98264 [details] [review] Patch to fix the lot scrubber for signed Timespec Sounds just fine. Should be committed. Thanks a lot.
Applied as r16619. Awaiting backport to branches/2.2.
branches/2.2@r16639. Thanks a lot!
Unfortunately this patch breaks "make check" for me. When I run with this changeset in place the test crashes with the error: * 23:06:40 OTHER <gnc.lots> [xaccSplitAssignToLot()] Failed to split into two! Program received signal SIGABRT, Aborted.
+ Trace 182872
Thread 1074914560 (LWP 31572)
When I back out this patch the tests pass. So, I've reopened this bug, and I've backed out this patch in trunk. I also recommend backing it out of the 2.2 branch until the tests work again. Note that it's possible that the tests are broken, so please make sure that test-lots doesn't crash when you fix this bug. If that means fixing the test, too, that's fine. Thanks.
Okay, this is very weird. "make check" works in 2.2, but fails in trunk. If I back out r16619 from trunk then "make check" works again... But 16619 was backported to 2.2 and "make check" still works there. So I'm very confused about what's going on. Mike, is there any chance you could look into why make check is failing on trunk with this patch installed? Thanks!
Strangely, it looks to be a combination of r16619 and r16690.
Okay, it's just a bug in the tests; the tests were overflowing, and the additional currency just changed the commodity-scu sufficiently to cause the overflow. I've re-applied this patch along with a patch to the test harness. The checks now work again. Mike, sorry to have blamed you; the checks DID pass with your changes and didn't break until r16690 was applied. My apologies to you. Anyways, this has been reapplied to trunk as r16716. I've re-closed this bug. Happy Holidays.
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=492137. Please update any external references or bookmarks.