Author Topic: Saves gets corrupted in 2.42.5a too.  (Read 1473 times)

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Saves gets corrupted in 2.42.5a too.
« on: June 11, 2006, 06:26:47 PM »
I have attached a zip here that causes an overflow error when ever I try to load it. This is from version 2.42.5a.
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Saves gets corrupted in 2.42.5a too.
« Reply #1 on: June 11, 2006, 11:59:53 PM »
I think this is that same timing dependent crash I've been trying to catch forever.  There is nothing wrong with the sim file itself.  It is not corrupted and loads and runs fine under VB.  But something in the sim causes an overflow in the naked exe after only a few cycles.  Damn, I sure wish it would happen in VB.  I'm too lazy to use a real debugger...
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Saves gets corrupted in 2.42.5a too.
« Reply #2 on: June 12, 2006, 07:58:56 AM »
That sounds problematic. This happens more often since 2.42.5. Maybe it's something that you have worked on in these releases that causes it.
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Saves gets corrupted in 2.42.5a too.
« Reply #3 on: June 12, 2006, 11:19:16 AM »
I ran it all night in VB without a crash.  But when I save that sim and load it in the exe, the overflow happens within a few cycles but not always the same number of cycles.  It's timing dependent in some way.  I can load the same sim time and time again and it will crash at different times, sometimes on the first cycle it gets to run, sometimes as late as 20 cycles afterwards...  I've tried stripping the mutation details and using an exe without any compile optomizations.  Same results.  Something about running under VB, either the timing overhead or a difference between compiled and interpreted code is the root cause here....

I'll stay on it...
Many beers....

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Saves gets corrupted in 2.42.5a too.
« Reply #4 on: June 12, 2006, 07:57:40 PM »
[attachment=308:attachment]Okay, I found this one.   What a royal fricking pain in the butt tracking this one down has been.

So, the issue is that some of the bots in Testlund's sim have really wacky mutation means and standard deviations, like -1 X 10 ^20.  My assumption is that this happened when this sim was saved prior to 2.42.5 and then re-loaded or when specific bots were so saved.   A long value paremter in ChangeDNA() was overflowing when a super large Single was being passed to it from PointMutation(), the result of the wacky point mutation probability values.

The reason it only occurred in the EXE and not in the VB IDE probably has to do with the IDE using different calling conventions or having some sort of underlying implicit Single to Long aliasing scheme.

Anyway, In 2.42.6, I've added some sanity checking for both the Gauss routine (which consumes these parameters to determine the mutation length) as well as in the sim file load routine itself.  If you load a pre 2.42.5 saved sim (or any other sim) and the mutation values are way out of wack (negative or over 32000) then I set the mutation mean and standard deviation to the default values.  This way, old sims should run okay even if they were saved with mucked up values.

Whew.  This one was really bugging me.

Testlund, attached is your sim, saved without mutation details and with the default mutation values.  Hopefully, it uploaded okay.

By the way, you owe me a beer.  
« Last Edit: June 13, 2006, 11:33:46 AM by EricL »
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Saves gets corrupted in 2.42.5a too.
« Reply #5 on: June 13, 2006, 03:55:23 AM »
No, I get the CRC error with this one too, when trying to unzip it. It's weird because it hasn't been a problem before. Anyway, you've found the bug and I'm looking forward to 2.42.6.

This save by the way was from a new sim that I started in 2.42.5 but the bots were from 2.42.4. I've understood by now that it can be problematic using a bot or loading a sim from a previous version into a new version.

I can also tell you I keep getting crashes with no error message, just that DB has encountered a problem and needs to close. Maybe it's because of this bug too.

And here's a beer for ya!  
« Last Edit: June 13, 2006, 03:58:42 AM by Testlund »
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine

Offline EricL

  • Administrator
  • Bot God
  • *****
  • Posts: 2266
    • View Profile
Saves gets corrupted in 2.42.5a too.
« Reply #6 on: June 13, 2006, 11:34:36 AM »
This one should download okay.  It works for me when I save and then open but does not seem to work if I open and then save...

I figured the bots came from pre 2.42.5.  Don't be too shy about taking things from one version to the next, that's what saves are for.  The issue I fixed in 2.42.5 was a special case.  I don't forsee any such discontinuties in the future.

If your crashes are with sims which were ever saved pre 2.42.5 or have bots which were saved from pre-2.42.5 sims, then this is indeed  likely the underlying cause.

Thanks for the beer.  Not quite as good as the real thing though.
« Last Edit: June 13, 2006, 12:22:07 PM by EricL »
Many beers....

Offline Testlund

  • Bot God
  • *****
  • Posts: 1574
    • View Profile
    • Games And Electronica
Saves gets corrupted in 2.42.5a too.
« Reply #7 on: June 13, 2006, 06:24:33 PM »
Ok, it works now.
"God is an ever receding pocket of scientific ignorence." - Neil DeGrasse Tyson

"God is a kid with an ant farm" - Constantine