(gdb) bt full
#0 0x00007f755d3b6925 in raise () from /lib64/libc.so.6
No symbol table info available.
#1 0x00007f755d3b8105 in abort () from /lib64/libc.so.6
No symbol table info available.
#2 0x00007f755d3afa4e in __assert_fail_base () from /lib64/libc.so.6
No symbol table info available.
#3 0x00007f755d3afb10 in __assert_fail () from /lib64/libc.so.6
No symbol table info available.
#4 0x00007f755e63fa40 in debug_framepc (L=<value optimized out>,
fn=<value optimized out>, nextframe=<value optimized out>)
at lj_debug.c:103
T = <value optimized out>
ins = <value optimized out>
pos = <value optimized out>
__PRETTY_FUNCTION__ = "debug_framepc"
#5 0x00007f755e63fa49 in debug_frameline (L=<value optimized out>,
fn=0x41a66fc0, nextframe=<value optimized out>) at lj_debug.c:133
pc = <value optimized out>
__PRETTY_FUNCTION__ = "debug_frameline"
#6 0x00007f755e64130b in lj_debug_addloc (L=0x46b362a8,
msg=0x430a4b10 "attempt to index a nil value",
frame=<value optimized out>, nextframe=<value optimized out>)
at lj_debug.c:356
line = <value optimized out>
fn = 0x41a66fc0
__PRETTY_FUNCTION__ = "lj_debug_addloc"
#7 0x00007f755e63af4a in err_msgv (L=0x46b362a8, em=<value optimized out>)
at lj_err.c:579
msg = <value optimized out>
argp = {{gp_offset = 32, fp_offset = 48,
overflow_arg_area = 0x7ffffee86900,
reg_save_area = 0x7ffffee86840}}
#8 0x00007f755e63b0a5 in lj_err_optype (L=0x46b362a8,
o=<value optimized out>, opm=<value optimized out>) at lj_err.c:616
tname = 0x7f755e69eb17 "nil"
opname = 0x7f755e69da23 "index"
#9 0x00007f755e63f746 in lj_meta_tget (L=0x46b362a8, o=0x451dfbb0,
k=0x7ffffee86970) at lj_meta.c:141
mo = 0x0
loop = <value optimized out>
#10 0x00007f755e6368a1 in lj_vmeta_tgetv ()
from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
No symbol table info available.
#11 0x00000000004ab97a in ngx_http_lua_run_thread (L=0x4128e378, r=0x111d500,
ctx=0x1121688, nrets=1) at ../ngx_lua-0.9.7/src/ngx_http_lua_util.c:1105
next_coctx = <value optimized out>
parent_coctx = <value optimized out>
orig_coctx = 0x11216b0
rv = <value optimized out>
success = <value optimized out>
next_co = <value optimized out>
old_co = <value optimized out>
err = <value optimized out>
msg = <value optimized out>
trace = <value optimized out>
rc = <value optimized out>
old_pool = 0x0
#12 0x00000000004b45b4 in ngx_http_lua_socket_tcp_resume (r=0x111d500)
at ../ngx_lua-0.9.7/src/ngx_http_lua_socket_tcp.c:4316
nret = <value optimized out>
vm = 0x4128e378
rc = <value optimized out>
c = 0x7f755ab0cbe0
ctx = 0x1121688
coctx = <value optimized out>
u = <value optimized out>
#13 0x00000000004ae02b in ngx_http_lua_content_wev_handler (
r=<value optimized out>)
at ../ngx_lua-0.9.7/src/ngx_http_lua_contentby.c:128
No locals.
#14 0x00000000004b44b1 in ngx_http_lua_socket_handle_success (r=0x111d500,
u=<value optimized out>)
at ../ngx_lua-0.9.7/src/ngx_http_lua_socket_tcp.c:2333
ctx = <value optimized out>
coctx = <value optimized out>
__PRETTY_FUNCTION__ = "ngx_http_lua_socket_handle_success"
#15 0x00000000004b82e6 in ngx_http_lua_socket_tcp_read (r=0x111d500,
u=0x4579d378) at ../ngx_lua-0.9.7/src/ngx_http_lua_socket_tcp.c:1515
rc = <value optimized out>
c = 0x7f755ab0cb08
b = 0x4579d450
rev = 0x7f755a903558
size = <value optimized out>
n = <value optimized out>
read = 1
preread = <value optimized out>
llcf = <value optimized out>
#16 0x00000000004b93c1 in ngx_http_lua_socket_read_handler (r=0x111d500,
u=0x4579d378) at ../ngx_lua-0.9.7/src/ngx_http_lua_socket_tcp.c:2169
c = <value optimized out>
#17 0x00000000004b42a6 in ngx_http_lua_socket_tcp_handler (ev=0x7f755a903558)
at ../ngx_lua-0.9.7/src/ngx_http_lua_socket_tcp.c:2121
c = 0x7f755ab0cbe0
r = 0x111d500
ctx = <value optimized out>
u = 0x4579d378
#18 0x0000000000437397 in ngx_epoll_process_events (cycle=0x10dd7b0,
timer=<value optimized out>, flags=<value optimized out>)
at src/event/modules/ngx_epoll_module.c:691
events = 4
revents = 5
instance = <value optimized out>
i = <value optimized out>
level = <value optimized out>
err = <value optimized out>
rev = 0x7f755a903558
wev = <value optimized out>
queue = <value optimized out>
c = 0x7f755ab0cb08
#19 0x000000000042ed23 in ngx_process_events_and_timers (cycle=0x10dd7b0)
at src/event/ngx_event.c:248
flags = 1
timer = 500
delta = 1397107393325
#20 0x0000000000435bde in ngx_worker_process_cycle (cycle=0x10dd7b0,
data="" optimized out>) at src/os/unix/ngx_process_cycle.c:816
worker = <value optimized out>
i = <value optimized out>
c = <value optimized out>
#21 0x00000000004342fc in ngx_spawn_process (cycle=0x10dd7b0,
proc=0x435ae8 <ngx_worker_process_cycle>, data="">
name=0x4d952b "worker process", respawn=-3)
at src/os/unix/ngx_process.c:198
on = 1
pid = 0
s = 2
#22 0x0000000000434fea in ngx_start_worker_processes (cycle=0x10dd7b0, n=3,
type=-3) at src/os/unix/ngx_process_cycle.c:364
i = <value optimized out>
ch = {command = 1, pid = 7720, slot = 1, fd = 8}
#23 0x000000000043625f in ngx_master_process_cycle (cycle=0x10dd7b0)
at src/os/unix/ngx_process_cycle.c:136
title = 0x10ff3ac "master process /usr/local/openresty/nginx/sbin/nginx -c /usr/local/openresty/nginx/conf/nginx.queue.conf"
p = <value optimized out>
size = 105
i = 3
n = <value optimized out>
sigio = <value optimized out>
set = {__val = {0 <repeats 16 times>}}
itv = {it_interval = {tv_sec = 17822440, tv_usec = 0}, it_value = {
tv_sec = 0, tv_usec = 0}}
live = <value optimized out>
delay = <value optimized out>
ls = <value optimized out>
ccf = 0x10de7e0
#24 0x0000000000418deb in main (argc=<value optimized out>,
argv=<value optimized out>) at src/core/nginx.c:407
i = <value optimized out>
log = 0x71eb20
cycle = 0x10dd7b0
init_cycle = {conf_ctx = 0x0, pool = 0x10dc9e0, log = 0x71eb20,
new_log = {log_level = 0, file = 0x0, connection = 0, handler = 0,
data = "" action = "" next = 0x0}, log_use_stderr = 0,
files = 0x0, free_connections = 0x0, free_connection_n = 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},
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 = 48, data = "" ""},
conf_param = {len = 0, data = "" conf_prefix = {len = 32,
data = "" ""}, prefix = {len = 27,
data = "" "/usr/local/openresty/nginx/"}, lock_file = {
len = 0, data = "" hostname = {len = 0, data = "">
ccf = <value optimized out>
在 2014年4月10日星期四UTC+8下午1时06分26秒,agentzh写道:
Hello!
On Wed, Apr 9, 2014 at 9:48 PM, 秦晋 wrote:
> (gdb) where
> #0 0x00007f280016c8ce in lj_debug_funcname (L=0x45c5efa8,
> frame=<value optimized out>, name=0x7fff20b466a8) at lj_debug.c:303
> #1 0x00007f280016d191 in lj_debug_getinfo (L=0x45c5efa8, what=0x4d4d98
> "nl",
另外,请在 gdb 里面使用 bt full 命令得到更加完整的 C 调用栈(包含各函数帧里的局部变量的值)。另外建议你使用
./configure --with-debug 重新编译 openresty. 这样我们可以看到更完整的 C 调试信息,同时也可以启用
LuaJIT 的内部断言检查。
多谢!
Regards,
-agentzh