log_by_lua coredump, 偶发, 不可复现, 请问可能是什么原因导致的呀

35 views
Skip to first unread message

acyouzi

unread,
Sep 15, 2022, 8:55:56 AM9/15/22
to openresty
code 

        log_by_lua '
          local service = "nginx_query_ui"
          metric_requests:inc(1, {service, ngx.var.status})
        ';

--- 
(gdb)
#0  0x00007f58d8ecec90 in strlen@plt () from /home/xiaoju/openresty/luajit/lib/libluajit-5.1.so.2
#1  0x00007f58d8ee435e in lua_getfield (L=L@entry=0x40c33378, idx=idx@entry=-1,
    k=k@entry=0x123c5a0 "=log_by_lua(monitor.odin.xiaojukeji.com.conf:491)") at lj_api.c:800
#2  0x00000000004e84a3 in ngx_http_lua_cache_load_code (log=log@entry=0x158f750, L=L@entry=0x40c33378,
    key=key@entry=0x123c5a0 "=log_by_lua(monitor.odin.xiaojukeji.com.conf:491)") at ../ngx_lua-0.10.13/src/ngx_http_lua_cache.c:52
#3  0x00000000004e862b in ngx_http_lua_cache_loadbuffer (log=0x158f750, L=L@entry=0x40c33378,
    src=0x123c4b3 "\n          local service = \"nginx_query_api\"\n          metric_requests:inc(1, {service, ngx.var.status})\n        ",
    src_len=113, cache_key=0x123c5a0 "=log_by_lua(monitor.odin.xiaojukeji.com.conf:491)",
    name=0x123c528 "=log_by_lua(monitor.odin.xiaojukeji.com.conf:491)") at ../ngx_lua-0.10.13/src/ngx_http_lua_cache.c:148
#4  0x00000000004f94ec in ngx_http_lua_log_handler_inline (r=0x158d0f0) at ../ngx_lua-0.10.13/src/ngx_http_lua_logby.c:153
#5  0x00000000004f926c in ngx_http_lua_log_handler (r=0x158d0f0) at ../ngx_lua-0.10.13/src/ngx_http_lua_logby.c:135
#6  0x000000000045cf10 in ngx_http_log_request (r=r@entry=0x158d0f0) at src/http/ngx_http_request.c:3569
#7  0x000000000045e9c2 in ngx_http_free_request (r=r@entry=0x158d0f0, rc=rc@entry=0) at src/http/ngx_http_request.c:3516
#8  0x000000000045eb73 in ngx_http_close_request (rc=rc@entry=0, r=0x158d0f0) at src/http/ngx_http_request.c:3463
#9  0x000000000045f096 in ngx_http_lingering_close_handler (rev=0x7f58b5548c70) at src/http/ngx_http_request.c:3330
#10 0x000000000044a159 in ngx_epoll_process_events (cycle=0x11c8f30, timer=<optimized out>, flags=<optimized out>)
    at src/event/modules/ngx_epoll_module.c:902
#11 0x000000000043ff4c in ngx_process_events_and_timers (cycle=cycle@entry=0x11c8f30) at src/event/ngx_event.c:252
#12 0x0000000000447b65 in ngx_worker_process_cycle (cycle=cycle@entry=0x11c8f30, data=data@entry=0x12) at src/os/unix/ngx_process_cycle.c:820
#13 0x0000000000446610 in ngx_spawn_process (cycle=cycle@entry=0x11c8f30, proc=proc@entry=0x447b20 <ngx_worker_process_cycle>, data=data@entry=0x12,
    name=name@entry=0x54922d "worker process", respawn=respawn@entry=-4) at src/os/unix/ngx_process.c:198
#14 0x0000000000447ef4 in ngx_start_worker_processes (cycle=cycle@entry=0x11c8f30, n=40, type=type@entry=-4) at src/os/unix/ngx_process_cycle.c:396
#15 0x0000000000448f24 in ngx_master_process_cycle (cycle=cycle@entry=0x11c8f30) at src/os/unix/ngx_process_cycle.c:250
#16 0x000000000041ee98 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:384

--- 
./nginx -v
nginx version: openresty/1.13.6.2

--- 
./nginx -V
nginx version: openresty/1.13.6.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)
built with OpenSSL 1.0.1e-fips 11 Feb 2013
TLS SNI support enabled
configure arguments: --prefix=/home/xiaoju/openresty/nginx --with-debug --with-cc-opt='-DNGX_LUA_USE_ASSERT -DNGX_LUA_ABORT_AT_PANIC -O2' --add-module=../ngx_devel_kit-0.3.0 --add-module=../echo-nginx-module-0.61 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2rc3 --add-module=../set-misc-nginx-module-0.32 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.08 --add-module=../srcache-nginx-module-0.31 --add-module=../ngx_lua-0.10.13 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.33 --add-module=../array-var-nginx-module-0.05 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.7 --add-module=../rds-json-nginx-module-0.15 --add-module=../rds-csv-nginx-module-0.09 --add-module=../ngx_stream_lua-0.0.5 --with-ld-opt=-Wl,-rpath,/home/xiaoju/openresty/luajit/lib --with-pcre --with-http_gunzip_module --with-http_gzip_static_module --with-http_realip_module --with-stream --with-stream_ssl_module --with-http_ssl_module

Junlong li

unread,
Sep 18, 2022, 9:23:56 PM9/18/22
to openresty
最好是升级到1.19.9的版本。你这个版本太老了,说不定已经解决过了。
Reply all
Reply to author
Forward
0 new messages