Code center > Bugs and fixes
Saving and loading in 2.4
Elite:
My sim won't load. You can get it in the 'shortest evobot' topic.
I think Testlund found that his save got courupted too ... this needs to be adressed
Welwordion:
Well I already experienced this quite often, but I am not sure if this is limited to 2.4 so I was silent about it.
EricL:
I've tracked this down. Believe it or not, it's another overflow bug. It's been in the code for a long time and probably exists in 2.37.6.
When you save a sim, it saves all the bots in the sim including for each, the textual descriptions of all the mutations that have occurred along that bot's ancestaral line. The way the simulation save/load code works for varaible length things like this is that it first saves the length of the thing to the file and then saves the thing itself. This way, when it's read back in from the saved file, the length can be read in first and used to allocate the right amount of memory for reading back in the actual data.
Well, wouldn't you know it, the length of the mutation details is converted to an Integer before it is saved to the sim file. This means that if the length of the string exceeds 2^15 bytes, the number saved to the file will be negative!!!!! When the code attempts to load the sim file, it reads this negative number and attempts to allocate a negative sized string, which is what generates the illegal procedure call error.
So, basically, any sim file containing bots with large numbers of mutations will fail to load.
I will fix this in a backward compatable way in 2.42.4 which I will try to drop quickly, say by this weekend.
Numsgil:
A "save sim fixer" would be nice too. I don't want to lose some of my corrupted saved sims. :/
EricL:
--- Quote from: Numsgil ---A "save sim fixer" would be nice too. I don't want to lose some of my corrupted saved sims. :/
--- End quote ---
My goal is for 2.42.4 to be able to read older sim files with this specific corruption and save them correctly. So 2.42.4 will hopefully be a "saved sim fixer" for this specific issue at least.
Navigation
[0] Message Index
[#] Next page
Go to full version