Darwinbots Forum

Code center => Bugs and fixes => Topic started by: Peksa on April 29, 2008, 04:36:50 PM

Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: Peksa on April 29, 2008, 04:36:50 PM
I think this too might have something to do with sexrepro. The sim I posted in the last bugrep ran stable for more than 15 hours. At that point I had to restart my computer. After trying to load the sim again and I got the following error after a long while of loading:

"An Error Occured. Darwinbots cannot continue. Sorry. Invalid procedure call or argument Darwinbots 5 0"

And when trying to load any other sim I got the same error again. When I quit darwinbots to restart it, I get this error:

"Unable to save settings: some error occured"

And after pressing ok, this:

"Run-time error '55': File already open"

After pressing ok again, darwinbots closes.

After restarting, other sims run fine, but I still can't load this sim. All the autosaves from the sim act the same way.

Another cause I can think of could be the amount of mutation details. The sim has about 1000 bots and every reproduction event has added a line in mutation details, so the .sim file is bloated at 43 MB unzipped.
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: Testlund on April 30, 2008, 09:47:48 AM
It's the same problem I've been having a couple of times. I reported about it here.

http://www.darwinbots.com/Forum/index.php?showtopic=2570 (http://www.darwinbots.com/Forum/index.php?showtopic=2570)

I think it might be when the mutation details gets to many. Haven't seen the problem since I saved without mutations. You may want to check that for your autosaves too; there's a checkbox there.
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: Peksa on May 01, 2008, 04:36:24 AM
I don't think .sexrepro caused this. My other long running sim developed the same problem. Luckily, I noticed this before all autosaves did the same. The other sim with defunct .sim file is attached.

I'll try to save without mutation details and see if it helps.
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: EricL on May 01, 2008, 12:36:40 PM
Pretty sure this is a bug in saving fertilized bots.  Working on it...
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: EricL on May 01, 2008, 01:02:45 PM
Found it!!!!!  Incorrect cast of a Single to a Long in the bot load routine.  Only manifests itself in long running evo sims when there are lots of mutation details.

The good news is that the sims arn't actually corrupted.  The bug was only on the load side, not the save side.  I've verified that the fix opens the sims in this post and in Testlund's post.   This was a big one.  Hard to find, but totally a smoking gun.

Here's a prelrease of the next drop that should be able to load your sims.
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: Peksa on May 01, 2008, 05:22:48 PM
Great, thanks! It works great.
Title: Courrupted .sim files RESOLVED 2.43.1k
Post by: asterixx on May 01, 2008, 09:44:30 PM
Thank you EricL!    I was having this problem too.