hi 春哥 & all:
今天在用 resty-rock 的时候发现在 lua_code_cache off 时出错
nginx.conf:
daemon off;
master_process off;
worker_processes 1;
error_log logs/error.log notice;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
keepalive_timeout 65;
lua_shared_dict my_locks 100k;
server {
listen 80;
lua_code_cache off;
location /t {
content_by_lua '
local lock = require "resty.lock"
local lock = lock:new("my_locks")
local elapsed, err = lock:lock("my_key")
ngx.say("lock: ", elapsed, ", ", err)
local ok, err = lock:unlock()
if not ok then
ngx.say("failed to unlock: ", err)
end
ngx.say("unlock: ", ok)
';
}
}
}
第一次访问 /t 的时候正常, 第二访问出错了,error.log:
nginx: lj_obj.h:793: copyTV: Assertion `!((((o1)->it) - ((~4u)+1)) > ((~13u) - ((~4u)+1))) || ((~((o1)->it) == (((GCobj *)(uintptr_t)((o1)->gcr).gcptr32))->gch.gct) && !(((((GCobj *)(uintptr_t)((o1)->gcr).gcptr32)))->gch.marked & ((((global_State *)(void *)(uintptr_t)(L->glref).ptr32))->gc.currentwhite ^ (0x01 | 0x02)) & (0x01 | 0x02)))' failed.
gdb 跟踪竟然没有 no stack
(gdb) c
Continuing.
Program received signal SIGABRT, Aborted.
0x00007f692e5d63e5 in raise () from /lib/x86_64-linux-gnu/libc.so.6
(gdb)
Continuing.
Program terminated with signal SIGABRT, Aborted.
The program no longer exists.
(gdb)
The program is not being run.
(gdb) bt full
No stack.
nginx -V :
nginx version: ngx_openresty/
1.4.2.9built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
TLS SNI support enabled
configure arguments: --prefix=/opt/openresty/nginx --with-debug --add-module=../ngx_devel_kit-0.2.19 --add-module=../iconv-nginx-module-0.10 --add-module=../echo-nginx-module-0.48 --add-module=../xss-nginx-module-0.03rc9 --add-module=../ngx_coolkit-0.2rc1 --add-module=../set-misc-nginx-module-0.22 --add-module=../form-input-nginx-module-0.07 --add-module=../encrypted-session-nginx-module-0.03 --add-module=../srcache-nginx-module-0.22 --add-module=../ngx_lua-0.9.0 --add-module=../headers-more-nginx-module-0.22 --add-module=../array-var-nginx-module-0.03rc1 --add-module=../memc-nginx-module-0.13 --add-module=../redis-nginx-module-0.3.6 --add-module=../auth-request-nginx-module-0.2 --add-module=../rds-json-nginx-module-0.12rc10 --add-module=../rds-csv-nginx-module-0.05rc2 --with-ld-opt=-Wl,-rpath,/opt/openresty/luajit/lib --with-http_geoip_module --with-http_ssl_module
uname -a:
Linux master 3.0.0-32-generic #50-Ubuntu SMP Thu Feb 28 22:32:30 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
麻烦春哥或哪位热心人帮忙,看看是不是个bug,还是我机器环境问题,最近给机器装了一些别的东东,有点乱~ 多谢~~