Card-Forge / forge

An unofficial rules engine for the world's greatest card game.
https://card-forge.github.io/forge/
GNU General Public License v3.0
982 stars 564 forks source link

Stack overflow crash 2024-08-10 #5883

Closed dracontes closed 1 month ago

dracontes commented 2 months ago

Describe the bug/To Reproduce Essentially a two-player commander game reached a state where loading that saved game state promptly causes Forge to crash.

Relevant files Crash log: 2024-08-10-00_ragga.txt Forge log: forge.log Saved game state: state_raggacrash.txt Screenshot of game state: image

Additional context The deck I'm playing tested well enough some months ago with none of these issues. I don't think the game state is something particularly complex or cumbersome given my experience with Forge. However it's noteworthy that this now puts my computer through its paces, making its fans substantially noisier.

Expected behavior Plainly that the game wouldn't crash.

Desktop:

kevlahnota commented 2 months ago

it seems this is related to threading (though on my local build, with modified collections and others to allow threads, I get a different crash, NPE -> No band for attacker Raggadragga, Goreguts Boss (293) but discarding the crash allows me to continue the game)...

Game-1 > java.lang.NullPointerException: No band for attacker Raggadragga, Goreguts Boss (293)
    at forge.game.combat.Combat.getBandOfAttackerNotNull(Combat.java:419)
    at forge.game.combat.Combat.addBlocker(Combat.java:469)
    at forge.ai.AiBlockController.reinforceBlockersAgainstTrample(AiBlockController.java:843)
    at forge.ai.AiBlockController.assignBlockers(AiBlockController.java:1149)
    at forge.ai.AiBlockController.assignBlockersForCombat(AiBlockController.java:1065)
    at forge.ai.AiBlockController.assignBlockersForCombat(AiBlockController.java:1057)
    at forge.ai.AiController.declareBlockersFor(AiController.java:1319)
    at forge.ai.PlayerControllerAi.declareBlockers(PlayerControllerAi.java:803)
    at forge.game.phase.PhaseHandler.declareBlockersTurnBasedAction(PhaseHandler.java:682)
    at forge.game.phase.PhaseHandler.onPhaseBegin(PhaseHandler.java:318)
    at forge.game.phase.PhaseHandler.devAdvanceToPhase(PhaseHandler.java:1221)
    at forge.game.phase.PhaseHandler.devAdvanceToPhase(PhaseHandler.java:1208)
    at forge.ai.GameState.handleCombat(GameState.java:965)
    at forge.ai.GameState.applyGameOnThread(GameState.java:862)
    at forge.ai.GameState.lambda$applyToGame$0(GameState.java:805)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:829)

Game Clip

https://github.com/user-attachments/assets/95445486-37c2-48c5-9bee-6c489abf4b27

tool4ever commented 2 months ago

looks like a duplicate of #4560

github-actions[bot] commented 1 month ago

This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.