Menu

#3146 Suffered a big savegame corruption error

Unspecified
closed-duplicate
None
2
2022-09-15
2018-05-18
Blake
No

Suffered a big savegame corruption error that trashed multiple save files that turn. The save files became 1k and couldn’t be opened. Had to reload an earlier turn and was fortunately able to replay the next (bad) turn without the problem repeating itself. Took a copy of the log and damaged savefiles & put it in a 7zip you guys can access below.
Note: Mike has said in the General Discussion that he will probably take a look at this one due to it's seriousness.

1 Attachments

Discussion

  • Blake

    Blake - 2018-05-29

    Oooh its happening again! Trying to fight the war of independance.. things get real slow during the AI moves.. come to my turn and I didn't get the proper turn report, things are super slow and when I try to save I get the failure warning and it creates a little 1k save file.

    Once again I've stuck in the before and after save along with the log.

    When I closed FreeCol down completely and restarted it and loaded the before save the problem did not repeat itself (thankfully for me, but not so thankfully for you guys lol).

     

    Last edit: Blake 2018-07-08
  • Mike Pope

    Mike Pope - 2018-05-30

    Ugh. Well there is no great mystery there as to what is happening. The log file contains multiple "Out of Memory Error" warnings. Looks like FreeCol needs to lose some weight again.

    I am short of advice for a workaround other than save early, save often, and restart often. I do not understand the windows installer so I do not know how to convince it to launch Java with a larger memory limit.

     

    Last edit: Mike Pope 2018-05-30
    • Some random gamer

      A fix, for those with it already installed:
      Right-click on the shortcut to see where the game is installed and copy that path to Windows Explorer address bar.
      Edit freecol.cmd to change the limit.

      In my case, I commented out the original line and added this one: "java -Xmx1024M -jar FreeCol.jar % --no-intro --no-sound" because I wanted no intro or sound, and to set maximum memory to 1GB. It's weird though, because I never use over ~quarter-GB so you shouldn't be seeing issues with the default on Windows(512MB I believe?).

      Is it possible your system has very little free memory? Even in a 32-bit OS I never had this problem. I suspect that you have around a GB of RAM or less.

      Also, BTW, I'm not sure why I removed "-Dsun.java2d.d3d=false" from it. I think it might have been to do with my drivers. Who knows. Seems to work either way on this system. Don't mess with it if you don't need to - leave it there if you edit the file!

       

      Last edit: Some random gamer 2018-06-18
      • Blake

        Blake - 2018-07-08

        Nah, if anything I've probably got too much memory compared to most people haha (I do a lot of video editing so I needed it, & no I didn't have that stuff open while playing) and obviously I access it via a 64 bit OS. Specs attached..

        I finished my game a while back so I'm all good even if this can't be addressed anytime soon.

         

        Last edit: Blake 2018-07-08
  • Mike Pope

    Mike Pope - 2018-08-19

    I have increased the memory FreeCol asks for, in trunk at least. Hopefully this shows up in the nightly builds for people to test. I am not happy about this as a fix, and continue to try to understand where FreeCol is consuming memory. We can but try.

    I have also put in a hack to try to trigger a garbage collection just at the start of the saveGame routine. Also, not pretty, but corrupt saved games are worse. Unfortunately, Java's System.gc() is only an advisory call.

    I will leave this bug open as the place to deal with memory issues, for now.

     

    Last edit: Mike Pope 2018-08-19
  • Mike Pope

    Mike Pope - 2018-08-19
    • status: open --> open-needs-info
     
  • Roel Jayme

    Roel Jayme - 2020-03-03

    My computer hardware has an overheating problem, it crashes sometimes, there was one time last week that an almost similar case of corrupted files for a single season/year happened to me.

    The Freecol game by default autosaves in a file that has an "Autosave" prefix at the end of each turn (example: Autosave-4a56aab3_English_1683_2_Autumn.fsg). My habit is to back-up that file in the same directory by pressing the "save game" again, Freecol then saves the game again but this time without the "autosave" prefix (example : 4a56aab3_English_1683_2_Autumn.fsg)

    About 5 to 10 game rounds or game game years that passes, I normally CUT/COPY the autogenerated save files (with the "autosave" prefix) and PASTE them all in my own created directory - that can't be touched by the game autodelete settings, In short I make a final secure back-up after about 5 to 10 game rounds, or whenever I feel like it. Then I DELETE all the other manually saved game files (those files without the "autosave" prefix.

    Now here was what happened, one time I had another hardware crash (not due to the game). While I was playing and I had to press the "end of turn", and then the game was trying to animate the turns of the AI, the computer crashed, So I restarted the computer and then the Freecol game. When I tried to OPEN my manually saved game for that season/year it was corrupted, there was a message about memory error, so I tried opening the autogenerated savefile with the "autosave" prefix for that same season/year, sadly it was also corrupted and I got the same message about memory error. There was no autosaved file generated by Freecol for the next season/year, which was understandable. So my main point is that the crash affected both the autosaved and the manually saved files for that particular season, I had to rollback another season and replay the game, Luckily those other seasons were'nt affected even if they were still inside the same "autosave" game directory created by freecol. I quickly made a permanent back-up for all those files.

    Now I got a new habit: Copy and Paste the manually saved file before pressing the final move "end of turn", this will create a third back-up file with a prefix "Copy" (example Copy of 4a56aab3_English_1683_2_Autumn.fsg) Now I want to wait and see if next time by chance if it will affect the 3rd back-up file with the same season and year in the same"autosave"directory of Freecol if by chance it happens again.

    My computer crashes but this corruption of both files for the same season/year doesn't seem to happen always in Freecol. It only happened once, Most crashes doesn't even corrupt the files.

    Note to developers:
    Game version used when this happened: Freecol-0.11.6
    Java version 8 (build 1.8.0_91-b15)
    I still use windows XP Proffessional with service pack 3
    I'm stuck in the past, it's the most stable version for my current hardware (IntelQ8400)

     

    Last edit: Roel Jayme 2020-03-03
    • Mike Pope

      Mike Pope - 2020-03-03

      ...it was also corrupted and I got the same message about memory error.

      I think you have triggered the same original bug reported here by Blake. It is not a surprise that is occurs for both the autosave and the ordinary save, the bug is in the common "create a save file" routine called in both contexts. If this bug recurs enough to be annoying, consider using the nightly builds which contain the experimental mitigation mentioned up thread.

       
  • Mike Pope

    Mike Pope - 2022-05-01

    I am considering closing this soon. Its been a while since the last sighting, and we have 0.12.0 released with an increased memory requirement that should make this even harder to fix, assuming the experimental fix mentioned above did not work.

     
  • Mike Pope

    Mike Pope - 2022-09-15
    • status: open-needs-info --> closed-duplicate
    • Group: Current --> Unspecified
     
  • Mike Pope

    Mike Pope - 2022-09-15

    Looks like the same OOM issue in BR#3304, but Stian has mitigated it in trunk. Closing as Duplicate.

     

Log in to post a comment.

MongoDB Logo MongoDB