Call for testing Cygwin snapshot

Corinna Vinschen corinna-cygwin@cygwin.com
Fri Dec 2 10:40:00 GMT 2005


On Dec  2 01:27, Bas van Gompel wrote:
> Op Wed, 30 Nov 2005 18:11:37 +0100 schreef Corinna Vinschen
> in <20051130171137.GE2999<at>calimero.vinschen.de>:
> [Test the 20051130 snapshot]
> 
> :  Please report back in this thread when you encounter a problem, which
> :  you can't reproduce with 1.5.18.  We're interested in regressions in
> :  the first place.
> 
> On my (w95) machine gethostbyname is failing with the snapshot.

Urgh, w95...

> $ cat tghbn.c
> #include <stdio.h>
> #include <netdb.h>
> #include <errno.h>
> 
> int
> main (int argc, char **argv)
> {
>   if (gethostbyname ("localhost"))
>     puts ("Could get host by name (localhost)");
>   else
>     perror ("Could NOT get host by name (localhost)");

errno isn't meaningful after a call to gethostbyname, you should look at
h_errno instead:

      fprintf (stderr, "Could NOT get host by name (localhost): %d <%s>\n",
	       h_errno, hstrerror (h_errno));

Would result in:

   Could NOT get host by name (localhost): herrno: 1 <Unknown host>

> }
> 
> $ make tghbn
> gcc     tghbn.c   -o tghbn
> 
> $ ./tghbn
> Could NOT get host by name (localhost): Operation not permitted

I have no w95, only w98 SE.  Works for me:

  $ ./tghbn
  Could get a host by name (localhost)

The difference between the snapshot and 1.5.18 is that we dropped
winsock 1 support entirely, and that we now load the symbols from
ws2_32.dll instead of from wsock32.dll.  Maybe there's a bug in w95's
WinSock2 implementation?  I don't know.  I don't see anything in
Microsoft's KB.  However, does it work for no hostname or just for
localhost?  If only for localhost, what happens if you add a matching
entry to C:/WINDOWS/HOSTS:

  127.0.0.1	localhost

> 374106  601479 [main] tghbn 758909 wsock_init: res 0
> 15488  616967 [main] tghbn 758909 wsock_init: wVersion 514
>  1502  618469 [main] tghbn 758909 wsock_init: wHighVersion 514
>  1916  620385 [main] tghbn 758909 wsock_init: szDescription WinSock 2.0
>  7935  628320 [main] tghbn 758909 wsock_init: szSystemStatus Running
> 10963  639283 [main] tghbn 758909 wsock_init: iMaxSockets 0
>  2118  641401 [main] tghbn 758909 wsock_init: iMaxUdpDg 0
>  1584  642985 [main] tghbn 758909 wsock_init: lpVendorInfo 0

So loading WinSock2 worked fine.

> 1191806 1834791 [main] tghbn 758909 __set_errno: void __set_winsock_errno(const char*, int):278 val 1
>   997 1835788 [main] tghbn 758909 __set_winsock_errno: __dup_ent:378 - winsock error 11001 -> errno 1

Winsock error 11001: "No such host".

Hmm.  Are you set up to build your own Cygwin DLL?  If so, could you
try if it suddenly works again (remove the above entry from the hosts
file first, don't change anything else!), if you make this change:

Index: autoload.cc
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/autoload.cc,v
retrieving revision 1.110
diff -u -p -r1.110 autoload.cc
--- autoload.cc 28 Nov 2005 22:32:29 -0000      1.110
+++ autoload.cc 2 Dec 2005 10:24:55 -0000
@@ -457,7 +457,7 @@ LoadDLLfunc (bind, 12, ws2_32)
 LoadDLLfunc (closesocket, 4, ws2_32)
 LoadDLLfunc (connect, 12, ws2_32)
 LoadDLLfunc (gethostbyaddr, 12, ws2_32)
-LoadDLLfunc (gethostbyname, 4, ws2_32)
+LoadDLLfunc (gethostbyname, 4, wsock32)
 LoadDLLfuncEx2 (gethostname, 8, ws2_32, 1, 1)
 LoadDLLfunc (getpeername, 12, ws2_32)
 LoadDLLfunc (getprotobyname, 4, ws2_32)


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list