Hi! I’m getting the following error when loading using DefSave (1.2.0, though I get the same in 1.2.1):
ERROR:SCRIPT: /defsave/defsave.lua:119: Reading outside of buffer at element #3 (string) [value_len=1946157056]: wanted to read: 1946157060 bytes left: 102826 [BufStart: 000000013F5BB8E8, BufSize: 102844]
'NVN}KS{12|KSVBKSVBKSVBKSVBKSVBKSVBKSVBKSVBKSVBKSVBKSVBKSVB}KSVNKS{32|KN{6|KSVSKSVBKSVNKSVSKSVSKS{3|KN{3|KSVSKSVNKSVUV4}KN{3|KSVS'
stack traceback:
[C]: in function 'load'
/defsave/defsave.lua:119: in function 'load'
Does anyone know what this means? It’s not the end of the world because I get the error when I try to load a save file generated by another user… But I have previously been able to do that without issues (even across OS, for example Mac to Windows and then back again). The save file works fine for the user in question as far as I know. I don’t know their OS or setup, but can go back to them to ask if that’s important information.
I thought it might have something to do with my save files being too bloated (the main save of this user is ~100kb and contains some long strings of text). However, that theory came into question when I got the same error for their settings save file, which is ~1kb and just contains a bunch of basic bools, keymaps, and stuff like that.
I believe the answer to both of those questions is no. I don’t modify the default values for encryption and obfuscation so they are both off. The content of the save file is readable enough if I open it in a text editor:
Thank you for taking the time to look at it. It’s not a showstopper because it seems to work for the user on their machine, it’s just I can’t load their save file to troubleshoot / amend their save state. I am quite confident it works for them because the error for me is logged in Err (thanks for that one too, @Pkeod) and when I asked them for error logs they said there weren’t any.
In Notepad++ on the bottom right when opening the files. Notepad++ could be been confused though, I don’t know enough about these things to say. There might be something else platform specific going on too though.
Anyone on Linux see if sys.load() loads the first sample OK without error?
No text input, and their system language is US English.
Good idea about automatic script error reporting, I should have thought of that myself. I’ve actually got googleanalytics implemented already, but I can’t get it to work for error reporting so I’ve got a separate thread about that.
After looking into this, it seems the saved file has become corrupted during the save.
I have a theory about how that could happen but I haven’t come up with a good way to confirm that yet.
I think this issue is actually quite serious, since it might mean that any save (under the right conditions) might get this issue.
Does you user get this issue 100%? I mean, if the user removes the save file, then saves again, will the issue come back?
I would highlight that the user is not experiencing problems with their save. Since I obtained the file from them they have gone on to complete the game.
Could it be that you have a fallback in case the user couldn’t read the file?
How often do you save the file? Is it new data every time?
The symptom might have gone away by simply adding different data, then saving.
There’s no fallback for main save files, though on launch the settings values will revert to defaults if the file is corrupted.
Settings is saved every time the user makes changes in the settings menu. Main save files are saved frequently as well (primarily on map transitions, which happens every few minutes or so). In both cases, all values are saved every time (though I’m not sure if DefSave does something under the hood to only populate new values).