MD 5117 Security Detail view crashes app

Bob B's Avatar

Bob B

17 Apr, 2024 08:36 PM

Windows 11.

When I view the security detail window for one of my securities, MD freezes and I need to use task Manager to kill the process. The Security in question is Apple - others seem to work but I haven't tested all. I reinstalled v5064 and everything works as expected.

  1. 1 Posted by Stuart Beesley ... on 17 Apr, 2024 09:13 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Please grab errlog.txt file on disk, after you kill the app, and upload that here (before you restart MD)

  2. 2 Posted by Bob B on 18 Apr, 2024 03:49 PM

    Bob B's Avatar

    Sorry forgot to do that. There doesn't seem to be anything in the log - it just ends. Can I turn on any settings to show more?

  3. 3 Posted by Bob B on 18 Apr, 2024 04:06 PM

    Bob B's Avatar

    I've tried to find other securities that cause the crash but so far nothing. Additional info: I own Apple in tow different accounts - only one crashes the app when I view security details (as soon as I select Apple from the drop down)

    In the one that doesn't crash, the security is no longer active (I don't currently own any shares).

    In the one that does crash, I've continuously owned shares since 2013. There were splits in 2014 and 2020. The current shares is correct but the cost basis is not (this is a previously reported bug for securities with splits).

  4. 4 Posted by Stuart Beesley ... on 18 Apr, 2024 04:33 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Ok. I bet the lot matching window is popping up off screen. Please run toolbox. Does it say you have invalid window locations?

  5. 5 Posted by Bob B on 18 Apr, 2024 05:20 PM

    Bob B's Avatar

    I don't use lot matching. No messages in Toolbox.
    Also remember that everything works fine in 5064 which I assume uses same window locations.

  6. 6 Posted by Stuart Beesley ... on 18 Apr, 2024 05:28 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Ok. For the hell of it. Can you quit MD. Rename config.dict, and restart MD. Any difference?

    Depending on results, quit MD again. Delete the new config.dict, and rename the original back

    Help/Console, bottom (…) show config file/folder can help you find it.

  7. 7 Posted by Bob B on 18 Apr, 2024 09:38 PM

    Bob B's Avatar

    Other than the fact my license info and setting were gone, no difference in the behaviour when Apple selected.

  8. 8 Posted by Stuart Beesley ... on 18 Apr, 2024 09:48 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Ok. are you sure the errlog.txt file you uploaded was captured AFTER you saw the problem, and after you killed the app, and BEFORE you restarted MD?

  9. 9 Posted by Bob B on 18 Apr, 2024 10:24 PM

    Bob B's Avatar

    Yes I'm sure.
    The attached print show the screen when it freezes.

    The top left panel has updated (txn list)
    The top right panel (details) and graph have not updated from the the previously displayed security.

    I'm betting that the problem occurs when MD attempts to get the cost basis. This was the source of a prior bug where the cost basis for securities with splits was not correct. I will try to invoke that function - InvestUtil.getCostBasis(secAcct) from a test app later today when I have a chance and see if it is the source of the problem.

  10. 10 Posted by Bob B on 18 Apr, 2024 11:00 PM

    Bob B's Avatar

    My hunch was correct - if I attempt to use InvestUtils.getCostBasis for the Apple account, the program just freezes and no errors are given while debugging. I'm not good enough at this to figure out what is happening in the call and locating the exact point of failure.

    If you can tell me how to debug that call, I can try to locate the problem. I'm using IntelliJ

  11. 11 Posted by Stuart Beesley ... on 19 Apr, 2024 06:04 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I’m curious, do the cost basis and capital gains reports work ok on this security?

    Also, I see you are on the Securities Detail tab. Are you able to use the Portfolio tab?

    It’ll be quite hard for you to debug. The CostCalculation engine was rewritten for md2024 and is actually written in Kotlin. Hence you do not have access to the Kotlin source code. At best, the IJ IDE can decompile back to inferred Java source code.

    I’ll have a think about options. But a couple of questions:

    • how many Apple txns are in this account? 10 or 1000s?
    • you might need to share data with support.

    If you are willing to try some other stuff, email me:

  12. 12 Posted by Stuart Beesley ... on 19 Apr, 2024 06:39 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    I suggest you flip this thread private.

    Also, you can try this. Restart MD, then in the MD developer console (previously MoneyBot) run this snippet:

    from com.infinitekind.moneydance.model import CostCalculation
    CostCalculation.DEBUG_COST=True
    

    Then repeat your test. Then grab help/console and review the debug message.

    Can you also try InvestUtil. isCostBasisValid(secAcct)

    Additionally you can try this:

    from com.infinitekind.moneydance.model import CostCalculation
    CostCalculation.DEBUG_COST=True
    costCalculation=CostCalculation(sec, None)
    print costCalculation.getBasisPrice(None)
    

    As I said, flip this thread private before sharing results. Also email me if you like.

  13. 13 Posted by Stuart Beesley ... on 19 Apr, 2024 08:08 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    PPS.

    • can you run the toolbox diagnostics against the security?

    • does Custom Balances extension hang if you set up a row using Cost Basis (perhaps with its debug option turned on)?

  14. 14 Posted by Keith Goodnight on 19 Apr, 2024 03:13 PM

    Keith Goodnight's Avatar

    I'm having this exact same crash happen, also with viewing the Securities Detail tab for Apple stock— but I'm using MoneyDance on a Mac while the original poster I see is on Windows. (MacOS Sonoma 14.4.1, Moneydance 24.1/ 5118)

  15. 15 Posted by Bob B on 19 Apr, 2024 03:46 PM

    Bob B's Avatar

    I tried to create a sample db showing the error. I started with a new DB. I added Apple security with splits as shown on the screen print.

    I added a buy tx for 60 shares on 05.07.2013
    Then I tried to add a sell tx on 22.01.2018 for 20 shares. When I went to save the tx, MD froze. After I restarted, the tx was listed. See screenprints attached.

  16. 16 Posted by Stuart Beesley ... on 19 Apr, 2024 09:35 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Confirmed.. It's a bug causing an endless loop...... Investigating...

  17. 17 Posted by Bob B on 20 Apr, 2024 02:45 AM

    Bob B's Avatar

    Glad you found it. Another scenario to test is a split like 3 for 2 which results in partial shares
    eg. own 15 then split yields 22.5 shares. Since partial shares are not allowed, the fractional shares are sold (cash in lieu). This tx usually comes in from my broker a few days later. I enter it as a sell tx of the fractional shares and end up with an integer number of shares.

  18. 18 Posted by dwg on 20 Apr, 2024 03:11 AM

    dwg's Avatar

    Stuart is probably asleep by now, so I'll paraphrase what he has said.

    The old cost calculation engine was faulty, actually it was pretty bad. It has been rewritten for Moneydance 2024. The engine is now correct, a lot of testing as done but the problem is with these stock splits is you get some small fractional numbers after the rounding is performed that is causing a loop, so a solution needs to be identified and implemented to deal with this.

  19. 19 Posted by Bob B on 20 Apr, 2024 08:25 PM

    Bob B's Avatar

    Thanks, I've given him some additional data for testing purposes where there are partial shares after a split. More fractional numbers to deal with when calculating cost basis.

  20. 20 Posted by sth on 21 Apr, 2024 12:24 AM

    sth's Avatar

    Probably need to round shares and costs to a fixed number of digits before comparing.

  21. 21 Posted by Chuck on 22 Apr, 2024 10:34 PM

    Chuck's Avatar

    I'm having this problem too, also with Apple shares. Security Detail freezes. In addition, no cost basis appears for any security in that account's Portfolio View, and MD freezes when I try to run Capital Gains and Portfolio reports.

    Should I interpret this thread as concluding that we need to wait for a fix?

  22. 22 Posted by sth on 23 Apr, 2024 03:20 AM

    sth's Avatar

    @Chuck, Yes. I think as a recognized (and common, serious) bug it has a fairly high priority and I would expect the fix to be in build 5119. I just haven't looked at my security details for equities with splits for awhile.

  23. 23 Posted by dwg on 23 Apr, 2024 04:09 AM

    dwg's Avatar

    Yes it will require a fix in a new version of Moneydance. I think it is proving to be a bit of a head scratcher.

  24. 24 Posted by Stuart Beesley ... on 23 Apr, 2024 12:03 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Fixes for the hang (endless loop) and this split scenario has now been proposed to IK

  25. 25 Posted by Bob B on 23 Apr, 2024 03:41 PM

    Bob B's Avatar

    Thanks very much - that was quick work.

  26. 26 Posted by Stuart Beesley ... on 24 Apr, 2024 10:15 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    FYI - there is now an Alpha available. WARNING. This is an Alpha - so pre-preview… BACKUP first and only use on test data.. If you don't want to test, then wait for the stable code version.....

    ...

    Let me know if a) the ‘hang’ has gone, and b) the results..

  27. 27 Posted by Stuart Beesley ... on 25 Apr, 2024 11:48 AM

    Stuart Beesley (Mr Toolbox)'s Avatar

    No one?

  28. 28 Posted by Keith Goodnight on 25 Apr, 2024 04:21 PM

    Keith Goodnight's Avatar

    I downloaded and tested the alpha on a copy of my data. It appears the fix has worked, I can now view the securities detail for Apple without a problem. Being cautious about alphas, I didn't explore the whole app for stability, just checked for the bug (I'll wait for the official release to do more). But the bug's fixed.

  29. 29 Posted by Stuart Beesley ... on 25 Apr, 2024 04:28 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Did you notice the unrealised gains on the portfolio tab and also the security tab(s)?

  30. 30 Posted by Keith Goodnight on 25 Apr, 2024 04:44 PM

    Keith Goodnight's Avatar

    I didn't— I was tunnel-visioned on seeing whether the Securities Detail tab would open for Apple without crashing. But I just went back for a second look, and I do see the unrealized gains listed. They look correct.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac