FreeOrion

Forums for the FreeOrion project
It is currently Sat Dec 16, 2017 10:22 pm

All times are UTC


Forum rules


Always mention the exact version of FreeOrion you are testing.

When reporting an issue regarding the AI, if possible provide the relevant AI log file and a save game file that demonstrates the issue.



Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Jan 19, 2016 11:22 pm 
Offline
Space Krill

Joined: Tue Oct 20, 2015 10:51 pm
Posts: 6
I have been getting an error when the program tries to autosave. I noticed this happens after 290 turns or more. I am running the latest version. 4.5 build 2016-01-11.609936e. I was having the same issue with the previous version was hoping it was fixed in this release.


Top
 Profile  
 
PostPosted: Tue Jan 19, 2016 11:38 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Edit: removed unnecessary discussion of XML vs. binary save settings /Edit

If you have a save that reproduces the problem, then please zip the save and post it in a reply if it can be attached (might not due to size limits).

If you can't do that, then please attach all the .log files from immediately after getting the error. Ideally load a game that produces the issue after a single turn, and delete all the logs before producing the error, to be sure you're getting only fresh log files.

The logs (and saves) are in the directory discussed here: http://freeorion.org/index.php/Config.xml


Top
 Profile  
 
PostPosted: Fri Jan 22, 2016 6:51 am 
Offline
Space Krill

Joined: Tue Oct 20, 2015 10:51 pm
Posts: 6
The saved file and the log files when zipped where still too large to attach. You can download the zipped log file and game file from the links below.

http://newage-mkt.com/AI_8.zip
http://newage-mkt.com/FreeOrion_Save.zip

Thanks,

Keith


Top
 Profile  
 
PostPosted: Fri Jan 22, 2016 8:56 am 
Offline
Release Manager, Design
User avatar

Joined: Wed Nov 16, 2011 12:56 pm
Posts: 4303
Location: Sol III
@knelson: What platform are you running on? What are your system specs?


Top
 Profile  
 
PostPosted: Fri Jan 22, 2016 11:10 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
I loaded the save with the latest master build, pressed turn, and it seemed to work fine. Ran a few more turns with turn autocycle on, and eventually got the error popup. In the server log, I see
Code:
2016-01-22 11:58:09.244977 [error] Server : SaveLoad.cpp:171 : Error when writing save file. SaveGame exception: : output stream error
which is not especially helpful. I'm adding some extra logging now...

Edit: the preceeding line appears to be actually indicating where it's failing, which is when serializing the stat records... which is a bit surprising as that's just a nested bunch of std containers / data.

Edit2: The problem seems to occur when serializing to XML, and before the compression is attempted. I'm guessing / it seems like some limit or buffer being exhausted when writing too much data, which just happens to occur for this game when attempting to serialize the stat records.

I suggest: Before loading a game, go into the options screen, scroll to the far-right "Other" tab, and enable Binary Serialization. Then load the game and attempt to continue playing. This seems to more-reliably produce autosaves for me, without any errors popping up. The resulting saves won't be cross-platform compatible, but should work fine on your own system.


Top
 Profile  
 
PostPosted: Fri Jan 22, 2016 4:51 pm 
Offline
Space Krill

Joined: Tue Oct 20, 2015 10:51 pm
Posts: 6
I am using a windows platform.


Top
 Profile  
 
PostPosted: Sat Jan 23, 2016 2:00 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
Geoff the Medio wrote:
Edit2: The problem seems to occur when serializing to XML, and before the compression is attempted. I'm guessing / it seems like some limit or buffer being exhausted when writing too much data, which just happens to occur for this game when attempting to serialize the stat records.
I've moved the stringstream used for storing the XML serialization data onto the heap, instead of the stack, in the hope that this would also move the buffer, and added custom NVP-serialization name tags for meter current and initial values, in the hope of reducing the size of the serialized text. Doesn't seem to have helped, though.

I also somewhat randomly have errors reading in the save, due to "bad allocation" errors, when attempting to decompress the saved serialization text. Sometimes it happens, sometimes not, for no apparent reason. Rebuilding after making some code change seems to help sometimes.

I also put some debug log output to check the size of the stringstream into which save data is serialized, and it gets up to ~70 MB before the universe stuff is serialized, which is a bit surprisingly large, and supports the buffer limit theory. Haven't been able to find any way to pre-allocate a buffer for the stringstream, though.


Top
 Profile  
 
PostPosted: Sun Jan 24, 2016 9:35 pm 
Offline
Pupating Mass

Joined: Fri Jul 03, 2015 2:32 am
Posts: 97
Location: Great White North Eh
FYI, I have been occasionally getting these errors as well, always late game, but have never been able to reproduce them. I have auto save set to generate every turn, and reloading the previous turn's autosave has always worked, although sometimes freeorion needs to be restarted first.

_________________
Windows 7 64bit, AMD 8 Core, 8 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build


Top
 Profile  
 
PostPosted: Mon Jan 25, 2016 11:20 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
I tried replacing stringstream by an std::string wrapped using some boost iostreams wrappers: back_insert_device<std::string>, and stream<back_insert_device<std::string> >. This lets me manually reserve space to increase the buffer capacity, so as to avoid repeatedly reallocating more memory in order to store serialized text data as it is generated while saving.

This works fine for loading saves, but it inexplicably breaks when serializing to text in order to write a new save. If I look at the contents of the buffer after serializing, it suddenly stops mid-entry. This occurs even when serializing a small new game gamestate, so is seemingly not an issue with the buffer size, unless there's some other internal buffer I'm not aware of.

Edit: Eventually found that I needed to add calls to flush the stream to the buffer. After that, it seems to work. Try loading the save and playing again with the next test build.


Top
 Profile  
 
PostPosted: Wed Feb 17, 2016 2:06 am 
Offline
Pupating Mass

Joined: Fri Jul 03, 2015 2:32 am
Posts: 97
Location: Great White North Eh
I just played a large game to a little over 400 turns without any save errors, and have had multiple games in the 250 - 300 turn range, also without any save errors, on the Feb 09 Build. I think you fixed it.

_________________
Windows 7 64bit, AMD 8 Core, 8 GB
Nvidia GTX 670 @ 3240x1920
FreeOrion Build: Latest Windows Test Build


Top
 Profile  
 
PostPosted: Sat Jul 02, 2016 6:24 am 
Offline
Space Krill

Joined: Thu Jun 09, 2016 2:57 am
Posts: 3
UrshMost wrote:
I just played a large game to a little over 400 turns without any save errors, and have had multiple games in the 250 - 300 turn range, also without any save errors, on the Feb 09 Build. I think you fixed it.


Sorry, but I dont think so...

O got the "Error when writing save file" today.

v0.4.5+ build 2016-06-06.4187172

Windows 7 ultlimate 64 SP1

8 GB RAM, i3-2100, game on C: SSD drive, savegame folder in D: conventional HD.

I also cannot save game thru the main menu. All save tries since turn 380 results on a empty file (size = 0)

Frustrating... a so big game wich I could win...


Top
 Profile  
 
PostPosted: Sat Jul 02, 2016 7:22 am 
Offline
Programmer

Joined: Sun Feb 14, 2016 12:08 am
Posts: 359
If you were able to save before with the same build, is the drive full or read-only?

A couple of issues were fixed around the same time as your build, you might try a more recent build. Failing that, could you attach the freeorion.log and freeoriond.log files?

_________________
Any content posted should be considered licensed GNU GPL 2.0 and/or CC-BY-SA 3.0 as appropriate.


Top
 Profile  
 
PostPosted: Sat Jul 02, 2016 9:08 am 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
dbenage-cx wrote:
...could you attach the freeorion.log and freeoriond.log files?
When reporting such issues, the logs should be attached unless there's a reason not to.

dariomor wrote:
All save tries since turn 380 results on a empty file (size = 0)
If you can find a previous save from the same game, which can be used to reproduce the issue, then attaching that (or more likely posting it somewhere else and linking, as it would presumably be too large a file for the forums), would be helpful.


Top
 Profile  
 
PostPosted: Wed Jul 06, 2016 4:37 pm 
Offline
Creative Contributor
User avatar

Joined: Fri Jun 28, 2013 11:45 pm
Posts: 3295
I don't know if this is related but I sometimes get blank 0Kb saves, and it's happened to me both on Windows and Linux, it's never happened to an autosave and only ever to a save I make just before shutting the game down.

I never notice it's happened until I reboot the game and try to load my last save, so log files aren't useful, I have now got the directory open so I can check the filesize and similar, screenshot attached.
Attachment:
savegame-failures.png
savegame-failures.png [ 112.8 KiB | Viewed 532 times ]


Due to absence of valid logs, not sure where to start looking, but as it happens on both my machines (I don't use the Windows laptop much for FO but it has happened there) it appears to be more than just a personal settings glitch.

_________________
Mat Bowles

Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.


Top
 Profile  
 
PostPosted: Thu Jul 07, 2016 12:47 pm 
Offline
Programming, Design, Admin
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 12045
Location: Munich
If it's happening with 3 MB save files, it's not related to the previous issue with overly large universes.

A log or way to reproduce will be needed, though...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group