I use openresty application, and I use pstack command to see openresty stack. I found sometimes I can see full stack, just like this case one, But sometimes I only see part stack,and the pre c frame stack is "in ?? ()", just like the case two and case three. Why sometimes stack is not complete, and why is start with "in ?? ()" and not start with "in main".
case one:
sh-4.2# pstack 49687
#0 0x0000ffffa549d704 in gc_traverse_tab (t=0x1e4b685ad4a0, g=0x1e4b528203f0) at lj_gc.c:206
#1 propagatemark (g=0x1e4b528203f0) at lj_gc.c:323
#2 0x0000ffffa549de30 in gc_onestep (L=L@entry=0x1e4b68a7eaa8) at lj_gc.c:653
#3 0x0000ffffa549e348 in lj_gc_step (L=L@entry=0x1e4b68a7eaa8) at lj_gc.c:726
#4 0x0000ffffa54df81c in carith_ptr (mm=<optimized out>, ca=<optimized out>, cts=<optimized out>, L=<optimized out>) at lj_carith.c:153
#5 lj_carith_op (L=0x1e4b68a7eaa8, mm=<optimized out>) at lj_carith.c:271
#6 0x0000ffffa549b1f8 in lj_BC_FUNCC () from /usr/local/openresty/luajit/lib/libluajit-5.1.so.2
#7 0x00000000004f8f58 in ngx_http_lua_run_thread (L=L@entry=0x1e4b52820380, r=r@entry=0xffff6612f060, ctx=ctx@entry=0xffff684cf020, nrets=nrets@entry=0) at ../ngx_lua-0.10.19/src/ngx_http_lua_util.c:1167
#8 0x00000000004fcabc in ngx_http_lua_rewrite_by_chunk (L=L@entry=0x1e4b52820380, r=r@entry=0xffff6612f060) at ../ngx_lua-0.10.19/src/ngx_http_lua_rewriteby.c:344
#9 0x00000000004fd138 in ngx_http_lua_rewrite_handler_file (r=0xffff6612f060) at ../ngx_lua-0.10.19/src/ngx_http_lua_rewriteby.c:230
#10 0x00000000004fccdc in ngx_http_lua_rewrite_handler (r=0xffff6612f060) at ../ngx_lua-0.10.19/src/ngx_http_lua_rewriteby.c:162
#11 0x0000000000467bfc in ngx_http_core_rewrite_phase (r=0xffff6612f060, ph=<optimized out>) at src/http/ngx_http_core_module.c:1176
#12 0x00000000004637fc in ngx_http_core_run_phases (r=r@entry=0xffff6612f060) at src/http/ngx_http_core_module.c:1117
#13 0x00000000004638d0 in ngx_http_handler (r=r@entry=0xffff6612f060) at src/http/ngx_http_core_module.c:1100
#14 0x000000000046e750 in ngx_http_process_request (r=r@entry=0xffff6612f060) at src/http/ngx_http_request.c:2424
#15 0x000000000046ec90 in ngx_http_process_request_headers (rev=rev@entry=0xfffae336acb8) at src/http/ngx_http_request.c:1754
#16 0x000000000046ef98 in ngx_http_process_request_line (rev=0xfffae336acb8) at src/http/ngx_http_request.c:1425
#17 0x00000000004562b8 in ngx_epoll_process_events (cycle=<optimized out>, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:925
#18 0x000000000044bbe0 in ngx_process_events_and_timers (cycle=cycle@entry=0xfffadf99c060) at src/event/ngx_event.c:270
#19 0x000000000045351c in ngx_worker_process_cycle (cycle=0xfffadf99c060, data=<optimized out>) at src/os/unix/ngx_process_cycle.c:995
#20 0x0000000000451ca8 in ngx_spawn_process (cycle=cycle@entry=0xfffadf99c060, proc=proc@entry=0x453460 <ngx_worker_process_cycle>, data=data@entry=0xd, name=name@entry=0x5c8510 "worker process", respawn=respawn@entry=-4) at src/os/unix/ngx_process.c:200
#21 0x0000000000453e58 in ngx_start_worker_processes (cycle=cycle@entry=0xfffadf99c060, n=64, type=type@entry=-4) at src/os/unix/ngx_process_cycle.c:433
#22 0x000000000045529c in ngx_master_process_cycle (cycle=0xfffadf99c060, cycle@entry=0xffff60274060) at src/os/unix/ngx_process_cycle.c:278
#23 0x000000000042b580 in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:402
case two:
sh-4.2# pstack 49687
#0 0x0000ffffa4ee8d28 in memcpy () from /lib64/libc.so.6
#1 0x0000ffffa549f8c0 in lj_buf_wmem (len=39, q=0x1e4b6894feb8, p=<optimized out>) at lj_buf.h:75
#2 lj_buf_putstr (sb=0x1e4b528204b8, s=0x1e4b6894fea0) at lj_buf.c:92
#3 0x0000ffffa6bbc818 in ?? ()
case three:
sh-4.2# pstack 49687
#0 0x0000ffffa5383284 in match () from /lib64/libpcre.so.1
#1 0x0000ffffa538fc6c in pcre_exec () from /lib64/libpcre.so.1
#2 0x00000000004f1a18 in ngx_http_lua_ffi_exec_regex (re=<optimized out>, flags=<optimized out>, s=<optimized out>, len=<optimized out>, pos=<optimized out>) at ../ngx_lua-0.10.19/src/ngx_http_lua_regex.c:432
#3 0x0000ffffa6ba540c in ?? ()