inters/vita

Testing interlink app

raj2569 opened this issue · 4 comments

Hello,

This is not a vita related bug, but posting it here as interlink code has not yet been integrated.

I have moved the two test apps from apps/interlink/ to a new location under program named testmp, edited the require line in test.lua and ran it as sudo ./snabb testmp. The program runs fine and I can see traffic in the links whenI check using snabb top, and it prints the link report.

But after the link report is printed I get a Stack Traceback: The whole sequence is as follows:

$ sudo ./snabb testmp
link report:
         240,624,351 sent on rx.output -> sink.input (loss rate: 0%)
worker source: pid=9906 alive=true status=0
24.0624351 Mpps
core/main.lua:73: attempt to index a boolean value

Stack Traceback
===============
(1) Lua metamethod '__index' at file 'core/main.lua:177'
        Local variables:
         reason = string: "core/main.lua:73: attempt to index a boolean value"
         (*temporary) = C function: print
(2) Lua function 'main' at file 'core/main.lua:73' (best guess)
        Local variables:
         program = string: "testmp"
         args = table: 0x40b07d80  {}
         (*temporary) = boolean: true
         (*temporary) = string: "program.testmp.testmp"
         (*temporary) = table: 0x40a6bb88  {core.counter_h:table: 0x40402070, syscall.types:table: 0x401a4238, ffi:table: 0x40a7b030 (more...)}
         (*temporary) = nil
         (*temporary) = table: 0x40a6ccc0  {1:function: 0x40a6cd10, 2:function: 0x40a6cd38, 3:function: 0x40a6cd60 (more...)}
         (*temporary) = string: ""
         (*temporary) = string: "attempt to index a boolean value"
(3) global C function 'xpcall'
(4) main chunk of file 'core/main.lua' at line 239
(5)  C function 'require'
(6) global C function 'pcall'
(7) main chunk of file 'core/startup.lua' at line 3
(8) global C function 'require'
(9) main chunk of [string "require "core.startup""] at line 1
        nil

core/main.lua:73 is the line require(modulename(program)).run(args)

     -- Choose a program based on the command line                                                                        
      local program, args = select_program(parse_command_line())
      if not lib.have_module(modulename(program)) then
         print("unsupported program: "..program:gsub("_", "-"))
         usage(1)
      else
         engine.setvmprofile('program')
         vmprofile.start()
         require(modulename(program)).run(args)
      end

Doesn’t look like apps/interlink has anything to do with the error, this is how the interlink test is supposed to be run:

sudo ./snabb snsh apps/interlink/test.lua

I should rename apps/interlink/test.lua to test.snabb to make it clear that its a snabb script.

Should any thing special be done to make interlink run on a snabb program with run() ? Any caveats I should be taking care of?

The error basically says that require(modulename(program)) returned a boolean. Maybe its this line in test.lua that causes problems:

worker.start("source",
             [[require("apps.interlink.test_source").start("group/test.mcp")]])

I.e., does the module apps.interlink.test_source exist in your test scenario?

By the way, why are you trying to run that test as program anyway?

Yes, apps.interlink.test_source does exist. I have copied the apps/interlink/* and lib/interlink.lua into Snabb to test. Also if that does not exist, should it not return nil rather than a boolean?

I am trying to run it as a program to integrate interlink in to my snabb application. Basically I am looking to run two different apps into different CPUs