Closed dpino closed 5 years ago
call_with_output_string
converts the string to a Lua string, because that's what all the data printers expect. I think either RaptorJIT is extendeded so it can manage strings bigger than 2GB or we modify the printers somehow.
It would certainly be possible for raptorjit to support longer strings. But it would be better if we never used "call_with_output_string" anywhere: i.e. never build up a big result string like that. Always stream. That would require changing the snabb-config-leader-v1 schema to represent the config as YANG 1.1 anydata
(https://tools.ietf.org/html/rfc7950#section-7.10) instead of a string.
Created new issue https://github.com/Igalia/snabb/issues/1177
Attempt to fix #829. The issue states is not possible to retrieve large binding tables using
config get
, even if using RaptorJIT.The main issue here is that even though RaptorJIT is aimed for Intel 64-bit architecture, it still have limitations on string size inherited from LuaJIT. It's not possible to manage strings bigger than 2GB.
When pulling a 10M binding-table config using
config get
the output string is larger than 2GB.In this PR I modified
lib/stream/mem.lua
to back up on C's runtime memory management functions, howevercall_with_output_string
converts the buffered string to a Lua string using FFI, so backing up on C's runtime memory functions does not solve the issue.2387430001 bytes is approximately 2.3GB.