您的位置:首页 > 运维架构 > Nginx

nginx错误日志出现worker process 24939 exited on signal 11 (core dumped)

2016-01-17 00:30 621 查看
今天发现用google浏览器访问nginx服务器时,部分文件请求无法正常加载,导致页面显示不正常。查看nginx错误日志,出现了大量这样的数据:

[plain] view
plaincopy

2015/04/22 13:31:59 [alert] 13175#0: worker process 2703 exited on signal 11 (core dumped)

2015/04/22 13:31:59 [alert] 13175#0: worker process 2711 exited on signal 11 (core dumped)

2015/04/22 13:31:59 [alert] 13175#0: worker process 2716 exited on signal 11 (core dumped)

2015/04/22 13:31:59 [alert] 13175#0: worker process 2721 exited on signal 11 (core dumped)

2015/04/22 13:32:00 [alert] 13175#0: worker process 2634 exited on signal 11 (core dumped)

2015/04/22 13:32:00 [alert] 13175#0: worker process 2725 exited on signal 11 (core dumped)

2015/04/22 13:32:01 [alert] 13175#0: worker process 2734 exited on signal 11 (core dumped)

查看dmesg也发现了错误

#dmesg

[plain] view
plaincopy

nginx[2703]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

nginx[2711]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

nginx[2716]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

nginx[2721]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

nginx[2725]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

nginx[2734]: segfault at 359 ip 000000000043f2b6 sp 00007fff7071ef40 error 4 in nginx[400000+94b000]

这种信息一般都是由内核内存访问越界造成的,不管是用户态程序还是内核态程序访问越界都会出core,并在系统日志里面输出一条这样的信息。这条信息的前面分别是访问越界的程序名,进程id号,访问越界的地址以及当时进程进程堆栈地址等信息,比较有用的信息是最后的error number.在上面的信息中,error number 是4。下面详细介绍一下error number的信息:

在上面的例子中,error number是4,转成二进制就是100,即bit2=1,bit1=0,bit0=0

error number是由3个字位组成的,从高到低分别是bit2、bit1、bit0,所以它的取值范围是0~7

bit2:值为1时表示 是用户态程序内存访问越界,值为0时表示 是内核态程序内存访问越界

bit1:值为1时表示 是写操作导致内存访问越界,值为0时表示 是读操作导致内存访问越界

bit0:值为1表示没有足够的权限访问非法地址的内容,值为0时表示访问的非法地址根本没有对应的页面,也就是无效地址。

所以error 4 就表示用户态程序nginx进行读操作时访问的地址无效。

那么问题怎么解决呢?幸好找到了这篇文章:http://blog.csdn.net/xuyaqun/article/details/5343021。作者遇到的情况跟我的很相似。

原来是搜索引擎的蜘蛛在爬取到加密部分时,得不到正确的路径,又没有被定位到错误页导致的。

附:段错误 segfault 是什么

段错误是指访问的内存超出了系统给这个程序所设定的内存空间,例如访问了不存在的内存地址,访问了系统保护的内存地址,访问了只读的内存地址等等情况。这里贴出一个对“段错误的准确定义”(参考Answers.com)

A segmentation fault (often shortened to segfault) is a particular error condition that can occur during the operation of computer software. In short, a segmentation fault occurs when a program attempts to access a memory
location that it is not allowed to access, or attempts to access a memory location in a way that is not allowed (e.g., attempts to write to a read-only location, or to overwrite part of the operating system). Systems based on processors like the Motorola 68000
tend to refer to these events as Address or Bus errors.

Segmentation is one approach to memory management and protection in the operating system. It has been superseded by paging for most purposes, but much of the terminology of segmentation is still used, "segmentation fault" being an example. Some operating systems
still have segmentation at some logical level although paging is used as the main memory management policy.

On Unix-like operating systems, a process that accesses invalid memory receives the SIGSEGV signal. On Microsoft Windows, a process that accesses invalid memory receives the STATUS_ACCESS_VIOLATION exception.

from:http://blog.csdn.net/hexuan1/article/details/45222867
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: