Can anyone take a look at this problem happened with ncftp3 at 8.0-CURRENT, i'm just wondering if it could or not happen with other port(s). Thanks ----- Forwarded message from Mike Gleason <mgleason_at_ncftp.com> ----- Date: Sun, 31 Aug 2008 18:51:24 -0500 From: Mike Gleason <mgleason_at_ncftp.com> To: Renato Botelho <garga_at_FreeBSD.org> Cc: wxs_at_FreeBSD.org, obrien_at_FreeBSD.org Subject: Re: [wxs_at_FreeBSD.org: Re: cvs commit: ports/ftp/ncftp3 pkg-plist] X-Mailer: Apple Mail (2.926) OK, I have a workaround for this problem. However, I believe there is a bug in the 8.0-CURRENT version of select(), which is returning an incorrect number of ready descriptors. This bug does not occur on 7.0- RELEASE. NcFTP's sio library function, _SConnect, wants to select() for one descriptor. It creates fd_set structures for writeable fds and exception fds, with each fd set having only one bit set corresponding to the single descriptor it is selecting. Select() then returns 2, rather than 1. NcFTP was essentially checking if select returned 1, and if so, OK, if not 1, error. Since 2 was returned, this was causing the problem that Renato reported. If a descriptor was both writeable and exceptioned, I suppose that select could count that descriptor twice (I'm not sure what the official semantics are). In that scenario, select could return 2, so regardless of any select bug, NcFTP will now check to see if a value greater than or equal to 1 is returned, rather than simply checking for equality to 1 (and this is the first patch for NcFTP 3.2.x appended below). However, there is still a problem in select() somewhere, since as you can see below, select() returns 2, but according to the resulting fd_sets, only the writeable fd_set has my fd. It should either return 1, or have the fd set in both the writers and exceptions fd_sets. (The second patch adds these debug prints, if you want to reproduce this.) > ./bin/ncftpls ftp://ftp.freebsd.org/pub/ fd 3 is set in writers fd 3 is set in exceptions select = 2 fd 3 is set in writers Mike Gleason NcFTP Software http://www.NcFTP.com diff -wurd ncftp-3.2.2/sio/SConnect.c ncftp-3.2.2-WORKAROUND/sio/ SConnect.c --- ncftp-3.2.2/sio/SConnect.c 2007-10-27 14:14:05.000000000 -0400 +++ ncftp-3.2.2-WORKAROUND/sio/SConnect.c 2008-08-31 19:00:56.000000000 -0400 _at__at_ -154,7 +154,7 _at__at_ tv.tv_sec = (tv_sec_t) tlen; tv.tv_usec = 0; result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &xx, SELECT_TYPE_ARG5 &tv); - if (result == 1) { + if (result >= 1) { /* ready */ break; } else if (result == 0) { diff -wurd ncftp-3.2.2/sio/SConnect.c ncftp-3.2.2-SELECT-BUG/sio/ SConnect.c --- ncftp-3.2.2/sio/SConnect.c 2007-10-27 14:14:05.000000000 -0400 +++ ncftp-3.2.2-SELECT-BUG/sio/SConnect.c 2008-08-31 19:10:04.000000000 -0400 _at__at_ -151,10 +151,25 _at__at_ #if defined(__DECC) || defined(__DECCXX) # pragma message restore #endif +{ +int x; +for (x=0; x<=sfd; x++) { +if (MY_FD_ISSET(x, &ss)) {fprintf(stderr, "fd %d is set in writers\n", x); } +if (MY_FD_ISSET(x, &xx)) {fprintf(stderr, "fd %d is set in exceptions\n", x); } +} +} tv.tv_sec = (tv_sec_t) tlen; tv.tv_usec = 0; result = select(sfd + 1, NULL, SELECT_TYPE_ARG234 &ss, SELECT_TYPE_ARG234 &xx, SELECT_TYPE_ARG5 &tv); - if (result == 1) { +fprintf(stderr, "select = %d\n", result); +{ +int x; +for (x=0; x<=sfd; x++) { +if (MY_FD_ISSET(x, &ss)) {fprintf(stderr, "fd %d is set in writers\n", x); } +if (MY_FD_ISSET(x, &xx)) {fprintf(stderr, "fd %d is set in exceptions\n", x); } +} +} + if (result >= 1) { /* ready */ break; } else if (result == 0) { On Aug 27, 2008, at 11:05 AM, Renato Botelho wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hello Mike, > > What do you think about it? > > Regards > > - ----- Forwarded message from Wesley Shields <wxs_at_FreeBSD.org> ----- > > Date: Wed, 27 Aug 2008 11:04:15 -0400 > From: Wesley Shields <wxs_at_FreeBSD.org> > To: Renato Botelho <garga_at_FreeBSD.org> > Cc: "David E. O'Brien" <obrien_at_FreeBSD.org>, cvs-ports_at_FreeBSD.org > Subject: Re: cvs commit: ports/ftp/ncftp3 pkg-plist > > On Wed, Aug 27, 2008 at 11:49:52AM -0300, Renato Botelho wrote: >> On Wed, Aug 27, 2008 at 02:31:01PM +0000, David E. O'Brien wrote: >>> obrien 2008-08-27 14:31:01 UTC >>> >>> FreeBSD ports repository >>> >>> Modified files: >>> ftp/ncftp3 pkg-plist >>> Log: >>> Upgrade to version 3.2.2. >> >> This version still doesn't work at recent -CURRENT (since 800041 for >> me). >> >> garga_at_botelhor:~> ncftp >> NcFTP 3.2.2 (Aug 18, 2008) by Mike Gleason >> (http://www.NcFTP.com/contact/). >> ncftp> open ftp.FreeBSD.org >> Could not connect to ftp.FreeBSD.org: Operation now in progress. >> Could not open host ftp.FreeBSD.org: could not connect to remote >> host. >> >> What do you think to mark it as BROKEN? >> >> btw, i've notified ncftp people about this problem, but the guy >> couldn't >> install -CURRENT on his vmware and couldn't reproduce, but me and >> more 2 >> people that i've assked tested and had the same. > > I can give him/her access to an amd64 -current box for testing if (s)he > wants. > > - -- WXS > > - ----- End forwarded message ----- > > - -- > Renato Botelho <garga _at_ FreeBSD.org> > <garga _at_ freebsdbrasil.com.br> > GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc > > Dianetics is a milestone for man comparable to his discovery of > fire and superior to his invention of the wheel and the arch. > -- L. Ron Hubbard > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2.0.9 (FreeBSD) > > iEYEARECAAYFAki1e0UACgkQ6CRbiSJE7anb2gCeOJIhB+OzS/XFiVnDZh6Wl+Yl > u/AAoJEG69J0gf2+6unuIi4PhxeLZ2L7 > =CjJA > -----END PGP SIGNATURE----- > > ----- End forwarded message ----- -- Renato Botelho <garga _at_ FreeBSD.org> <garga _at_ freebsdbrasil.com.br> GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc I think your opinions are reasonable, except for the one about my mental instability. -- Psychology Professor, Farifield UniversityReceived on Mon Sep 01 2008 - 11:12:00 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:34 UTC