Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Sun, 23 Sep 2001 23:49:07 -0500 From: Andrew de los Reyes To: cygwin AT cygwin DOT com Cc: marius AT umich DOT edu Subject: fork() incorrectly invalidates socket fd Message-ID: <20010923234907.D7099@ghetto.reshall.umich.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Operating-System: Linux 2.2.19 X-Files: The Truth is Out There i think i found a bug in version 1.3.3 of cygwin. fork() appeares to be causing a file descriptor to be invalidated. when i try to recv(), i get the following error: The descriptor is a file, not a socket so, i'll hook you up with the code that's causing the error. it's a proxy server and to be honest, i'm not sure that it totally works on windows. i do know, however, that this bug is one thing in the way. the reason i point that out is maybe when you fix the bug the proxy still won't work, and that's my fault. you can grab my current working source at http://ghetto.kxfish.org/~andrew/nylon-bug.tar.gz just do (here's where i patronize you, sorry): tar -xzvf nylon-bug.tar.gz cd nylon ./nylon.exe -v it should say "starting up" and stuff. try running AOL instant messenger (or some app that uses a proxy) now and tell it to use a proxy. a socks4 proxy connected to 127.0.0.1 on port 1080. you should get the proper error message in the terminal window when you try to connect. check out nylon.c line 233. that "----ok----" would show up twice on the display if the bug in cygwin wasn't in existence. anyway, if you seem to erradicate the bug and want to see if the proxy works (no promises!), remove the following lines (nylon.c 231 to 233): if ( recvn(nsfd, &vn, 1, 0) == -1 ) fatal_error("error receiving version number\n"); printf("-------ok------\n"); well, thanks so much, cygwin people. you put out a great product! -andrew -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/