[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Update of bug #22272 (project freeciv): Status: Ready For Test = Fixed Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
URL: http://gna.org/bugs/?22272 Summary: Last (16th) user flag overlaps with role range (= assertion failure) Project: Freeciv Submitted by: jtn Submitted on: Sat 05 Jul 2014 11:53:20 BST Category: None Severity: 3 - Normal Priority: 5 - Normal Status: In Progress Assigned to: jtn Originator Email: Open/Closed: Open Release: Discussion Lock: Any Operating System: Any Planned Release: 2.5.0, 2.6.0 ___ Details: Reported by GriffonSpade on the forum http://forum.freeciv.org/f/viewtopic.php?f=8t=319: Since unit flags and roles were unified in a single contiguous enum, we've had: #define L_FIRST UTYF_LAST_USER_FLAG Results: * role_unit_precalcs overwrites the n_with_role[] entry for the last user flag with one for the (unused) 'first' role. This causes an assertion failure in precalc_one() [unittype.c::794]: assertion 'j == n_with_role[i]' failed (and a memory leak, and incorrect cached data). * The number of roles is effectively limited to 63, not L_MAX==64 (because the first bit in the bitfield is L_FIRST which is unused) -- not that we were in any danger of getting near that. ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Update of bug #22272 (project freeciv): Status: In Progress = Ready For Test ___ Additional Item Attachment: File name: trunk-S2_5-role-range.patchSize:1 KB ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Follow-up Comment #1, bug #22272 (project freeciv): I think this is a bit more complicated to implement in S2_5 due to network protocol freeze (and TRUNK version requires capstr bump). You are changing meaning of the role bits (what old server/client considers role n, new server/client considers role n-1). ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Update of bug #22272 (project freeciv): Status: Ready For Test = In Progress ___ Follow-up Comment #2: Oops, you're right. ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Follow-up Comment #3, bug #22272 (project freeciv): For S2_5, renumbering roles to leave a gap in the specenum should be sufficient, I think, without any messing around with capabilities. (Technically I think there's currently nothing stopping a ruleset from specifying a role name in a combat bonus, which would then go over the network as its specenum value in a UTYF. But this isn't useful, as when passed to utype_has_flag() it won't work -- it's checked against the flags bitmap, not the roles bitmap. So I think we should check for this at ruleset loading and add a suitable assert in utype_has_flag().) ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Follow-up Comment #4, bug #22272 (project freeciv): I think there's currently nothing stopping a ruleset from specifying a role name in a combat bonus, which would then go over the network as its specenum value in a UTYF Wrong. I misread the code. Roles have their own enum, it's just that it uses compatible numbers with the flag enum. ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #22272] Last (16th) user flag overlaps with role range (= assertion failure)
Update of bug #22272 (project freeciv): Status: In Progress = Ready For Test ___ Follow-up Comment #5: Try again. (file #21281, file #21282) ___ Additional Item Attachment: File name: trunk-role-range-bis.patch Size:2 KB File name: S2_5-role-range-bis.patch Size:6 KB ___ Reply to this item at: http://gna.org/bugs/?22272 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev