openresty luajit coredump

127 views
Skip to first unread message

louiv...@gmail.com

unread,
Jul 7, 2021, 10:55:30 PM7/7/21
to openresty

大家好:
最近更新了openresty 1.19.3.1,自己加了一些patch和c module。灰度流量不定时的会出现coredump。 通过gdb查看coredump文件,c代码调用栈都是挂在luajit里,lua代码栈每次都是挂在lua函数调用的时候,该lua代码在openresty老版本跑不会core掉。怀疑是不是c代码内存越界把lua栈覆盖了?

```
Core was generated by `nginx: worker process                                                         '.
Program terminated with signal 11, Segmentation fault.
#0  0x000000003e1a8794 in ?? ()

...

(gdb) bt
#0  0x000000003e1a8794 in ?? ()
#1  0x0000000041412380 in ?? ()
#2  0x000000000069abdd in lj_vmeta_tgetv () at buildvm_x86.dasc:1295
#3  0x0000000000670e98 in lua_pcall (L=0x41412380, nargs=0, nresults=1, errfunc=1) at lj_api.c:1169
#4  0x00000000005c7f36 in ngx_http_lua_header_filter_by_chunk (L=0x41412380, r=0x35803110)
    at ../ngx_lua-0.10.19/src/ngx_http_lua_headerfilterby.c:101
#5  0x00000000005c8272 in ngx_http_lua_header_filter_file (r=0x35803110) at ../ngx_lua-0.10.19/src/ngx_http_lua_headerfilterby.c:223
#6  0x00000000005c840a in ngx_http_lua_header_filter (r=0x35803110) at ../ngx_lua-0.10.19/src/ngx_http_lua_headerfilterby.c:276
#7  0x00000000005254ef in ngx_http_not_modified_header_filter (r=0x35803110)
    at src/http/modules/ngx_http_not_modified_filter_module.c:61

...

(gdb) lbt full
@//export/Data/jenkins/workspace/jdlbproduct.jfe.release-core.219318/output/lualib/lua-resty-anti/resty/anti/filter.lua:412
@//export/Data/jenkins/workspace/jdlbproduct.jfe.release-core.219318/output/lualib/lua-resty-anti/resty/anti.lua:48

```

```luajit
function _M.resp_header_filter(anti)   --filter.lua:412
    if ngx.req.is_internal() then
        log.debug("internal request")
        return
    end

    ...
end
```


Reply all
Reply to author
Forward
0 new messages