[comp.unix.ultrix] bugs

metcalf@masala.lcs.mit.edu (Chris Metcalf) (03/14/91)

I've found a couple of interesting Ultrix bugs since we brought up
our DECstations 3100s under Ultrix 4.1.  

This first is one I asked about here a month or so ago.  We were having
problems with our file systems becoming corrupted when large virtual-
memory jobs were run.  It turns out that if you are swapping on (e.g.)
two disks but there's a "missing" disk in the sequence of swap disks,
Ultrix swaps onto the partition *following* the swap on the first disk
instead of the swap partition on the second disk!  In our case, we had
rz0 and rz2 as the only disks on the system, and we were swapping onto
rz0b and rz2b.  In this configuration, running a large virtual-memory
task would result in swapping on rz0g (a user partition):  running
"strings" on the raw filesystem partition shows the test string I was
writing to memory in the large task.  Setting rz2 to rz1 and changing
the correct byte in /etc/fstab made the problem go away completely.
(Sigh.  Where are electronic SPRs when you need them?)

The other problem, which I encountered just recently, concerns the
behavior of gethostbyaddr().  If you have "hosts=local,bind" in your
/etc/svc.conf file, a call to gethostbyaddr() that doesn't find
the desired host in /etc/hosts, but does find it with DNS, returns
the correct name and address, but the aliases are those of the
last line in /etc/hosts!  

To demonstrate this lossage, compile the little program at the end
of this post and try the following.  First, make sure that your
/etc/svc.conf is set up to hosts=local,bind.

	% <edit your /etc/hosts to end with: "127.0.0.1 localhost">
	% hostaddr 18.72.2.1
	name    = "MIT.MIT.EDU"
	aliases =
	% <add an alias (e.g. "ultrix_lossage") after the "localhost">
	% hostaddr 18.72.2.1
	name    = "MIT.MIT.EDU"
	aliases = "ultrix_lossage"

The easiest fix to this problem is to end your /etc/hosts with
a line containing no aliases (like localhost).

/* hostaddr.c begins */
#include <netdb.h>
#define AF_INET 2

main(argc, argv)
	char **argv;
{
	char **alias;
	unsigned long addr = inet_addr(argv[1]);
	struct hostent *host = gethostbyaddr(&addr, sizeof(addr), AF_INET);
	printf("name\t= \"%s\"\naliases\t=", host->h_name);
	for (alias = host->h_aliases; *alias; ++alias)
		printf(" \"%s\"", *alias);
	putchar('\n');
}
/* hostaddr.c end */

We've also been having some problems with ntp in which the clock
stops absolutely dead after the last "select peer" syslog output.
I'm hoping this had to do with the gethostbyaddr() bug.

Good luck to all,
Chris
--
			Chris Metcalf --- MIT Laboratory for Computer Science
			email to metcalf@lcs.mit.edu, or phone (617) 253-7766

iglesias@draco.acs.uci.edu (Mike Iglesias) (03/14/91)

In article <1991Mar14.050932.7864@mintaka.lcs.mit.edu> metcalf@masala.lcs.mit.edu (Chris Metcalf) writes:
> [lots of stuff deleted]
>We've also been having some problems with ntp in which the clock
>stops absolutely dead after the last "select peer" syslog output.
>I'm hoping this had to do with the gethostbyaddr() bug.

I don't think so.  I've seen it on my DS 5000 (using the ntp from
louie.udel.edu, not DEC's) too.  The ntpd daemon doesn't use
gethostbyaddr().


Mike Iglesias
University of California, Irvine
Internet:    iglesias@draco.acs.uci.edu
BITNET:      iglesias@uci
uucp:        ...!ucbvax!ucivax!iglesias

baird@antrim.rdg.dec.com (Alasdair Baird) (03/14/91)

In article <27DF2367.16576@orion.oac.uci.edu>, iglesias@draco.acs.uci.edu (Mike Iglesias) writes:
|> In article <1991Mar14.050932.7864@mintaka.lcs.mit.edu> metcalf@masala.lcs.mit.edu (Chris Metcalf) writes:
|> > [lots of stuff deleted]
|> >We've also been having some problems with ntp in which the clock
|> >stops absolutely dead after the last "select peer" syslog output.
|> >I'm hoping this had to do with the gethostbyaddr() bug.
|> 
|> I don't think so.  I've seen it on my DS 5000 (using the ntp from
|> louie.udel.edu, not DEC's) too.  The ntpd daemon doesn't use
|> gethostbyaddr().

I gather this one is a kernel "feature" fixed subsequent to V4.1.


-- 
Alasdair Baird                           | Internet:  baird@rdg.dec.com
ULTRIX Engineering                       | UUCP:  ...!decvax!baird
Digital Equipment Co., Reading, England  | EASYnet:  wessex::baird