Account Select shows negative balances when it displays all accounts.

Started by Skybuck, July 19, 2018, 07:28:35 PM

Previous topic - Next topic

Skybuck

(Original posting on 20 december 2017):

UFRMAccountSelect form shows negative balance when all accounts are displayed.

At the bottom it will currently display:

Accounts: 809770
Balance: -637,024,863,411,494,9000

I have not yet investigated why it shows this. (This is also in my customize client, will have to check in official release to see if problem is there too).

My initial suspicious is:

    Either this variable is incorrectly initialized.
    or
    It's incorrectedly calculated.
    or
    Somehow it overflows and wraps back to negative ?!? Seems a bit weird...

I tried to reproduce this issue but could not do it, so not yet sure when this happens.

Skybuck

This bug is caused by a compiler bug in Delphi XE relating to the usage of inc(a,b) and dec(a,b) in 32 bit mode when a is a int64 and b is an uint64.

(
This has been investigated at length in another issue/posting:

https://github.com/PascalCoin/PascalCoin/issues/127

http://www.skybuck.org/PascalCoin/Forum/index.php?topic=35.0
)