nginx worker core dump定位

504 views
Skip to first unread message

L.D

unread,
Dec 5, 2016, 1:15:57 AM12/5/16
to openresty
openresty已更新至最新版本,实现了一个解析请求的cookie功能,将每个请求带来的cookie使用lua-resty-http模块请求另外个服务获取cookie中的uid,并将该cookie缓存至共享内存中,下次请求先去共享内存中查询。
该功能更新到生产环境时,偶尔会发生worker退出,错误如下:
worker process 5654 exited on signal 11.
在nginx.conf配置文件中加入worker_rlimit_core 10000m,生成core dump文件。在gdb跟踪时只有如下显示:

GNU gdb (GDB) Red Hat Enterprise Linux (7.2-90.el6)
Copyright (C) 2010 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:
Reading symbols from /home/nginx...done.
[New Thread 5660]
Cannot access memory at address 0xe000808
Cannot access memory at address 0xe000808
Cannot access memory at address 0xe000808
Cannot access memory at address 0xe000808
Reading symbols from /lib64/ld-linux-x86-64.so.2...Reading symbols from /usr/lib/debug/lib64/ld-2.12.so.debug...done.
done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Cannot access memory at address 0xe000808
Core was generated by `nginx: work'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f9dba50b60b in ?? ()
(gdb) where
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb)

没有调用栈打出,这样我该如何定位?

DeJiang Zhu

unread,
Dec 5, 2016, 8:21:47 AM12/5/16
to open...@googlegroups.com
Hello

2016-12-05 14:15 GMT+08:00 L.D <dongxin...@gmail.com>:
openresty已更新至最新版本,实现了一个解析请求的cookie功能,将每个请求带来的cookie使用lua-resty-http模块请求另外个服务获取cookie中的uid,并将该cookie缓存至共享内存中,下次请求先去共享内存中查询。
该功能更新到生产环境时,偶尔会发生worker退出,错误如下:

听你这么描述,这个功能并不需要其他非 OpenResty 自带的第三方 C 模块的
请你确认下,是否有使用到其他的第三方 C 模块? 
 
(gdb) where
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 

没有调用栈打出,这样我该如何定位?

你这里是有调用栈,但是没有调试符信息,所以不能显示函数名
如果你用的是 OpenResty 官方的二进制包,那你需要安装 debuginfo 的包
如果你自己安装的,那你得自己解决调试符的信息
 

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html

L.D

unread,
Dec 6, 2016, 2:06:07 AM12/6/16
to openresty
的确是加载了第三方c模块引起的,重新单独测试了这个流程没有问题的,我再去分析下这个第三方C模块,谢谢

在 2016年12月5日星期一 UTC+8下午9:21:47,doujiang写道:
Hello

2016-12-05 14:15 GMT+08:00 L.D <dongxin...@gmail.com>:
openresty已更新至最新版本,实现了一个解析请求的cookie功能,将每个请求带来的cookie使用lua-resty-http模块请求另外个服务获取cookie中的uid,并将该cookie缓存至共享内存中,下次请求先去共享内存中查询。
该功能更新到生产环境时,偶尔会发生worker退出,错误如下:

听你这么描述,这个功能并不需要其他非 OpenResty 自带的第三方 C 模块的
请你确认下,是否有使用到其他的第三方 C 模块? 
 
(gdb) where
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x00007f9dba50b60b in ?? ()
#1  0x00000002419a4220 in ?? ()
#2  0x0000000040f120c8 in ?? ()
#3  0x0000000000000000 in ?? ()
(gdb) 

没有调用栈打出,这样我该如何定位?

你这里是有调用栈,但是没有调试符信息,所以不能显示函数名
如果你用的是 OpenResty 官方的二进制包,那你需要安装 debuginfo 的包
如果你自己安装的,那你得自己解决调试符的信息
 

--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty...@googlegroups.com
发言: 请发邮件到 open...@googlegroups.com
退订: 请发邮件至 openresty+...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages