ID:157144
 
BYOND(467.1069) Debug: fmem block size at 73486 is 0/73543 with type 0.
File offset: 73486
Real position: 73491/73543
BYOND(467.1069) Error: corrupt or invalid savefile '/home/byondsrv/.byond/cache/
228A82E6'
Attempting auto-recovery of '/home/byondsrv/.byond/cache/228A82E6'.
BYOND(467.1069) BUG: crc mismatch in ReadCacheItem
Failed to backup savefile; aborting.
Aborted restoration.
BUG: Crashing due to an illegal operation!
proc name: safe load (/proc/safe_load)
source file: Savefile.dm,238
usr: null
src: null
call stack:
safe load( (/savefile))
101ZERO101 (/client): Load()
101ZERO101 (/client): New()


I am already using the safe_save() so not sure what else i can do, but recently game hosts have been complaining of server crashs and have found its always the same key. It seems to be on purpose (which has happened in the past....).

I checked the line in question;

var/text = F.ExportText("file") // 236
if(copytext(text,1,14) != ". = filedata(") // 237
return null // 238


And the most relivent part of the loading is;

var/savefile/temp = new(Import())

if(!length(temp)) // Load Default new player vars
else if(length(temp)>153600) // Reject it as its too big and load default new player vars
else
var/savefile/c_file = safe_load(temp)
if(c_file)
if(c_file["name"]) c_file["name"] >> mob.name
// etc etc
else // Load new player vars


I don't see anything wrong here? Is this bug something BYOND related or something my code related?

Eitherway unfortunatly im forced to make a thread here asking for some advise :/ i hate wasting precious time protecting the game from mindless trolls but meh.. such is the internet.

EDIT: Maybe this should be in code problems. Hummm.
If it's always the same key, it sounds like somebody is just plain corrupting their savefile through tampering. The good news is that it apparently works for the purposes of preventing this, the bad news is obviously that it's crashing instead of failing properly. If you can grab and send me the corrupt savefile, I can have a look at it, but it's possible there's just no way to completely prevent it, due to a lack of error catching in BYOND.
Unfortunately this has been a most difficult bug to catch. The savefile code is very much black-boxy and without source code and a seequence of steps to follow to reliably cause the crash, it's hard to make any headway.

In my recent investigation of this I discovered the crash is somewhere in one of the internal routines called by ExportText(). I can't really know more without examining the source.

Lummox JR
In response to Lummox JR
As he said, he was using my Safe Save library, so it'd be in there. However, there isn't really much being done, there: it's saving one string (the hash) and one filedata object (the savefile), which isn't even loaded before the ExportText() is called.