HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. Read more...
S3_0/master may try to sell same cargo unit multiple times
While investigating Bug #853107 I noticed difference in S2_6 and later branches that seem to me like a regression in later branches, but maybe I just don't understand the changed code. I've not gone through git history yet, but the change has probably been part of Sveinung's unit removal action enablers work.
sell_random_unit() and callers maintain list of units ('punitlist') that are candidates for selling. Multiple units might get sold, if that's required to reach healthy balance.
We try not to sell transport (and lose cargo in the side) when selling just some cargo would be sufficient. That's done by recursive call to sell_random_unit() with just the cargo units as the punitlist.
After that recursive call S2_6 removes sold unit from the original punitlist, but later branches do not. In S3_0/master it remains as a candidate for selling, if more units need to be sold. Picking it again would presumably result in a crash as already freed unit structure is accessed.
#3 Updated by Marko Lindqvist 6 months ago
- File 0048-Never-double-sell-a-unit-for-balancing-budget.patch 0048-Never-double-sell-a-unit-for-balancing-budget.patch added
- Status changed from New to Resolved
- Assignee changed from Sveinung Kvilhaugsvik to Marko Lindqvist