From owner-freebsd-hackers Mon Jul 6 10:14:01 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA11528 for freebsd-hackers-outgoing; Mon, 6 Jul 1998 10:14:01 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA11513 for ; Mon, 6 Jul 1998 10:13:57 -0700 (PDT) (envelope-from kuku@gilberto.physik.RWTH-Aachen.DE) Received: from gilberto.physik.RWTH-Aachen.DE (gilberto.physik.rwth-aachen.de [137.226.30.2]) by freefall.freebsd.org (8.8.8/8.8.5) with ESMTP id KAA17933 for ; Mon, 6 Jul 1998 10:13:08 -0700 (PDT) Received: (from kuku@localhost) by gilberto.physik.RWTH-Aachen.DE (8.8.8/8.8.7) id TAA05235; Mon, 6 Jul 1998 19:12:26 +0200 (MEST) (envelope-from kuku) Message-ID: <19980706191226.15709@gil.physik.rwth-aachen.de> Date: Mon, 6 Jul 1998 19:12:26 +0200 From: Christoph Kukulies To: Mark Tinguely Cc: freebsd-hackers@freefall.cdrom.com, kuku@gilberto.physik.RWTH-Aachen.DE Subject: Re: mit-pthreads and gethostbyname References: <199807061655.LAA27539@plains.NoDak.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.81e In-Reply-To: <199807061655.LAA27539@plains.NoDak.edu>; from Mark Tinguely on Mon, Jul 06, 1998 at 11:55:27AM -0500 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Mon, Jul 06, 1998 at 11:55:27AM -0500, Mark Tinguely wrote: > > I have a strange problem with resolution of localhost (gethostbyname) > > when using mit-pthreads where localhost cannot be resolved by > > gethostbyname when search order is host->bind in /etc/host.conf > > and /etc/resolv.conf is present. > > using libc_r (which uses the libc gethostby* routines), the host.conf > file is used. But using MIT threads like you mentioned, they implement > their own gethostby* routines. > > I think there is a more generic problem MIT pthreads does not consult the > /etc/hosts file. I test program that runs on a machine in an isolated network: > > joy (nameserver) > / \ > rest of net isolated network > > the isolated network have /etc/hosts and does a host, bind search order. > > If i run a program that uses gethostbyname from libc, the correct IP > number is returned for joy (the hidden network IP taken from /etc/hosts). > test 2, if I resolve a name that has multiple DNS entries, the libc > version returns them all. > > If i run a program that uses gethostbyname from MIT pthreads, the DNS derived > IP number is returned for joy. for test 2, only the first IP number of a host > that resolves to multiple addresses is returned. > > check the command, "nslookup localhost", by guess is that it does not > have an entry and that is why the MIT pthreads gethostbyname call does not > not return a value. blues> nslookup localhost Server: acaxp.physik.rwth-aachen.de Address: 137.226.33.200 Non-authoritative answer: Name: localhost Address: 127.0.0.1 blues> ./resolveip localhost ./resolveip: Unable to find hostid for 'localhost' blues> resolveip is a program which comes with mysql-3.22.3alpha and is linked against mit-pthreads. blues> ldd resolveip resolveip: -lm.2 => /usr/lib/libm.so.2.0 (0x2002d000) -lz.2 => /usr/lib/libz.so.2.0 (0x20047000) -lcrypt.2 => /usr/lib/libcrypt.so.2.0 (0x20053000) -lc.3 => /usr/lib/libc.so.3.1 (0x20068000) Strangely though, I ran that program fine on hub.freebsd.org but in my network it fails although the nameserver has a localhost entry. What's up with all the different thread packages these days? I hear FreeBSD kernel threads aren't yet quite mature, or still too slow. mit-pthreads are supposedly faster than kernel threads (?). Does anyone know the whole story? Could be mysql made working with kernel threads? Are libc_r routines using kernel threads? > --mark. -- Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message