Closed algtm closed 5 years ago
i fix this problem by use operesty with lua5.1 not luajit
@vulntor, thank you for the update. I'd still be interested to know why it changed the result, as in this there shouldn't be much difference between lua5.1 and luajit. From the output you are showing, it looked like the debugging has started and then aborted after an error in the application. Were there any errors from luajit in nginx logs? Maybe there was some conflict with jit being set "on" by nginx and then set "off" by the debugger to make debug hooks to work properly?
@pkulchenko There are no error info in nginx log.But I use printlog to find that coro_debugger = corocreate(debugger_loop)
not work in openresty's lua2 .Follow the stack and i find var ngx
was set to nil after local ngx = type(metagindex) == "table" and metagindex.rawget and metagindex:rawget("ngx") or nil
In windows openresty use lua5.1 by default so I think this different is because mobdebug not support the special version luajit in openresty official install for linux. Then I build Nginx with lua5.1/luajit2.0.5/luajit2.1 beta3 and they all work well.
It seems Openresty use a luajit designed for openresty only because I saw this warning:
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
@vulntor, interesting; thank you for the update. I wonder why the value of ngx
is nil
though in mobdebug.
Can you check the previous line (local metagindex = getmetatable(genv) and getmetatable(genv).__index
) to see if there is indeed a metatable on _G
and if there is, is it missing it's __index
value or if ngx
is not present there? Thanks!
@pkulchenko I am sorry I can't spend much on this. I am not very familiar with Lua. It's easy to Reproduce by install latest openresty.
np; thanks for letting me know. I'll close the ticket, since you found a solution and will take a look when I get a chance.
I follow the official guide to install openresty1.15 with apt in ubuntu18/16 and install zbs with bash 。 And follow this guide: to debug openresty But it shows error on serverside:
/usr/local/openresty/nginx/lua/content.lua
zbs project path /usr/local/openresty/nginx/lua/
nginx.conf
I have tried to change the system to centos7、ub16 and windows. Only windows work(all debug is local). But the lib I want to debug only support linux orz.