Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ngx-sample-lua-bt fails to figure out lua_path #17

Open
zharan opened this issue Oct 27, 2014 · 3 comments
Open

ngx-sample-lua-bt fails to figure out lua_path #17

zharan opened this issue Oct 27, 2014 · 3 comments

Comments

@zharan
Copy link

zharan commented Oct 27, 2014

Hi,

I'm using the latest version of nginx-systemtap-toolkit under Ubuntu 14.04.1 LTS (server type) for optimizing performance of Lua code running on Nginx (built with lua-nginx-module). I tried to run ngx-sample-lua-bt script, but it exited with the following problem:

semantic error: while resolving probe point: identifier 'process' at <input>:12:7
        source: probe process("/home/andriy/nginx-1.7.6/objs/nginx").function ("lua_resume"),
                         ^
semantic error: no match (similar functions: lua_resume, lua_remove, lua_replace, luaL_gsub, luaL_ref)

To me it looked like code inside ngx-sample-lua-bt script couldn't figure out value for the lua_path variable by parsing contents of /proc/[pid]/maps. I did a quick hack:

if (!defined $lua_path) {
    #warn "FALL BACK TO NGINX PATH";
    #$lua_path = $nginx_path;
    $lua_path = "/usr/lib/x86_64-linux-gnu/liblua5.1.so.0.0.0";
}

And after that ngx-sample-lua-bt stopped failing. What should be a proper fix for that problem?

agentzh added a commit that referenced this issue Oct 27, 2014
@agentzh
Copy link
Member

agentzh commented Oct 27, 2014

@zharan Thank you for the report! Just committed a fix the git master. Will you try it out?

BTW, it's recommended to use LuaJIT 2 for maximal performance :)

@zharan
Copy link
Author

zharan commented Oct 27, 2014

The fix helped, thanks! Yeah, I'll definitely try out LuaJIT 2, thanks for advice.

agentzh added a commit that referenced this issue Oct 27, 2014
… avoid aborting sampling. thanks zharan for the report in #17.
@zharan
Copy link
Author

zharan commented Oct 28, 2014

Oh, I probably bumbed into the problem described in this issue, because I didn't create this symlink:

ln -s /usr/lib/x86_64-linux-gnu/liblua5.1.so /usr/lib/liblua.so

as it was described in https://github.com/openresty/lua-nginx-module/#installation-on-ubuntu-1110.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants