Project

Profile

Help

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...

Bug #853295

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

Added by Marko Lindqvist over 2 years ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
Server
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

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.

History

#1 Updated by Marko Lindqvist about 1 year ago

  • Assignee set to Sveinung Kvilhaugsvik

#2 Updated by Marko Lindqvist 12 months ago

Any comments, Sveinung?

#3 Updated by Marko Lindqvist 6 months ago

#4 Updated by Marko Lindqvist 5 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF