Help 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...":

Bug #853295


S3_0/master may try to sell same cargo unit multiple times

Added by Marko Lindqvist over 3 years ago. Updated over 1 year ago.

Start date:
Due date:
% Done:


Estimated time:


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.


Actions #1

Updated by Marko Lindqvist about 2 years ago

  • Assignee set to Sveinung Kvilhaugsvik
Actions #2

Updated by Marko Lindqvist almost 2 years ago

Any comments, Sveinung?

Actions #3

Updated by Marko Lindqvist over 1 year ago

Actions #4

Updated by Marko Lindqvist over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF