Ticket #47825

mapgen : check if there is at least one lake before regenerate_lakes

Open Date: 2023-04-10 03:17 Last Update: 2023-04-12 02:40

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

Details

S3_1

with landmass85 , on a tiny map i had this error

3: Creating a map of size 30 x 40 = 1200 tiles (1000 requested).
../../../server/generator/mapgen_utils.c:349:37: runtime error: variable length array bound evaluates to non-positive value 0
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ../../../server/generator/mapgen_utils.c:349:37 in 
Game saved as Sz1-Ai010-Lm85-230409_184441-T00001-auto.sav.xz

There i no lake on the map, and the error is about regenerate_lakes :-)

This did not prevented the map generation but it is better to fix it, see attached (trivial) patch for S3_1 , and also main i did not checked other branches, but i guess it will apply flawlessly.

Ticket History (3/8 Histories)

2023-04-10 03:17 Updated by: alain_bkr
  • New Ticket "mapgen : check if there is at least one lake before regenerate_lakes" created
2023-04-10 03:36 Updated by: cazfi
Comment

If S2_6 is affected, there's no "world_object" in it. Would be nice to have this in 2.6.9 (in case you're not following freeciv-dev: we are about to release that in two weeks)

2023-04-10 07:38 Updated by: alain_bkr
Comment

here is the patch for 2.6

(btw i subscribed to dev mailing list and read archive)

2023-04-10 11:16 Updated by: cazfi
  • Owner Update from (None) to cazfi
  • Resolution Update from None to Accepted
  • Milestone Update from (None) to 3.0.8 (closed)
2023-04-12 02:40 Updated by: cazfi
Comment

I think this was your first contribution with the commit having you as the author (as git knows it).

Once OpenHUB process freeciv data next time (frequency of that has fluctuated a lot during the years - sometimes it happens almost daily, but couple of months is normal too), it should show you as a new contributor, and if you wish, you can claim those contributions to your personal account.

https://www.openhub.net/p/freeciv/contributors/summary

2023-04-12 02:40 Updated by: cazfi
  • Status Update from Open to Closed
  • Resolution Update from Accepted to Fixed

Attachment File List

Edit

Please login to add comment to this ticket » Login