View Single Post
07/28/15, 09:39 AM   #10
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
Originally Posted by ZOS_ChipHilseberg View Post
I generated a 9MB Saved Vars file with 60000 strings in an array and did not see any corruption. Maybe there is something more to it?
Yea it's weird. I don't check that file often, not unless I'm specifically looking for something or the add-on spits some error upon load. Right now my file is 19MB / 114k lines. It contains about 10 big arrays, the longest of which is yesterday's 30k lines (i.e. before I posted the above log with the file already corrupted). To me the most surprising thing is that the file is still valid Lua, although keys/data are scrambled.

It may be anything, a combination of array size, number of elements, depth, perhaps Lua memory setting. Or a bug I put in the add-on, that'd be stupid

A few years ago I had to patch Apache Flood because they were reading XML in fixed size chunks, and if you had a #text node crossing the read buffer boundary, it got split into two nodes, and the original code wasn't able to match such split nodes to keywords. This looks remotely similar, perhaps there's a point where the SavedVars reader/writer forgets the context and starts reading from the wrong offset / writing wrong data.

In the sample above I showed how data go "upwards", becoming keys in higher level. Here's a sample of the inverse, where a part of the root SavedVars table is flattened and written as values in the lowest level:
Lua Code:
  1. [4543] = "Jamila_SavedVariables",
  2. [4544] = "Default",
  3. [4545] = "@Merlight",
  4. [4546] = "21:32:46.030 Damage 207 by Sindari to Dominion Guard using Caltrops -- ok slot:Ability source:Self target:Mob ptype:Magicka dtype:Physical",
  5. [4547] = "combatlog",
  6. [4548] = "version",
  7. [4549] = 2,
  8. [4550] = 2305,
  9. [4551] = 210,
  10. [4552] = "00:21:49.585 Damage 237 by Sindari to Aoichan using Caltrops -- ok slot:Ability source:Self target:Enemy ptype:Magicka dtype:Physical",
  11. [4553] = "$AccountWide",
  12. [4554] = "00:21:06.574 Heal 767 by <unknown> to Sindari using <unknown> -- ok slot:Ability source:Mob target:Self ptype:Magicka dtype:Generic",
  13. [4555] = 20150724,
  14. [4556] = 1,

Last edited by merlight : 07/28/15 at 09:41 AM.