#43724: Segfault with cyclic requirements in self-provided goods Open Date: 2022-01-28 16:33 Last Update: 2022-01-29 10:16 URL for this Ticket: https://osdn.net//projects/freeciv/ticket/43724 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43724 --------------------------------------------------------------------- Last Changes/Comment on this Ticket: 2022-01-29 10:16 Updated by: cazfi Comment: Yup, I'm quite annoyed with myself. Multiple time I've been looking in to need of Self-Provided goods, to then realize that it would cause recursion problems and reject the idea. Forget that in a couple of months and start from the beginning... One possible solution still is that we simple revert Self-Provided goods. We need at least to make a decision about that before S3_2 d3f. This is not the first recursive requirement (though I don't remember the other one(s) from the top of my head). The sanity check should be generic enough to catch any complex infinite recursion over different requirement types (Good 1 requirement -> Type B requirement -> Good 2 requirement -> Type C requirement -> Good 1 requirement) --------------------------------------------------------------------- Ticket Status: Reporter: alienvalkyrie Owner: (None) Type: Bugs Status: Open Priority: 5 - Medium MileStone: S3_2 d3f Component: General Severity: 5 - Medium Resolution: None --------------------------------------------------------------------- Ticket details: With the self-provided goods introduced in #43532, infinite recursion is possible via is_req_active -> is_goods_type_in_range -> goods_can_be_provided -> are_reqs_active -> is_req_active if ruleset authors include cyclic dependencies between self-provided goods. This should probably be caught with sanity checks when loading the ruleset rather than crashing. -- 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/43724 RSS feed for this Ticket: https://osdn.net/ticket/ticket_rss.php?group_id=12505&tid=43724