[Oisf-devel] Debugging LuaJIT
Nasir Bilal
bilalbox at gmail.com
Thu May 5 04:01:21 UTC 2016
Hey Devs!
This luajit feature is amazing, and has some very exciting possibilities!
One challenge though is the lack of visibility when testing out new
features.
Does anybody know where we can debug Lua errors for lua scripts called by
the suricata rules' luajit:scriptname.lua option? The
suricata --init-errors-fatal runtime option provides some basic validation,
but we miss some of the errors that occur at script runtime, such as when
requiring non-existent modules, e.g.:
*local myvar = requires 'fakemodule'*
should throw the following error =
*lua: myluascript.lua:1: module 'fakemodule' not found:*
*no field package.preload['fakemodule']*
....
However, when the script is referenced by a suricata rule, then suricata is
launced with the *--init-errors-fatal* option, suricata is fully launched
without errors. Furthermore, when the script is triggered by packets
matching said rule, the script silently fails, without any output. The only
way to know that it silently failed is that none of my
*debug_file:write(...)* were activated.
If there is a default log file, or a configuration option in *suricata.yaml* to
specify a log file to write lua errors and output to, I'd be much obliged
if someone could point it out.
Thanks all!
Nasir
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openinfosecfoundation.org/pipermail/oisf-devel/attachments/20160505/aba4756c/attachment.html>
More information about the Oisf-devel
mailing list