Crash on opening imported transaction in ledger
Jack Ostroff
ostroffjh at aya.yale.edu
Mon Jun 2 00:47:52 BST 2025
I have an investment transaction imported by OFX, and KMM crashes with
a Floating point exception when I try to open the account in the ledger.
[below lines manually wrapped and memos and some other fields shortened
for readability.]
From the kmm-statement file for the ofx import:
<TRANSACTION payee="" amount="2/1" brokerageaccount="" number=""
action="sell" bankid="ID 20250519CA210057180306067"
price="0/1" security="ALTABA INC" memo="Exchange: ALTABA INC CASH
MERGER" reconcile="0" securityId="021ESC017"
dateposted="2025-05-19" shares="0/1" fees="0/1"/>
This imported as
<TRANSACTION id="T000000000000034673" postdate="2025-05-19"
memo="Exchange: ALTABA INC CASH MERGER" entrydate="2025-05-31"
commodity="USD">
<SPLITS>
<SPLIT id="S0001" payee="" reconciledate="" action=""
reconcileflag="0" value="2/1" shares="2/1" price="0/1"
memo="Exchange: ALTABA INC CASH MERGER" account="A000345"
number="" bankid=""/>
<SPLIT id="S0002" payee="" reconciledate="" action="Buy"
reconcileflag="0" value="2/1" shares="0/1" price="0/1"
memo="Exchange: ALTABA INC CASH MERGER" account="A000722"
number="" bankid="ID 20250519CA210057180306067"/>
</SPLITS>
<KEYVALUEPAIRS>
<PAIR key="Imported" value="true"/>
</KEYVALUEPAIRS>
</TRANSACTION>
"Show transaction details" shows the price in both splits as 1, not 0
Clearly this is a strange transaction, since the UI won't let me create
a buy/sell for 0 shares. I have no idea why Merrill Lynch calls this a
sell, as it appears to just be some sort of dividend or other payout of
$2.00.
My assumption is there is a divide by zero, but I can't be sure until I
trace through the code. If nothing else, shouldn't this type of error
get trapped and reported instead of crashing?
Jack
More information about the KMyMoney-devel
mailing list