triplea-game / triplea

TripleA is a turn based strategy game and board game engine, similar to Axis & Allies or Risk.
https://triplea-game.org/
GNU General Public License v3.0
1.33k stars 392 forks source link

TripleA Twelve Clans keeps crashing #8959

Open cjmagee182 opened 3 years ago

cjmagee182 commented 3 years ago

My game continually crashes after a few turns, usually around turn 4 but sometimes at turn 6. Here is the error I get every time:

Comparison method violates its general contract! java.lang.IllegalArgumentException: Comparison method violates its general contract!

Why does this always happen, any way to fix?

beelee1 commented 3 years ago

@cjmagee182 I responded at the triplea site. If you can provide the save game, engine version and what OS you are using that will help to solve this.

When adding the saved game here, you'll need to put/compress it in a zip file.

beelee1 commented 3 years ago

Using the save game from https://forums.triplea-game.org/topic/2691/game-keeps-crashing/4 The debug shows this

Mar 02, 2021 9:09:02 PM org.triplea.game.client.HeadedGameRunner lambda$initializeClientSettingAndLogging$0 SEVERE: Comparison method violates its general contract! java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.base/java.util.TimSort.mergeHi(TimSort.java:903) at java.base/java.util.TimSort.mergeAt(TimSort.java:520) at java.base/java.util.TimSort.mergeCollapse(TimSort.java:448) at java.base/java.util.TimSort.sort(TimSort.java:245) at java.base/java.util.Arrays.sort(Arrays.java:1515) at java.base/java.util.ArrayList.sort(ArrayList.java:1750) at games.strategy.triplea.ai.pro.util.ProSortMoveOptionsUtils.sortUnitNeededOptionsThenAttack(ProSortMoveOptionsUtils.java:117) at games.strategy.triplea.ai.pro.ProCombatMoveAi.tryToAttackTerritories(ProCombatMoveAi.java:1341) at games.strategy.triplea.ai.pro.ProCombatMoveAi.determineTerritoriesToAttack(ProCombatMoveAi.java:335) at games.strategy.triplea.ai.pro.ProCombatMoveAi.doCombatMove(ProCombatMoveAi.java:95) at games.strategy.triplea.ai.pro.AbstractProAi.move(AbstractProAi.java:139) at games.strategy.triplea.ai.AbstractAi.start(AbstractAi.java:514) at games.strategy.engine.framework.ServerGame.waitForPlayerToFinishStep(ServerGame.java:537) at games.strategy.engine.framework.ServerGame.runStep(ServerGame.java:407) at games.strategy.engine.framework.ServerGame.startGame(ServerGame.java:297) at games.strategy.engine.framework.startup.launcher.LocalLauncher.launchInternal(LocalLauncher.java:82) at games.strategy.engine.framework.startup.launcher.LocalLauncher.lambda$launch$0(LocalLauncher.java:56) at java.base/java.lang.Thread.run(Thread.java:834)

autosavebeforeendturn.zip

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. If there is something that can be done to resolve this issue, please add a comment indicating what that would be and this issue will be re-opened. If there are multiple items that can be completed independently, we encourage you to use the "reference in new issue" option next to any outstanding comment so that we may divide and conquer.