Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jul 1998 19:12:26 +0200
From:      Christoph Kukulies <kuku@gilberto.physik.RWTH-Aachen.DE>
To:        Mark Tinguely <tinguely@plains.NoDak.edu>
Cc:        freebsd-hackers@freefall.cdrom.com, kuku@gilberto.physik.RWTH-Aachen.DE
Subject:   Re: mit-pthreads and gethostbyname
Message-ID:  <19980706191226.15709@gil.physik.rwth-aachen.de>
In-Reply-To: <199807061655.LAA27539@plains.NoDak.edu>; from Mark Tinguely on Mon, Jul 06, 1998 at 11:55:27AM -0500
References:  <199807061655.LAA27539@plains.NoDak.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980706191226.15709>