チケット #47662

./common/city.c integer overflow ... cannot be represented in type 'int'

登録: 2023-03-23 21:13 最終更新: 2023-04-25 21:37

報告者:
担当者:
(未割り当て)
チケットの種類:
状況:
オープン
コンポーネント:
マイルストーン:
(未割り当て)
優先度:
5 - 中
重要度:
5 - 中
解決法:
なし
ファイル:
なし

詳細

3.0.6 clang

This one is a bit weird : the value are always (-1 billion + epsilon) * 100 , and show identical values in different random games

Count of errors :

      7 ../../common/city.c:2880:37: runtime error: signed integer overflow: -999999992 * 100 cannot be represented in type 'int'      ### ~ 50 max_int
      5 ../../common/city.c:2880:37: runtime error: signed integer overflow: -999999991 * 100 cannot be represented in type 'int'
      4 ../../common/city.c:2880:37: runtime error: signed integer overflow: -999999994 * 100 cannot be represented in type 'int'
      3 ../../common/city.c:2880:37: runtime error: signed integer overflow: -999999987 * 100 cannot be represented in type 'int'

      6 ../../common/city.c:2873:25: runtime error: signed integer overflow: -999999990 * 100 cannot be represented in type 'int'
      6 ../../common/city.c:2873:25: runtime error: signed integer overflow: -999999989 * 100 cannot be represented in type 'int'
      3 ../../common/city.c:2873:25: runtime error: signed integer overflow: -999999994 * 100 cannot be represented in type 'int'
      3 ../../common/city.c:2873:25: runtime error: signed integer overflow: -999999993 * 100 cannot be represented in type 'int'
      3 ../../common/city.c:2873:25: runtime error: signed integer overflow: -999999987 * 100 cannot be represented in type 'int'

      6 > ../../common/city.c:2866:21: runtime error: signed integer overflow: -999999992 * 100 cannot be represented in type 'int'
      3 > ../../common/city.c:2866:21: runtime error: signed integer overflow: -999999994 * 100 cannot be represented in type 'int'
      3 > ../../common/city.c:2866:21: runtime error: signed integer overflow: -999999991 * 100 cannot be represented in type 'int'
      3 > ../../common/city.c:2866:21: runtime error: signed integer overflow: -999999987 * 100 cannot be represented in type 'int'

I'll try to investigate a bit and provide saved games.

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

2023-03-23 21:13 更新者: alain_bkr
  • 新しいチケット "./common/city.c integer overflow ... cannot be represented in type 'int'" が作成されました
2023-04-12 13:35 更新者: cazfi
コメント

Possibly related assert failure on a S3_1 (+ local patches) autogame:

in city_build_building() [../../src/server/cityturn.c::2412]: assertion 'pcity->surplus[O_SHIELD] >= 0' failed.

2023-04-13 02:56 更新者: cazfi
コメント

Reply To cazfi

Possibly related assert failure on a S3_1 (+ local patches) autogame: {{{ in city_build_building() [../../src/server/cityturn.c::2412]: assertion 'pcity->surplusO_SHIELD >= 0' failed. }}}

I don't know *exact* reason of this, but seems to be related to the mess of what upkeep gets paid pack when unit gets removed from the game. I think gold upkeep is the only form of upkeep that actually gets paid back. But even when unit dies for lack of gold, it does not pay back shields or food. Additional complication is that unit dying for lack of shields does so by "Help Wonder" or "Disband Unit Recover Production" meaning that often city's negative shield stock still gets turned positive by that death (but not as much as it should).

2023-04-18 17:40 更新者: cazfi
コメント

I'm now getting that assert failure quite regularly. Either it's recently introduced bug, or the other changes have made AI much more likely to proceed to a situation where it triggers it (in an autogame)

2023-04-24 04:36 更新者: cazfi
  • マイルストーン(未割り当て) から 3.0.8 (完了済み) に更新されました
  • 優先度5 - 中 から 6 に更新されました
コメント

Reply To cazfi

I'm now getting that assert failure quite regularly.

Frequently enough to consider this a regression blocking 3.0.8. ( #47779 )

2023-04-25 21:37 更新者: cazfi
  • マイルストーン3.0.8 (完了済み) から (未割り当て) に更新されました
  • コンポーネントServer から General に更新されました
  • 優先度6 から 5 - 中 に更新されました
コメント

The assert is unrelated to the original problem after all -> split to #47938

添付ファイルリスト

添付ファイルはありません

編集

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