gvx / bitser

Serializes and deserializes Lua values with LuaJIT
ISC License
157 stars 13 forks source link

"size of C type is unknown or too large" #31

Open Calandiel opened 2 years ago

Calandiel commented 2 years ago

I just got that error message. It's not really clear. Perhaps it should mention that size limit? I was trying to serialize ~100 megabytes of cdata (VLAs to be more precise) I tried to follow the stack trace but it wasn't clear to me what exactly happened. In either case, here it is:


engine/bitser.lua:228: size of C type is unknown or too large

Traceback

[love "callbacks.lua"]:228: in function 'handler'
[C]: in function 'typeof'
engine/bitser.lua:228: in function <engine/bitser.lua:215>
engine/bitser.lua:266: in function 'serialize_value'
engine/bitser.lua:210: in function <engine/bitser.lua:181>
engine/bitser.lua:266: in function 'serialize_value'
engine/bitser.lua:272: in function 'serialize'
engine/bitser.lua:398: in function 'dumpLoveFile'
game/entities/world.lua:89: in function 'save'
game/scenes/game.lua:469: in function 'draw'
game/scene-manager.lua:41: in function 'draw'
main.lua:91: in function 'draw'
[love "callbacks.lua"]:168: in function <[love "callbacks.lua"]:144>
[C]: in function 'xpcall'
gvx commented 2 years ago

That's unfortunate. Could you help me out by creating a minimal reproducible example? That would allow me to figure out if there is a way to fix this or at least figure out the exact limits so it can be documented.