lua-nginx-module
lua-nginx-module copied to clipboard
Nginx - Worker Process Crash (Lua Parser)
I'm trying to understand why the worker processes are crashing:
2023/02/23 17:48:49 [alert] 12431#0: worker process 12433 exited on signal 11 2023/02/23 17:48:49 [alert] 12431#0: cache manager process 12434 exited on signal 11 2023/02/23 17:48:49 [alert] 12431#0: cache loader process 12435 exited on signal 11 2023/02/23 17:48:49 [alert] 12431#0: worker process 12432 exited on signal 11 2023/02/23 17:48:49 [alert] 12431#0: worker process 12436 exited on signal 11
nginx version: nginx/1.22.0 lua-nginx-module-0.10.9rc7 ngx_devel_kit-0.3.1
http {
lua_package_cpath "/usr/local/src/lua-cjson-2.1.0/?.so;;";
init_by_lua_block { cjson = require "cjson" -- cjson2 = cjson.new() }
init_worker_by_lua_block {
}
} open the init_worker_by_lua_block tag ,when restart nginx. then nginx work crash
root 7225 1 0 Feb23 ? 00:00:06 nginx: master process /usr/local/nginx/sbin/nginx
root 8215 7225 0 09:20 ? 00:00:00 [nginx]
root 8216 7225 0 09:20 ? 00:00:00 [nginx]
(gdb) bt
#0 0x0000000000481fb0 in ngx_http_core_create_srv_conf (cf=0x7ffee96837a0) at src/http/ngx_http_core_module.c:3377
#1 0x000000000051383c in ngx_http_lua_init_worker (cycle=0x25e7220) at /usr/local/src/lua-nginx-module-0.10.9rc7/src/ngx_http_lua_initworkerby.c:172
#2 0x0000000000473109 in ngx_worker_process_init (cycle=cycle@entry=0x25e7220, worker=
can you provide the gdb backtrace of the crash?
can you provide the gdb backtrace of the crash?
[nginx-1.22.0]# gdb /usr/local/nginx/sbin/nginx /tmp/core.1464 GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-120.el7 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /usr/local/nginx/sbin/nginx...done. [New LWP 1464] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `nginx: master process /usr/l'. Program terminated with signal 11, Segmentation fault. #0 0x00000000004a845e in ngx_http_core_create_srv_conf (cf=0x7fff8b0bc7b0) at src/http/ngx_http_core_module.c:3377 3377 cscf->file_name = cf->conf_file->file.name.data; Missing separate debuginfos, use: debuginfo-install glibc-2.17-222.el7.x86_64 glibc-2.17-317.el7.x86_64 libgcc-4.8.5-39.el7.x86_64 libgcc-4.8.5-44.el7.x86_64 nss-softokn-freebl-3.36.0-5.el7_5.x86_64 nss-softokn-freebl-3.53.1-6.el7_9.x86_64 (gdb) bt #0 0x00000000004a845e in ngx_http_core_create_srv_conf (cf=0x7fff8b0bc7b0) at src/http/ngx_http_core_module.c:3377 #1 0x000000000058e40b in ngx_http_lua_init_worker (cycle=0x10ef240) at /usr/local/src/lua-nginx-module-0.10.9rc7/src/ngx_http_lua_initworkerby.c:172 #2 0x000000000048eb14 in ngx_worker_process_init (cycle=0x10ef240, worker=0) at src/os/unix/ngx_process_cycle.c:902 #3 0x000000000048e255 in ngx_worker_process_cycle (cycle=0x10ef240, data=0x0) at src/os/unix/ngx_process_cycle.c:706 #4 0x000000000048b38e in ngx_spawn_process (cycle=0x10ef240, proc=0x48e214 <ngx_worker_process_cycle>, data=0x0, name=0x752d87 "worker process", respawn=-3) at src/os/unix/ngx_process.c:199 #5 0x000000000048d608 in ngx_start_worker_processes (cycle=0x10ef240, n=2, type=-3) at src/os/unix/ngx_process_cycle.c:344 #6 0x000000000048ce4f in ngx_master_process_cycle (cycle=0x10ef240) at src/os/unix/ngx_process_cycle.c:130 #7 0x000000000044d250 in main (argc=1, argv=0x7fff8b0bcf48) at src/core/nginx.c:383 (gdb) f 1 #1 0x000000000058e40b in ngx_http_lua_init_worker (cycle=0x10ef240) at /usr/local/src/lua-nginx-module-0.10.9rc7/src/ngx_http_lua_initworkerby.c:172 172 cur = module->create_srv_conf(&conf); (gdb) info locals rv = 0x0 cur = 0x300000001 prev = 0x45123 i = 9 conf = {name = 0x0, args = 0x0, cycle = 0x24bbb70, pool = 0x10ef1f0, temp_pool = 0x1d7dfd0, conf_file = 0x0, log = 0x10ef258, ctx = 0x7fff8b0bc790, module_type = 0, cmd_type = 0, handler = 0x0, handler_conf = 0x0} fake_cycle = 0x24bbb70 modules = 0x10f0b18 file = 0x1d70f68 ofile = 0x16620a0 part = 0x1662088 c = 0x0 module = 0xa4d280 <ngx_http_core_module_ctx> r = 0x0 ctx = 0x0 conf_ctx = 0x1127058 http_ctx = {main_conf = 0x1127070, srv_conf = 0x1d71188, loc_conf = 0x1d70fe8} top_llcf = 0x11299b0 lmcf = 0x1129800 clcf = 0x0 top_clcf = 0x11278b8