Ticket #43584

edit.remove_extra() causing assert failures

Open Date: 2022-01-08 14:08 Last Update: 2022-02-05 05:09

Reporter:
Owner:
Type:
Status:
Closed
Component:
MileStone:
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
1

Details

3.0.0-beta2
For context, see this forum topic - http://forum.freeciv.org/f/viewtopic.php?f=13&t=92129 Using the sandbox ruleset, add this to script.lua

function coast_only(tile, resource)
  isOK = false
  for t in tile:square_iterate(1) do
    class = t.terrain:class_name()
    if class == "Oceanic" then
      isOK = true
      break;
    end
  end -- for tile:square_iterate
  if not isOK then
    edit.remove_extra(tile, resource)
  end
end

function coasts_only_callback()
  for tile in whole_map_iterate() do
    local resource = "Ivory"
    if tile:has_extra(resource) then
      coast_only(tile, resource)
    end
  end -- for whole_map_iterate
  return false
end

signal.connect("map_generated", "coasts_only_callback")
When run, chat log shows this many times
in dbv_isset() [../../freeciv-3.0.0/utility/bitvector.c::122]: assertion 'pdbv->vec != ((void*)0)' failed.
Please report this message at https://osdn.net/projects/freeciv/ticket/
Without edit.remove_extra(tile, resource) the problem doesn't happen.

Ticket History (3/6 Histories)

2022-01-08 14:08 Updated by: ddeanbrown
  • New Ticket "edit.remove_extra() causing assert failures" created
2022-01-08 14:42 Updated by: cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.0 (closed)
Comment

Will push this fix even to S2_6.

2022-01-21 11:57 Updated by: cazfi
  • Status Update from Open to Closed
  • Owner Update from (None) to cazfi
  • Resolution Update from Accepted to Fixed
2022-02-05 04:43 Updated by: ddeanbrown
Comment

Tested with RC1, assert errors are gone, but remove_extra() is not working.

Also tried connecting to "turn_begin" signal and running on turn 1, instead of connecting to "map_generated" signal, and saw same problem, so maybe remove_extra() got broken.

2022-02-05 05:09 Updated by: cazfi
Comment

Reply To ddeanbrown

but remove_extra() is not working.

Opened a new ticket about it (this one has been closed, and even documented fixed in RC1) -> #43782

Edit

Please login to add comment to this ticket » Login