I found that the var 'ctx' is 0 in function 'ngx_http_lua_socket_tcp_send', but I cannot find why.
===============================
Core was generated by `nginx: worker'.
Program terminated with signal 11, Segmentation fault.
#0 ngx_http_lua_chain_get_free_buf (log=0x7ff6f4649920, p=0x7ff6f464bad0, free=0x108, len=415) at ../ngx_lua-0.10.7/src/ngx_http_lua_util.c:2702
warning: Source file is more recent than executable.
2702 if (*free) {
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.192.el6.x86_64 libgcc-4.4.7-18.el6.x86_64 nss-softokn-freebl-3.14.3-17.el6.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) bt full
#0 ngx_http_lua_chain_get_free_buf (log=0x7ff6f4649920, p=0x7ff6f464bad0, free=0x108, len=415) at ../ngx_lua-0.10.7/src/ngx_http_lua_util.c:2702
b =
cl =
start =
end =
#1 0x00000000004fbfb4 in ngx_http_lua_socket_tcp_send (L=0x456d3950) at ../ngx_lua-0.10.7/src/ngx_http_lua_socket_tcp.c:2424
rc =
p =
len = 415
cl =
ctx = 0x0
u = 0x40d05f28
type = 4
tcp_nodelay =
msg =
b =
c =
llcf =
clcf =
coctx =
#2 0x00007ff6f3b769ba in lj_BC_FUNCC () from .../openresty-1.11.2.2/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#3 0x00000000004eda80 in ngx_http_lua_run_thread (L=0x40cf3378, r=0x7ff6f464bb20, ctx=0x7ff6f464c870, nrets=1) at ../ngx_lua-0.10.7/src/ngx_http_lua_util.c:1005
next_coctx =
parent_coctx =
orig_coctx = 0x7ff6f464c898
rv =
success =
next_co =
old_co =
err =
msg =
trace =
rc =
old_pool = 0x0
#4 0x00000000004f6ef8 in ngx_http_lua_socket_tcp_resume_helper (r=0x7ff6f464bb20, socket_op=) at ../ngx_lua-0.10.7/src/ngx_http_lua_socket_tcp.c:5279
nret =
vm = 0x40cf3378
rc =
c = 0x7ff6a423c148
ctx = 0x7ff6f464c870
coctx =
prepare_retvals =
u =
#5 0x00000000004f89dc in ngx_http_lua_socket_handle_read_success (r=0x7ff6f464bb20, u=0x41f81e78) at ../ngx_lua-0.10.7/src/ngx_http_lua_socket_tcp.c:3062
coctx =
#6 ngx_http_lua_socket_tcp_read (r=0x7ff6f464bb20, u=0x41f81e78) at ../ngx_lua-0.10.7/src/ngx_http_lua_socket_tcp.c:2124
rc =
c = 0x7ff6a423bda8
b = 0x41f81f60
rev = 0x7ff6a40665b0
size =
n =
read = 1
preread =
#7 0x00000000004f6e30 in ngx_http_lua_socket_tcp_handler (ev=) at ../ngx_lua-0.10.7/src/ngx_http_lua_socket_tcp.c:2812
c = 0x7ff6a423c148
r =
ctx =
u =
#8 0x000000000046ac32 in ngx_event_process_posted (cycle=, posted=0x9be8e0) at src/event/ngx_event_posted.c:33
q =
ev =
#9 0x0000000000470f38 in ngx_worker_process_cycle (cycle=0x7ff6f4551b50, data=) at src/os/unix/ngx_process_cycle.c:753
worker =
#10 0x000000000046f577 in ngx_spawn_process (cycle=0x7ff6f4551b50, proc=0x470f00 <ngx_worker_process_cycle>, data="" name=0x69a5d5 "worker process", respawn=-3)
at src/os/unix/ngx_process.c:198
on = 1
pid = 0
s =
#11 0x000000000047043c in ngx_start_worker_processes (cycle=0x7ff6f4551b50, n=24, type=-3) at src/os/unix/ngx_process_cycle.c:358
i =
ch = {command = 1, pid = 9482, slot = 17, fd = 43}
#12 0x00000000004715b4 in ngx_master_process_cycle (cycle=0x7ff6f4551b50) at src/os/unix/ngx_process_cycle.c:130
title = 0x7ff6f458b76c "master process ./sbin/nginx"
p =
size = 28
i = 1
n =
sigio =
set = {__val = {0 <repeats 16 times>}}
itv = {it_interval = {tv_sec = 0, tv_usec = 140698637900648}, it_value = {tv_sec = 0, tv_usec = 140698638931744}}
live =
delay =
ls =
ccf = 0x7ff6f45537e8
#13 0x000000000044ee5f in main (argc=, argv=) at src/core/nginx.c:367
b =
log =
i =
cycle = 0x7ff6f4551b50
init_cycle = {conf_ctx = 0x0, pool = 0x7ff6f4550da0, log = 0x9a5140, new_log = {log_level = 0, file = 0x0, connection = 0, disk_full_time = 0, handler = 0,
data = "" writer = 0, wdata = 0x0, action = "" next = 0x0}, log_use_stderr = 0, files = 0x0, free_connections = 0x0, free_connection_n = 0,
modules = 0x0, modules_n = 0, modules_used = 0, reusable_connections_queue = {prev = 0x0, next = 0x0}, listening = {elts = 0x0, nelts = 0, size = 0,
nalloc = 0, pool = 0x0}, paths = {elts = 0x0, nelts = 0, size = 0, nalloc = 0, pool = 0x0}, config_dump = {elts = 0x0, nelts = 0, size = 0, nalloc = 0,
pool = 0x0}, open_files = {last = 0x0, part = {elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, shared_memory = {last = 0x0, part = {
elts = 0x0, nelts = 0, next = 0x0}, size = 0, nalloc = 0, pool = 0x0}, connection_n = 0, files_n = 0, connections = 0x0, read_events = 0x0,
write_events = 0x0, old_cycle = 0x0, conf_file = {len = 67, data = "" ""}, conf_param = {len = 0, data = "" conf_prefix = {len = 57,
data = "" ""}, prefix = {len = 52, data = "" "/opt/cloud/s3cdn-lua/build/openresty-1.11.2.2/nginx/"}, lock_file = {len = 0, data = "" style="box-sizing: border-box;">hostname = {len = 0, data = "" style="box-sizing: border-box;">cd =
ccf = 0x7ff6f45537e8