1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Hard Crash at end of turn - 100% reproducible

Discussion in 'Bugs and Crashes' started by code99, Jan 28, 2019.

  1. code99

    code99 Chieftain

    Joined:
    Apr 28, 2010
    Messages:
    262
    Location:
    Romania
    In the included zip, you got the dump and save file (1 turn before crash).

    The game crashes to desktop after I click end turn, i feel like its crashing towards the end of turn processing cycle.

    Crashes every single time, just press end turn.

    This game was played on an earlier SVN (few days ago, right before modern era name change). I have updated to latest svn and tried again, didnt work.

    Dont mind the dates and era im in that game, this is a game i was messing around, having some fun (cheated my way to industrial era).

    Any chance to recover the game?

    If you need any more info, let me know.
     

    Attached Files:

  2. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    Probably your game broke from cheating, name change was just text change, so it shouldn't do anything.
     
  3. code99

    code99 Chieftain

    Joined:
    Apr 28, 2010
    Messages:
    262
    Location:
    Romania
    I wasnt suggesting the name change was the issue, its just so you guys know what version i was on (i dont remember what svn revision that was).

    I doubt cheating caused it, its not my first time doing it. I used the world builder to add techs. But, then again, what do i know :)
     
  4. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    Probably you added some dummied out tech by accident or something.

    That is messing with worldbuilder is very bad for game.
     
  5. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,086
    Gender:
    Male
    Location:
    Las Vegas
  6. code99

    code99 Chieftain

    Joined:
    Apr 28, 2010
    Messages:
    262
    Location:
    Romania
    Yes, it's in the zip file

    I'd appreciate to know the cause of this CTD if you can find out. I'd hate to start another game for it to crash after so many turns.

    Thanks!
     
    Last edited: Jan 29, 2019
  7. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,086
    Gender:
    Male
    Location:
    Las Vegas
    Resolved. Thank you for the report. Your game was early enough and small enough in scope to make this a perfect one to use to further research, dig deep, and tackle this longstanding problem finally.

    In essence, when a unit on the move is killed during an ambush and it is a part of a larger selection group of units, it would end up having the selection group as a whole in one plot while it would stay in its own plot but not be removed from the selection group so it would create a very bad state where the unit is not where its selection group is - something the game assumes will never happen and will crash if it finds such a disagreement at certain points. So I learned by analysis that I had to remove the unit from the group if it was killed in this manner and where I needed to do so. This will solve a lot of crashes we've seen lately.

    Unfortunately, this doesn't address the memory based crashes some games start getting every 5 rounds or so after a certain point of complexity is reached. But hey, it's an improvement at least.
     
    sunrisereader, code99, tmv and 2 others like this.
  8. code99

    code99 Chieftain

    Joined:
    Apr 28, 2010
    Messages:
    262
    Location:
    Romania
    Awesome, glad it helped you guys find the issue.

    The save works fine now so thank you for that!

    What do you mean by complexity?

    Can this occur in smaller games like the one in my save (tiny map, 2-3 ais) ?
     
  9. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,086
    Gender:
    Male
    Location:
    Las Vegas
    I mean larger maps generally will suffer them. My wife is on a Huge map game and crashes every 2 rounds in mid-Atomic era. Let me know how far you can go before you start experiencing them, if ever, on your size. I'm looking for a memory leak that should exist somewhere.
     
  10. code99

    code99 Chieftain

    Joined:
    Apr 28, 2010
    Messages:
    262
    Location:
    Romania
    Gotcha. Im currently playing a game on a tiny map (with 4-5 ai) and my goal is to reach later eras. Ill post eventual problems that might arise
     
  11. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    Is she playing on C2C_World map? Then her Huge is really halfway between Huge and Giant.
    Joseph was surprised, when he learned, that C2C_World always made bigger maps, that is my standardization of size didn't affect him, as he always plays on C2C_World.
    C2C_World Duel/Tiny/Small/Standard is roughly equivalent of old Small/Standard/Large/Huge, assuming mapscript made default sized maps before standardization of sizes.

    Can I see her save by the way?
     
    Last edited: Feb 7, 2019
  12. Whisperr

    Whisperr Chieftain

    Joined:
    Oct 15, 2011
    Messages:
    226
    I play the C2C_Planet_Generator_0_68, Huge. The amount of turns i get between crashes has been dwindling over time, to the point I am at now - every two turns.

    I save after setting builds, and at the end of each turn.

    I guess I don't mind the crashes, if they come after a save, it only takes about 5 mins to restart the computer and restart the game. My concern is, is it going to get to the point of not being able to get through a turn.


    You want my save game?
     
  13. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    I never restart computer after any game crashes. If you have to do this, then something is wrong with your computer or with game itself.
    Only reason to do so is when game starts using virtual memory (hard drive as it was RAM), then computer can slow down very hard.
    That is heavily modded 64 bit games eating all memory and some more.
    If you have 8 GB RAM and don't run RAM intensive things in background, then CIV4 should never get to use virtual memory (page file) if it can use it at all.

    I think restating computer after game crash was for fixing cache just in case.
    But mod doesn't use cache for long time - clearing cache is needed when using very old version of mod or when you were playing with other mod or vanilla game.
    I found StrategyOnly post from 2010 about restating computer after game crash, but cache was a thing back then.

    And yes, I want to see your save.
     
    Last edited: Feb 7, 2019
  14. Whisperr

    Whisperr Chieftain

    Joined:
    Oct 15, 2011
    Messages:
    226
    There is nothing wrong with my computer it is only 3 months old and I have 16 gig of ram. I guess restarting my computer is something carried over from my old computer. You probably won't gain much from my save, I don't play single player games, so most things you look at you won't be able to see.
     
    raxo2222 likes this.
  15. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    So your old computer had weird bug. Or you kept habit from when mod had cache.

    I wonder if multiplayer is more RAM intensive than singleplayer.
    How much RAM does your game use when you load save?
    Does AI build or actively use tanks and planes in your game?
    By the way now that I fixed ordinances for third time did you and AI built them? You should see nice drop in pollution.
     
    Last edited: Feb 7, 2019
  16. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,086
    Gender:
    Male
    Location:
    Las Vegas
    Whenever a program has a memory allocation failure, if I understand things correctly, there's always the chance that the RAM still has some allocated variables for the program that didn't close out properly. Never a bad idea to restart entirely after such an event.
     
  17. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    This isn't necessary - any software needs to know where variable is (doesn't matter if it was its variable stored before it crashed) before having chance to load it.

    Also game would crash VERY frequently if it kept loading random stuff left in RAM and kept feeding its functions with garbage.
    It doesn't matter if random stuff was what game left when it crashed.

    Any good operating system cleans up RAM when software crashes.
     
    Last edited: Feb 7, 2019
  18. Thunderbrd

    Thunderbrd C2C War Dog

    Joined:
    Jan 2, 2010
    Messages:
    26,086
    Gender:
    Male
    Location:
    Las Vegas
    It's not that it loads anything in, it's that those sectors of RAM are no longer available to any program. This IS coming from very old and likely outdated understanding of computer science from the late 80s though. It's quite possible that more advanced systems now know how to clear out anything and everything from any process no longer running automatically.
     
  19. raxo2222

    raxo2222 Time Traveller

    Joined:
    Jun 10, 2011
    Messages:
    6,142
    Location:
    Poland
    I guess automatic cleanup of RAM after software crashed was already a thing in Windows XP if not Windows 95 or even DOS.
    Or even you could misremember something from back then and automatic cleanup of RAM was part of any OS even earlier before PCs were a thing.

    That is RAM being locked out from use if software crashed likely was not a problem even in 60's or 70's.
     
    Last edited: Feb 7, 2019
  20. Toffer90

    Toffer90 C2C Modder

    Joined:
    Oct 16, 2011
    Messages:
    6,082
    Location:
    Norway
    References to RAM locations are explicitly tied to the processes that reference the location, when the process terminates, for whatever reason, the kernel will automatically refresh its "registry" that keeps track of RAM location references.
    If a RAM location is not referenced by any running processes the memory in that location is "freed" and thus available when another process need to store something in RAM.
    The RAM location is only occupied as long as a reference to it exist.

    This has been the case for all normal OS's for time immemorial.
    Real-time operating system (RTOS) are an exception to what I said here, but they are not normal OS's, no personal computers would have one of those.

    Much software have memory leaks, also some of the typical processes that are always running on many computers, so it is not that rare to see a computer chugging more and more RAM the longer it has continually been powered on.
    Sometimes a computer restart is the easiest way to deal with this, but as long as one have 2-3 GB or more free RAM, there is little reason to restart the comp. before launching C2C.
    Back in the days when having only 512 MB of RAM was ordinary, or even when 4 GB was all one had, it was far from strange that a computer got all laggy and problemeatic after running for 2-4 days continually, especially for those who had many different processes running in the background all the time.

    OS's can have memory leaks between version x and version y, and the same is true for graphics drivers, Motherboard software, fan controlling software, mp3 players, printer related processes, P2P clients, etc. stuff that often is running in the background.
    The abundance of RAM in today's computer, like 16GB, makes this problem a very rarely noticeable issue.
     
    raxo2222 likes this.

Share This Page