[Freeciv-tickets] [freeciv] #46136: Failing "15 > pos->ref_count" assert

Back to archive index
OSDN Ticket System norep****@osdn*****
Thu Dec 1 14:09:52 JST 2022


#46136: Failing "15 > pos->ref_count" assert

  Open Date: 2022-11-28 15:22
Last Update: 2022-12-01 07:09

URL for this Ticket:
    https://osdn.net//projects/freeciv/ticket/46136
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46136

---------------------------------------------------------------------

Last Changes/Comment on this Ticket:
2022-12-01 07:09 Updated by: cazfi

Comment:

Reply To cazfi
I *think* that there must be something wrong in the way pf_fuel_pos_replace() does not unref pos->prev when the ref_count of current pos > 1. Current pos gets replaced regardless of that ref_count, so the replaced pos is no longer there to ref prev (so why it's still included in the ref_count?)

Unfortunately lack of that unref might be integral part of the whole idea of pf_fuel_pos_replace(), and the bug not solvable by just adding unreffing. Need to investigate more.
Finally got it. The current position is *not* completely lost in that case. A new one is just created in addition to it, to replace what node points to.
I think the summary is that 1) too narrow 'pos->cost' is the actual bug after all. 2) pf_fuel_pos_replace() comments (esp. function header) should be updated


---------------------------------------------------------------------
Ticket Status:

      Reporter: cazfi
         Owner: (None)
          Type: Bugs
        Status: Open
      Priority: 5 - Medium
     MileStone: (None)
     Component: General
      Severity: 5 - Medium
    Resolution: None
---------------------------------------------------------------------

Ticket details:

I've got a pf_fuel_pos_ref() assert against too big ref count failing. This is with an AI caravan traveling with a UTYF_COAST boat, i.e., combination of amphibious (land unit + sea unit) path finding and fuel path finding.
I'm not convinced that the assert is right. It seems to consider only the fact that one can enter the tile from 8 different directions (neighboring tiles) max. But won't also the refuel points count here? One can came from the same direction but with different refuel history. Of course the assert is right in that the 4 bit field can't hold bigger values than 15 -> maybe we need to make that wider.
OTOH amphibious PF makes some move cost multiplication magic that fuel path finding may not be completely compatible with.

-- 
Ticket information of Freeciv project
Freeciv Project is hosted on OSDN

Project URL: https://osdn.net/projects/freeciv/
OSDN: https://osdn.net

URL for this Ticket:
    https://osdn.net/projects/freeciv/ticket/46136
RSS feed for this Ticket:
    https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=46136



More information about the Freeciv-tickets mailing list
Back to archive index