Problem
My named is repeatedly core dumping with the following error on the console and in /var/adm/syslog:
evSelectFD(fd 150): Invalid argument
core dumpI don't know what is causing this to happen.
Cause
Although it appears that the program is causing a core dump unintentionally, it is an intentional act by the bind programmers. Inside their code, they have:
ns_panic(int category, int dump_core, const char *format, ...) {
va_list args;
if (!log_ctx_valid)
return;
va_start(args, format);
log_vwrite(log_ctx, category, log_critical, format, args);
va_end(args);
va_start(args, format);
log_vwrite(log_ctx, ns_log_panic, log_critical, format, args);
va_end(args);
if (dump_core)
abort(); /* This causes the core dump */
else
exit(1);
}So, if they ever encounter a "panic" situation, they will dump core.
NOTE: The term "panic" here has nothing to do with the usual context in which the term is used, namely, the halting of the _operating system_ due to an unrecoverable condition.
One of their criteria for a panic and dumping core is if the number of open file descriptors is greater than a certain predefined maximum. This can be caused by the following situation:
By default, named binds to every interface on the machine, virtual or otherwise. As you approach 256 ifconfig aliases, named runs out of file descriptors, at which point the named will enter a mode of panic and dump core.
Solution
Fortunately, named 8.X (which ships with SCO OpenServer 5.0.5) allows you to specify which interfaces it binds to. You only need it listening on the actual IP address of the machine and loopback address. Therefore, add:
listen-on { X.X.X.X; 127.0.0.1; };where "X.X.X.X" is the primary IP address of your ethernet interface, to your /etc/named.conf file.
Note that this is not a bug, but part of the implementation.
See also
Manual page: named(ADMN)O'Reilly's book "DNS and BIND"