You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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]
上面这段代码在 curl -k -L "http://192.168.137.70/lua?ip=111.47.224.182&node=subdivisions" 出现异常了
Originally posted by @zhannk in #5 (comment)
The text was updated successfully, but these errors were encountered: