Page 1 of 1
deserialization error ?
Posted: Thu Jul 21, 2016 9:04 am
by binbinhfr
Hi,
running one of my mod, a user have this strange message that I cannot reproduce, but which is related to my mod, because force_mem is my variable.
Code: Select all
Error while running deserialization: [string "do local _={ticks=87,enabled=true,force_mem={..."]:1: too many C levels (limit is 200) in main function near "802384732948701238470123""
thread with user explanation :
viewtopic.php?f=92&t=29179&p=187057#p187045
any idea ?
Re: deserialization error ?
Posted: Thu Jul 21, 2016 9:16 am
by Rseding91
Are you storing entity references as keys? If so, don't do that. The serpent library we use that saves the Lua state doesn't work correctly and you end up with this type of error.
Re: deserialization error ?
Posted: Thu Jul 21, 2016 10:16 am
by binbinhfr
Rseding91 wrote:Are you storing entity references as keys? If so, don't do that. The serpent library we use that saves the Lua state doesn't work correctly and you end up with this type of error.
Do you mean using a table indexed directly on entities ?
I store several complex tables but only indexed by names
a table of forces by force names
a table of recipes by recipe names
a table a items/fluids by names
these tables can have entity as members, or even other tables or lists, or references to other objects in another table.
I also store references to GUI elements.
I checked my code but did not remember using entity as a direct index, not even entity.unit_number.
Another idea ?
Re: deserialization error ?
Posted: Thu Jul 21, 2016 10:34 am
by binbinhfr
EDIT : the user send me the map ans the mods here
https://wsi.li/avdqzY1a509N
I confirm the problem. But cannot track it... Do you have other way to be more precise in what I do wrong in my EfficienSee mod ? What variable is in problem ?
The force_mem variable of the error message is a table indexed by force names. It contains several other big tables, indexed by strings or not indexed too.
Re: deserialization error ?
Posted: Thu Jul 21, 2016 11:48 am
by Rseding91
Well, the script.dat file is 370 MB so what ever you're doing in the mod is storing too much data in the global table.
Re: deserialization error ?
Posted: Thu Jul 21, 2016 11:52 am
by Rseding91
Yeah, it's the mod "EfficienSee". What ever you did in the mod is just wrong - 370 MB of lua tables in the save file is around 368~ MB too much.
Re: deserialization error ?
Posted: Thu Jul 21, 2016 12:24 pm
by binbinhfr
Well yes, as I try to keep track of all statistics of the factory, it's too much.
I will have to forget about this approach and propose something more simple...
Re: deserialization error ?
Posted: Thu Aug 03, 2017 3:31 pm
by wvlad
Devs, can you please add to the docs that entities should not be stored in global.sometable as table keys? I've just encountered this issue myself.