Bug 436546 - Crash when updating any currency or stock price from dialog
Summary: Crash when updating any currency or stock price from dialog
Status: RESOLVED WORKSFORME
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.1
Platform: Microsoft Windows Microsoft Windows
: NOR crash
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-03 19:14 UTC by darkms5+kde
Modified: 2021-05-04 15:14 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
weird-currency (2.49 KB, image/png)
2021-05-03 19:14 UTC, darkms5+kde
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkms5+kde 2021-05-03 19:14:44 UTC
Created attachment 138121 [details]
weird-currency

SUMMARY
Hi all, first of all, thank you for making this awesome feature-rich product!
I've recently ran into a consistent major problem of crashes when trying to update anything using Tools -> Update Stock and Currency Prices dialog, the API calls seem to be working fine, crash happens when I click 'OK' or 'Cancel' to close the dialog.
I can update individual investment securities using 'Online price update' context menu and there's no crash or errors in such case.

One thing I've noticed that looked extremely suspicious was that in that Update Stock and Currency Prices dialog I have an item 'EUR >' without the other side of the currency-pair (attached). No idea how did it get there, but I've been doing some OFX imports of investment transactions recently, not sure if those could've caused it. I've tried deleting all of the recently imported ledgers and accounts, but the crash issue remained present and that 'EUR >' option didn't go away.

Is there any way to recover from this?

STEPS TO REPRODUCE
1. Open Tools -> Update Stock and Currency Prices dialog
2. Update 1 or more items
3. Click OK

OBSERVED RESULT
Crash

EXPECTED RESULT
Currency and stock prices updated

SOFTWARE/OS VERSIONS
Windows: Windows 10 Pro 20H2

ADDITIONAL INFORMATION
I've faced this issue on 5.1.1 (stable branch), also tried on 5.1.80 (latest master) and it still happens there. :(
Unfortunately there is no error message or anything specific I could share, the app just freezes for a moment and then terminates. There's an app crash event in Windows Event Logs, but it doesn't look very useful (can't find a way to attach more than 1 file, here's gdrive link https://drive.google.com/file/d/1pYQopSf_xtioKenyeaJE_7enDZIW-tBP/view?usp=sharing).

Consistency check doesn't report any errors.
Comment 1 darkms5+kde 2021-05-04 14:45:06 UTC
Turned out it was possible to export to plaintext XML and I found these lines there:
  <PRICEPAIR from="EUR" to="">
   <PRICE date="2021-02-26" source="Transaction" price="1/1"/>
   <PRICE date="2021-04-12" source="Transaction" price="1/1"/>
  </PRICEPAIR>

Still no clue how did I end up getting those, but removing them had solved the issue for me. Closing this ticket, sorry for inconvenience.
Comment 2 Jack 2021-05-04 15:14:52 UTC
I won't reopen this now, but there have been other similar problems with odd price pairs.  I don't know if anyone can figure out how they get created, but I don't think their presence should cause a crash.  In addition, there should probably be a way to delete them through the UI.