チケット #43379

Editing a city to have size 255 freezes the server

登録: 2021-12-11 11:39 最終更新: 2023-09-30 12:49

報告者:
(匿名)
担当者:
チケットの種類:
状況:
完了
コンポーネント:
マイルストーン:
優先度:
5 - 中
重要度:
5 - 中
解決法:
修正済み
ファイル:
2

詳細

To reproduce: - enter edit mode - select a city - set the size to 255 (the maximum allowed) - go do some sport while waiting for the server to complete the growth (killed it after 9 hours on my machine)

チケットの履歴 (13 件中 3 件表示)

2021-12-11 11:39 更新者: None
  • 新しいチケット "Editing a city to have size 255 freezes the server" が作成されました
2022-07-19 06:47 更新者: dark-ether
コメント

i tested this and could reproduce in freeciv 3.0, first it sends the message

1: Did not find a cm solution in 27500 iterations for Kraków.

until 206 times, then it does

1: in city_size_add() [city.c::1106]: assertion '0xFF - size > add' failed.

1: Please report this message at https://osdn.net/projects/freeciv/ticket/

and then repeats both messages the cm solution message comes from common/aicore/cm i haven't yet searched for the assertion failure. do note that the city needs to actually reach 255 size to reproduce the bug, so if it doesn't have a sewer system it is not possible to reproduce the bug

(編集済, 2022-07-19 06:51 更新者: dark-ether)
2022-07-19 07:54 更新者: dark-ether
コメント

Reply To dark-ether

i tested this and could reproduce in freeciv 3.0, first it sends the message 1: Did not find a cm solution in 27500 iterations for Kraków. until 206 times, then it does 1: in city_size_add() [city.c::1106]: assertion '0xFF - size > add' failed. 1: Please report this message at https://osdn.net/projects/freeciv/ticket/ and then repeats both messages the cm solution message comes from common/aicore/cm i haven't yet searched for the assertion failure. do note that the city needs to actually reach 255 size to reproduce the bug, so if it doesn't have a sewer system it is not possible to reproduce the bug

ok i was browsing the code and if we look at the city_size_change function it calls with a while loop city_increase_size, and besides when it can't grow becuase it grew to the size limit it always returns true this means that if something prevents size from increasing the loop will go on forever, the assertion that fails is a return assertion, so it causes the code to return, i assume this causes size to not increase, i may be wrong and some other thing prevents size from increasing. actually i am blind that is exactly what happens the function that changes size is the city_size_add which gets cancelled when the assert fails

(編集済, 2022-07-19 07:56 更新者: dark-ether)
2022-07-20 00:23 更新者: dark-ether
コメント

i have a half fix, i call it half because although it fixes the infinite loop it still takes too long to stop, however to fix it taking too long it would need a substantial change in how it works,

the problem is that it calculates exhaustively the options, which is really slow for large numbers, not only that but it calculates for each value along the way so from around 60 until 254 it makes a lot of useless and time intensive calculations, if it calculated only the last one maybe it would be acceptable.

my suggestion would be to remove things that should happen only once from city_increase_size to a new function city_has_grown which is called only once, however that seems to big for only one ticket.

2023-06-12 10:08 更新者: cazfi
コメント

Reply To dark-ether

it calculates for each value along the way

That's probably easier part to address currently.

There's also #44703 trying to achieve something similar.

2023-06-12 10:14 更新者: cazfi
  • マイルストーン(未割り当て) から 3.2.0 に更新されました
  • コンポーネント(未割り当て) から Server に更新されました
2023-06-26 20:18 更新者: cazfi
コメント

Reply To (Anonymous)

- set the size to 255 (the maximum allowed)

Should be allowed, but causes an assert failure -> #48296

2023-09-03 22:39 更新者: cazfi
  • 担当者(未割り当て) から cazfi に更新されました
  • 解決法なし から 受領 に更新されました
2023-09-03 23:12 更新者: cazfi
コメント

Patch applies, as is, also to S3_1. I want to test it on development branches first, but it's something to likely push to S3_1 after beta3 release.

2023-09-06 03:21 更新者: cazfi
コメント

Pushed to main and S3_2

2023-09-30 12:49 更新者: cazfi
  • 状況オープン から 完了 に更新されました
  • 解決法受領 から 修正済み に更新されました

編集

ログインしていません。ログインしていない状態では、コメントに記載者の記録が残りません。 » ログインする