Igalia / snabb

Snabb Switch: Fast open source packet processing
Apache License 2.0
47 stars 5 forks source link

Error when adding a new softwire #1221

Closed dpino closed 4 years ago

dpino commented 5 years ago

Adding a big number of softwires individually to a running lwAFTR instance, results into the following error:

program/config/common.lua:174: unexpected EOF when reading length

Stack Traceback
===============
(1) Lua function 'handler' at file 'core/main.lua:168' (best guess)
    Local variables:
     reason = string: "program/config/common.lua:174: unexpected EOF when reading length"
     (*temporary) = C function: print
(2) global C function 'error'
(3) Lua upvalue 'read_length' at file 'program/config/common.lua:174'
    Local variables:
     socket = table: 0x409a8128  {io:table: 0x409a7f68, tx:cdata<struct 1417>: 0x409a9248, random_access:false (more...)}
     line = nil
(4) Lua global 'recv_message' at file 'program/config/common.lua:185'
    Local variables:
     socket = table: 0x409a8128  {io:table: 0x409a7f68, tx:cdata<struct 1417>: 0x409a9248, random_access:false (more...)}
     (*temporary) = Lua function 'read' (defined at line 180 of chunk program/config/common.lua)
     (*temporary) = table: 0x409a8128  {io:table: 0x409a7f68, tx:cdata<struct 1417>: 0x409a9248, random_access:false (more...)}
(5) Lua field 'call_leader' at file 'program/config/common.lua:194'
    Local variables:
     instance_id = string: "lwaftr"
     method = string: "add-config"
     args = table: 0x404c6bc0  {path:/softwire-config/binding-table/softwire, schema:snabb-softwire-v2 (more...)}
     caller = table: 0x404c6c20  {parse_output:function: 0x409a7890, print_input:function: 0x404decb0}
     socket = table: 0x409a8128  {io:table: 0x409a7f68, tx:cdata<struct 1417>: 0x409a9248, random_access:false (more...)}
     msg = string: "add-config {\
  config \"{\\n  ipv4 198.18.20.236;\\n  psid 0;\\n  b4-ipv6 2003:1c09:ffe0:100::14ec;\\n  br-address 2003:1b0b:fff9:ffff::4001;\\n  port-set {\\n    psid-length 0;\\n  }\\n}\\n\";\
  path \"/softwire-config/binding-table/softwire\";\
  schema snabb-softwire-v2;\
}\
"
     parse_reply = Lua function 'parse' (defined at line 44 of chunk lib/yang/rpc.lua)
(6) Lua field 'run' at file 'program/config/add/add.lua:10'
    Local variables:
     args = table: 0x419021e0  {path:/softwire-config/binding-table/softwire, format:yang, print_default:false (more...)}
     opts = table: 0x41901930  {with_value:true, command:add, with_path:true, is_config:true}
(7) Lua field 'run' at file 'program/config/config.lua:23'
    Local variables:
     args = table: 0x401b4e48  {1:-s, 2:snabb-softwire-v2, 3:lwaftr, 4:/softwire-config/binding-table/softwire (more...)}
     command = string: "add"
     modname = string: "program.config.add.add"
(8) Lua function 'main' at file 'core/main.lua:67' (best guess)
    Local variables:
     program = string: "config"
     args = table: 0x41311ca8  {1:add, 2:-s, 3:snabb-softwire-v2, 4:lwaftr, 5:/softwire-config/binding-table/softwire (more...)}
(9) global C function 'xpcall'
(10) main chunk of file 'core/main.lua' at line 242
(11)  C function 'require'
(12) global C function 'pcall'
(13) main chunk of file 'core/startup.lua' at line 3
(14) global C function 'require'
(15) main chunk of [string "require "core.startup""] at line 1
    nil

To trigger this error, I tried to add a file containing 64K softwires to a lwAFTR instance running with an initially empty binding-table. The error happened at softwire 5356.

How to reproduce:

$ sudo ./snabb lwaftr run --name lwaftr --conf empty-bt.conf
$ add-softwires lwaftr softwires.txt
Apply softwire 0
Apply softwire 1
Apply softwire 2
...

test.tar.gz