crash in new ledger

thb at net-bembel.de thb at net-bembel.de
Sat Jul 9 18:29:49 BST 2022


Jack via KMyMoney-devel schrieb am 09.07.2022 17:57 (GMT +02:00):

> On 7/9/22 02:28, thb--- via KMyMoney-devel wrote:
> 
>> 
>> Jack via KMyMoney-devel schrieb am 08.07.2022 18:33 (GMT +02:00):
>> 
>> On 2022.07.08 03:11, thb--- via KMyMoney-devel wrote:
>> 
>>>> 
>>>> Jack via KMyMoney-devel schrieb am 07.07.2022 19:16 (GMT +02:00):
>>>> 
>>>> 
>>>>> 
>>>>> I got several of these over the past days, but didn't report yet,
>>>>> as  
>>>>> I wasn't sure I was on absolute latest.  I just recompiled from git
>>>>>  
>>>>> master head, and get this (consistently) when saving an investment 
>>>>> 
>>>>> transaction, where I had changed the security.  Let me know if
>>>>> there  
>>>>> is any other information which might be helpful.
>>>>> 
>>>> 
>>>> Thanks for reporting. Despite all the details I have a problem to
>>>> see  
>>>> where this happens. Mainly, because the backtrace does not (always)
>>>>  
>>>> match my version of current master :(  It would be great, if you  
>>>> could simply specify the commit hash you are on in the future.
>>>> 
>>>> I am on 462fb8d2df6 and investtransactioneditor.cpp:1212 shows this
>>>>  
>>>> for me
>>>> 
>>> 
>>> I am also on this - kmymoney -v shows "kmymoney 5.1.80-462fb8d2d"
>>> and  
>>> here is a new BT
>>> 
>>> 
>> 
>> [... bt removed ...]
>> 
>> 
>>>> 
>>>> The problem though, as Jeremy already pointed out, is a div by zero
>>>>  
>>>> but on (my) line 1212 there is no division at all. The only one in 
>>>> 
>>>> the vicinity is three lines further down and shows
>>>> 
>>>>   d->stockSplit.setPrice(d->stockSplit.value() /  
>>>> d->stockSplit.shares());
>>>> 
>>>> which only gets used for a stock split transaction and price mode
>>>> set  
>>>> to PricePerTransaction.
>>>> 
>> 
>> 
>>> 
>>> Well, the BT does now point to this line, and I do have  
>>> PricePerTransaction set, but this is a dividend transaction, not a 
>>> 
>>> split.  However, is this for a stock split, or if the transaction
>>> is  
>>> NOT a stock split?  Is there a  wrong test in that "if"?
>>> 
>> 
>> I should have written for "non stock split transactions". My fault
>> and
>> the test in that "if" is perfectly OK.
>> 
>> The problem is/was, that a dividend transaction should have zero in
>> the
>> shares attribute of the transaction. In that case, the division
>> cannot work.
>
> I'll have to reconfirm I have the right version, but it looks like it, and I still crash.  The inner loop is if shares is zero, then divide by shares (depending on PriceMode).  Am I still misreading it?  (version shows kmymoney 5.1.80-352f01a87.

Arrrgh. Forgot a question mark to make it "not zero". Fixed in git.


-- 

Regards

Thomas

https://www.signal.org/       Signal, the better WhatsApp
-------------------------------------------------------------
I wouldn't trust software written by anyone
who hasn't written a first level interrupt handler -- unknown
-------------------------------------------------------------


More information about the KMyMoney-devel mailing list