nginx segment fault when it need write error log but no error file is configured

Delta Yeh delta.yeh at gmail.com
Thu Oct 13 12:22:28 UTC 2011


Hi,

During my test of nginx_udplog module, I run into a nginx segment fault.
In nginx conf file, I don't set  nginx error log,  I set
access_udplog  192.168.1.1 main;

 but 192.168.1.1 udp port 514 is not open.

When I send a request, nginx crashed.

gdb info:


#0  0x0805a4b0 in ngx_log_error_core (level=4, log=0x812c3d4, err=111,
    fmt=0x80e2437 "send() failed") at src/core/ngx_log.c:93
#1  0x080636f4 in ngx_connection_error (c=0x812fc60, err=111,
    text=0x80e2437 "send() failed") at src/core/ngx_connection.c:1093
#2  0x080708e5 in ngx_unix_send (c=0x812fc60,


(gdb) frame 0
#0  0x0805a4b0 in ngx_log_error_core (level=4, log=0x812c3d4, err=111,
    fmt=0x80e2437 "send() failed") at src/core/ngx_log.c:93
93          if (log->file->fd == NGX_INVALID_FILE) {
(gdb) p *log
$1 = {log_level = 4, file = 0x0, connection = 0, handler = 0, data = 0x0,
  action = 0x80ebfc6 "logging"}

It seems log->file should be checked also.


If I set error log file, nginx won't crash.



More information about the nginx-devel mailing list