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

segfault #13

Closed
anjia0532 opened this issue Dec 7, 2018 · 2 comments
Closed

segfault #13

anjia0532 opened this issue Dec 7, 2018 · 2 comments

Comments

@anjia0532
Copy link
Owner

local cjson=require 'cjson'
local geo=require 'resty.maxminddb'

local arg_ip=ngx.var.arg_ip
local arg_node=ngx.var.arg_node

ngx.say("IP:",arg_ip,", Node:",arg_node,"<br>")

if not geo.initted() then
        geo.init("/usr/local/openresty/nginx/conf/lua/GeoLite2-City.mmdb")
end



local res,err=geo.lookup(arg_ip or ngx.var.remote_addr)


if not res then
        ngx.say("Please check the ip address you provided: <div style='color:red'>",arg_ip,"</div>")
        ngx.log(ngx.ERR,' failed to lookup by ip , reason :',err)
else
        ngx.say("Result:",cjson.encode(res))

        if arg_node then
                ngx.say("<br>Node name:",arg_node, "<br>Value:",cjson.encode(res[arg_node] or {}))

        end



--      ngx.say(cjson.encode(res['country']))
--      ngx.say(cjson.encode(res['city']['names']['zh-CN']))

end

上面这段代码在 curl -k -L "http://192.168.137.70/lua?ip=111.47.224.182&node=subdivisions" 出现异常了

2018/12/07 15:51:23 [alert] 6466#0: worker process 13218 exited on signal 11
dmesg显示:
[24198.721511] openresty[12676]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24356.262054] openresty[13125]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24417.535463] openresty[13486]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24605.925152] openresty[13030]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24742.409458] traps: openresty[13355] trap stack segment ip:7f3b320e88e0 sp:7ffc488d6700 error:0 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24768.654847] openresty[13453]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24875.143743] traps: openresty[13602] trap stack segment ip:7f3b320e88e0 sp:7ffc488d6700 error:0 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24978.362300] openresty[13628]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24985.536349] openresty[13495]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24986.341160] openresty[13541]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[24987.163714] openresty[13677]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[25053.506562] openresty[13683]: segfault at 7b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]
[27040.935473] openresty[13218]: segfault at 5b ip 00007f3b320e7e45 sp 00007ffc488d6718 error 4 in libmaxminddb.so.0.0.7[7f3b320e5000+5000]

Originally posted by @zhannk in #5 (comment)

@anjia0532
Copy link
Owner Author

anjia0532 commented Dec 7, 2018

@anjia0532
Copy link
Owner Author

试试升级到v1.2.0

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

1 participant