Welcome! Log In Create A New Profile

Advanced

KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

July 07, 2010 11:06AM
With 2 or more IPv6 listen ports enabled in nginx, if you send it about 3-4 HUPs, it will start to log spam repeatedly in /var/log/nginx-error.log until the partition fills up with the following error message:
[quote][alert] 4104#0: kevent() failed (9: Bad file descriptor)[/quote]

I've tested this on FreeBSD 6.2, both 32-bit single-core and 64-bit multi-core, as well as FreeBSD 7.1 64-bit multi-core.

To repeat:

Start up nginx with the following config file:
[quote]
worker_processes 1;

events {
worker_connections 1024;
}

http {
server {
listen [::]:8001;
listen [::]:8002;
}
}
[/quote]

Send it a single HUP. Nothing should be reported in /var/log/nginx-error.log

Send it another HUP, the following should appear in the log:
[quote]
[alert] 4088#0: kevent() error on 6 filter:-1 flags:4000 (9: Bad file descriptor)
[emerg] 4085#0: close() socket [::]:8002 failed (9: Bad file descriptor)
[alert] 4088#0: kevent() error on 6 filter:-1 flags:4000 (9: Bad file descriptor)
[/quote]

Now send it 1-2 more hups, (maybe a few more might be necessary), and the following will appear:
[quote]
[alert] 4081#0: sendmsg() failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[emerg] 4101#0: close() socket [::]:8002 failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4081#0: close() channel failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4081#0: sendmsg() failed (9: Bad file descriptor)
[/quote]

And then the line from above will be repeated endlessly:
[quote]
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
[alert] 4104#0: kevent() failed (9: Bad file descriptor)
...
[/quote]

I've found that if you only have 1 IPv6 listen port, this doesn't happen. I also haven't been able to reproduce it with IPv4 listen ports.

-- WolfSage (Matthew Horsfall)
Subject Author Posted

KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

WolfSage July 07, 2010 11:06AM

Re: KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

Igor Sysoev July 07, 2010 11:16AM

Re: KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

WolfSage July 07, 2010 11:28AM

Re: KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

WolfSage July 07, 2010 12:09PM

Re: KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

Igor Sysoev July 07, 2010 11:48AM

Re: KQueue: 2 or more IPv6 listen ports + HUPing causes repeated log spam

Maxim Dounin July 07, 2010 12:00PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready