From debbugs-submit-bounces@debbugs.gnu.org Fri May 18 09:14:48 2012 Received: (at submit) by debbugs.gnu.org; 18 May 2012 13:14:48 +0000 Received: from localhost ([127.0.0.1]:60377 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVN15-00019c-SV for submit@debbugs.gnu.org; Fri, 18 May 2012 09:14:48 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34429) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVN13-00019N-8B for submit@debbugs.gnu.org; Fri, 18 May 2012 09:14:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVN0b-0006SJ-AJ for submit@debbugs.gnu.org; Fri, 18 May 2012 09:14:18 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:49041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVN0b-0006SE-6b for submit@debbugs.gnu.org; Fri, 18 May 2012 09:14:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58697) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVN0U-0000OQ-Gt for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 09:14:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVN0S-0006Pw-CV for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 09:14:09 -0400 Received: from limestone5.mail.cornell.edu ([128.253.83.165]:46257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVN0S-0006Nv-8F for bug-gnu-emacs@gnu.org; Fri, 18 May 2012 09:14:08 -0400 X-CornellRouted: This message has been Routed already. Received: from soapstone1.mail.cornell.edu (soapstone1.mail.cornell.edu [128.253.83.143]) by limestone5.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id q4IDDt4C016268 for ; Fri, 18 May 2012 09:13:57 -0400 (EDT) Received: from authusersmtp.mail.cornell.edu (granite2.mail.cornell.edu [128.253.83.142]) by soapstone1.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id q4IDDvYO021092 for ; Fri, 18 May 2012 09:13:57 -0400 (EDT) Received: from [192.168.1.4] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id q4IDDpaW029496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 18 May 2012 09:13:52 -0400 (EDT) Message-ID: <4FB64B05.6020709@cornell.edu> Date: Fri, 18 May 2012 09:13:41 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: bug-gnu-emacs@gnu.org Subject: 24.1.50; Off-by-one error in xg_select? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-PMX-CORNELL-SPAM-CHECKED: Pawpaw X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.18.130633 X-Original-Sender: kbrown@cornell.edu - Fri May 18 09:13:52 2012 X-PMX-CORNELL-REASON: CU_White_List_Override X-detected-operating-system: by eggs.gnu.org: Solaris 9 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.1 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.1 (------) I apologize in advance for the noise if I'm misunderstanding something, but it seems to me that there is an error in the calculation of the first argument in the call to select in xgselect.c:105. (Line numbers refer to the current trunk; xgselect.c was last changed in bzr revno 108249.) The parameter "max_fds" in xg_select, in spite of its name, is initially 1 higher than the maximal file descriptor in the fd_sets in the other parameters. If max_fds doesn't get increased in line 78 or 83, then line 104 does the wrong thing, causing the first argument to select in line 105 to be 1 higher than it should be. I think the following patch fixes this. It also renames "max_fds" to "fds_lim" to more accurately reflect what it represents. === modified file 'src/xgselect.c' --- src/xgselect.c 2012-05-16 02:22:53 +0000 +++ src/xgselect.c 2012-05-18 12:28:27 +0000 @@ -32,7 +32,7 @@ static ptrdiff_t gfds_size; int -xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, +xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, EMACS_TIME *timeout) { SELECT_TYPE all_rfds, all_wfds; @@ -41,10 +41,10 @@ GMainContext *context; int have_wfds = wfds != NULL; int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; - int i, nfds, fds_lim, tmo_in_millisec; + int i, nfds, tmo_in_millisec; if (inhibit_window_system || !display_arg) - return select (max_fds, rfds, wfds, efds, timeout); + return select (fds_lim, rfds, wfds, efds, timeout); if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); else FD_ZERO (&all_rfds); @@ -75,12 +75,12 @@ if (gfds[i].events & G_IO_IN) { FD_SET (gfds[i].fd, &all_rfds); - if (gfds[i].fd > max_fds) max_fds = gfds[i].fd; + if (gfds[i].fd >= fds_lim) fds_lim = gfds[i].fd + 1; } if (gfds[i].events & G_IO_OUT) { FD_SET (gfds[i].fd, &all_wfds); - if (gfds[i].fd > max_fds) max_fds = gfds[i].fd; + if (gfds[i].fd >= fds_lim) fds_lim = gfds[i].fd + 1; have_wfds = 1; } } @@ -101,7 +101,6 @@ if (our_tmo) tmop = &tmo; } - fds_lim = max_fds + 1; nfds = select (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, efds, tmop); if (nfds < 0) From debbugs-submit-bounces@debbugs.gnu.org Sat May 19 04:06:32 2012 Received: (at 11508) by debbugs.gnu.org; 19 May 2012 08:06:32 +0000 Received: from localhost ([127.0.0.1]:33601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVegJ-0003Ao-T2 for submit@debbugs.gnu.org; Sat, 19 May 2012 04:06:32 -0400 Received: from mailout.melmac.se ([62.20.26.67]:55928) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVegH-0003AU-IW for 11508@debbugs.gnu.org; Sat, 19 May 2012 04:06:30 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 46BA99140 for <11508@debbugs.gnu.org>; Sat, 19 May 2012 10:05:57 +0200 (CEST) Received: (qmail 2692 invoked by uid 89); 19 May 2012 09:01:40 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 19 May 2012 09:01:40 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id A5F797FA06C; Sat, 19 May 2012 10:05:56 +0200 (CEST) Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <4FB64B05.6020709@cornell.edu> Date: Sat, 19 May 2012 10:05:57 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> References: <4FB64B05.6020709@cornell.edu> To: Ken Brown X-Mailer: Apple Mail (2.1278) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11508 Cc: 11508@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. I think you misunderstand how select works. Here is a snippet from the = BSD man page: "The first nfds descriptors are checked in each set; i.e., the descriptors from 0 through nfds-1 in the = descriptor sets are examined. (Example: If you have set two file descriptors = "4" and "17", nfds should not be "2", but rather "17 + 1" or "18".) " Jan D. 18 maj 2012 kl. 15:13 skrev Ken Brown: > I apologize in advance for the noise if I'm misunderstanding = something, > but it seems to me that there is an error in the calculation of the > first argument in the call to select in xgselect.c:105. (Line numbers > refer to the current trunk; xgselect.c was last changed in bzr revno > 108249.) >=20 > The parameter "max_fds" in xg_select, in spite of its name, is = initially > 1 higher than the maximal file descriptor in the fd_sets in the other > parameters. If max_fds doesn't get increased in line 78 or 83, then > line 104 does the wrong thing, causing the first argument to select in > line 105 to be 1 higher than it should be. >=20 > I think the following patch fixes this. It also renames "max_fds" to > "fds_lim" to more accurately reflect what it represents. >=20 > =3D=3D=3D modified file 'src/xgselect.c' > --- src/xgselect.c 2012-05-16 02:22:53 +0000 > +++ src/xgselect.c 2012-05-18 12:28:27 +0000 > @@ -32,7 +32,7 @@ > static ptrdiff_t gfds_size; >=20 > int > -xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, = SELECT_TYPE *efds, > +xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, = SELECT_TYPE *efds, > EMACS_TIME *timeout) > { > SELECT_TYPE all_rfds, all_wfds; > @@ -41,10 +41,10 @@ > GMainContext *context; > int have_wfds =3D wfds !=3D NULL; > int n_gfds =3D 0, our_tmo =3D 0, retval =3D 0, our_fds =3D 0; > - int i, nfds, fds_lim, tmo_in_millisec; > + int i, nfds, tmo_in_millisec; >=20 > if (inhibit_window_system || !display_arg) > - return select (max_fds, rfds, wfds, efds, timeout); > + return select (fds_lim, rfds, wfds, efds, timeout); >=20 > if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); > else FD_ZERO (&all_rfds); > @@ -75,12 +75,12 @@ > if (gfds[i].events & G_IO_IN) > { > FD_SET (gfds[i].fd, &all_rfds); > - if (gfds[i].fd > max_fds) max_fds =3D gfds[i].fd; > + if (gfds[i].fd >=3D fds_lim) fds_lim =3D gfds[i].fd + 1; > } > if (gfds[i].events & G_IO_OUT) > { > FD_SET (gfds[i].fd, &all_wfds); > - if (gfds[i].fd > max_fds) max_fds =3D gfds[i].fd; > + if (gfds[i].fd >=3D fds_lim) fds_lim =3D gfds[i].fd + 1; > have_wfds =3D 1; > } > } > @@ -101,7 +101,6 @@ > if (our_tmo) tmop =3D &tmo; > } >=20 > - fds_lim =3D max_fds + 1; > nfds =3D select (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, = efds, tmop); >=20 > if (nfds < 0) >=20 >=20 >=20 >=20 From debbugs-submit-bounces@debbugs.gnu.org Sat May 19 04:30:05 2012 Received: (at 11508) by debbugs.gnu.org; 19 May 2012 08:30:05 +0000 Received: from localhost ([127.0.0.1]:33617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVf37-0003jp-9J for submit@debbugs.gnu.org; Sat, 19 May 2012 04:30:05 -0400 Received: from mailout.melmac.se ([62.20.26.67]:61133) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVf35-0003iW-Fh for 11508@debbugs.gnu.org; Sat, 19 May 2012 04:30:04 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id 15F48918F for <11508@debbugs.gnu.org>; Sat, 19 May 2012 10:29:32 +0200 (CEST) Received: (qmail 16801 invoked by uid 89); 19 May 2012 09:25:15 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 19 May 2012 09:25:15 -0000 Received: from [172.20.199.13] (zeplin [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 865447FA06C; Sat, 19 May 2012 10:29:31 +0200 (CEST) Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? Mime-Version: 1.0 (Apple Message framework v1278) Content-Type: text/plain; charset=iso-8859-1 From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> Date: Sat, 19 May 2012 10:29:32 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> References: <4FB64B05.6020709@cornell.edu> <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> To: Ken Brown X-Mailer: Apple Mail (2.1278) X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11508 Cc: 11508@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello. Disregard my previous comment, I didn't look carefully enough. The case where max_fds does not get increased in line 78 or 83 is very = rare. Everytime some X connection is active, GLib will have added at = least one fd (for signal handling). Probably So the question is, is it more effective to give select the exact value = (select works fine if nfds has a higher value than strictly neccessary), = or always increment by one in lines 78 and 83? As the normal case is that there will be several file descriptors in = GLib, I'd say that the code does the most efficent thing most of the = time. Jan D. >=20 > I think you misunderstand how select works. Here is a snippet from = the BSD man page: >=20 > "The first nfds descriptors are checked in > each set; i.e., the descriptors from 0 through nfds-1 in the = descriptor > sets are examined. (Example: If you have set two file descriptors = "4" > and "17", nfds should not be "2", but rather "17 + 1" or "18".) " >=20 >=20 > Jan D. >=20 > 18 maj 2012 kl. 15:13 skrev Ken Brown: >=20 >> I apologize in advance for the noise if I'm misunderstanding = something, >> but it seems to me that there is an error in the calculation of the >> first argument in the call to select in xgselect.c:105. (Line numbers >> refer to the current trunk; xgselect.c was last changed in bzr revno >> 108249.) >>=20 >> The parameter "max_fds" in xg_select, in spite of its name, is = initially >> 1 higher than the maximal file descriptor in the fd_sets in the other >> parameters. If max_fds doesn't get increased in line 78 or 83, then >> line 104 does the wrong thing, causing the first argument to select = in >> line 105 to be 1 higher than it should be. >>=20 >> I think the following patch fixes this. It also renames "max_fds" to >> "fds_lim" to more accurately reflect what it represents. >>=20 >> =3D=3D=3D modified file 'src/xgselect.c' >> --- src/xgselect.c 2012-05-16 02:22:53 +0000 >> +++ src/xgselect.c 2012-05-18 12:28:27 +0000 >> @@ -32,7 +32,7 @@ >> static ptrdiff_t gfds_size; >>=20 >> int >> -xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, = SELECT_TYPE *efds, >> +xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, = SELECT_TYPE *efds, >> EMACS_TIME *timeout) >> { >> SELECT_TYPE all_rfds, all_wfds; >> @@ -41,10 +41,10 @@ >> GMainContext *context; >> int have_wfds =3D wfds !=3D NULL; >> int n_gfds =3D 0, our_tmo =3D 0, retval =3D 0, our_fds =3D 0; >> - int i, nfds, fds_lim, tmo_in_millisec; >> + int i, nfds, tmo_in_millisec; >>=20 >> if (inhibit_window_system || !display_arg) >> - return select (max_fds, rfds, wfds, efds, timeout); >> + return select (fds_lim, rfds, wfds, efds, timeout); >>=20 >> if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); >> else FD_ZERO (&all_rfds); >> @@ -75,12 +75,12 @@ >> if (gfds[i].events & G_IO_IN) >> { >> FD_SET (gfds[i].fd, &all_rfds); >> - if (gfds[i].fd > max_fds) max_fds =3D gfds[i].fd; >> + if (gfds[i].fd >=3D fds_lim) fds_lim =3D gfds[i].fd + 1; >> } >> if (gfds[i].events & G_IO_OUT) >> { >> FD_SET (gfds[i].fd, &all_wfds); >> - if (gfds[i].fd > max_fds) max_fds =3D gfds[i].fd; >> + if (gfds[i].fd >=3D fds_lim) fds_lim =3D gfds[i].fd + 1; >> have_wfds =3D 1; >> } >> } >> @@ -101,7 +101,6 @@ >> if (our_tmo) tmop =3D &tmo; >> } >>=20 >> - fds_lim =3D max_fds + 1; >> nfds =3D select (fds_lim, &all_rfds, have_wfds ? &all_wfds : NULL, = efds, tmop); >>=20 >> if (nfds < 0) >>=20 >>=20 >>=20 >>=20 >=20 From debbugs-submit-bounces@debbugs.gnu.org Sat May 19 05:53:43 2012 Received: (at 11508) by debbugs.gnu.org; 19 May 2012 09:53:43 +0000 Received: from localhost ([127.0.0.1]:33659 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVgM2-0005es-Jj for submit@debbugs.gnu.org; Sat, 19 May 2012 05:53:43 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:58572) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SVgLi-0005eN-Am for 11508@debbugs.gnu.org; Sat, 19 May 2012 05:53:41 -0400 Received: from frontend1.mail.m-online.net (frontend1.mail.intern.m-online.net [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3VvhPy2VMXz3hhY6; Sat, 19 May 2012 11:52:53 +0200 (CEST) Received: from linux.local (ppp-88-217-120-22.dynamic.mnet-online.de [88.217.120.22]) by mail.mnet-online.de (Postfix) with ESMTPA id 3VvhPx0RjBz4KKDq; Sat, 19 May 2012 11:52:53 +0200 (CEST) Received: by linux.local (Postfix, from userid 501) id 69FC91E5614; Sat, 19 May 2012 11:52:51 +0200 (CEST) From: Andreas Schwab To: Jan =?utf-8?Q?Dj=C3=A4rv?= Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? References: <4FB64B05.6020709@cornell.edu> <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> X-Yow: Everybody gets free BORSCHT! Date: Sat, 19 May 2012 11:52:50 +0200 In-Reply-To: <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> ("Jan =?utf-8?Q?Dj=C3=A4rv=22's?= message of "Sat, 19 May 2012 10:29:32 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.97 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 11508 Cc: 11508@debbugs.gnu.org, Ken Brown X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Jan Dj=C3=A4rv writes: > So the question is, is it more effective to give select the exact value > (select works fine if nfds has a higher value than strictly neccessary)= , > or always increment by one in lines 78 and 83? IMHO it doesn't hurt to be exact, and the patch removes an inconsistency which makes it easier to understand the code. Andreas. --=20 Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED= 5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sun May 20 18:45:57 2012 Received: (at 11508) by debbugs.gnu.org; 20 May 2012 22:45:57 +0000 Received: from localhost ([127.0.0.1]:35758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWEsv-0001PX-7F for submit@debbugs.gnu.org; Sun, 20 May 2012 18:45:57 -0400 Received: from limestone4.mail.cornell.edu ([128.253.83.164]:33610) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWEst-0001PK-8S for 11508@debbugs.gnu.org; Sun, 20 May 2012 18:45:56 -0400 X-CornellRouted: This message has been Routed already. Received: from orchid.mail.cornell.edu (orchid.mail.cornell.edu [132.236.56.61]) by limestone4.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id q4KMj6w1000756; Sun, 20 May 2012 18:45:06 -0400 (EDT) Received: from authusersmtp.mail.cornell.edu (granite2.mail.cornell.edu [128.253.83.142]) by orchid.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id q4KMjCZs000900; Sun, 20 May 2012 18:45:13 -0400 (EDT) Received: from [192.168.1.4] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id q4KMjAK2025907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 20 May 2012 18:45:11 -0400 (EDT) Message-ID: <4FB973EB.9060705@cornell.edu> Date: Sun, 20 May 2012 18:44:59 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Andreas Schwab Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? References: <4FB64B05.6020709@cornell.edu> <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-PMX-CORNELL-SPAM-CHECKED: Pawpaw X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.20.223315 X-Original-Sender: kbrown@cornell.edu - Sun May 20 18:45:12 2012 X-PMX-CORNELL-REASON: CU_White_List_Override Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by limestone4.mail.cornell.edu id q4KMj6w1000756 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 11508 Cc: =?UTF-8?B?SmFuIERqw6Rydg==?= , 11508@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) On 5/19/2012 5:52 AM, Andreas Schwab wrote: > Jan Dj=C3=A4rv writes: > >> So the question is, is it more effective to give select the exact valu= e >> (select works fine if nfds has a higher value than strictly neccessary= ), >> or always increment by one in lines 78 and 83? > > IMHO it doesn't hurt to be exact, and the patch removes an inconsistenc= y > which makes it easier to understand the code. So can I go ahead and make this change? Jan, do you still object? Ken From debbugs-submit-bounces@debbugs.gnu.org Mon May 21 01:30:58 2012 Received: (at 11508) by debbugs.gnu.org; 21 May 2012 05:30:58 +0000 Received: from localhost ([127.0.0.1]:36080 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWLCs-00037S-3m for submit@debbugs.gnu.org; Mon, 21 May 2012 01:30:58 -0400 Received: from mailout.melmac.se ([62.20.26.67]:47489) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWLCm-00037A-Bd for 11508@debbugs.gnu.org; Mon, 21 May 2012 01:30:55 -0400 Received: from mail01.melmac.se (mail01.melmac.se [62.20.26.80]) by mailout.melmac.se (Postfix) with ESMTP id B33719CA6 for <11508@debbugs.gnu.org>; Mon, 21 May 2012 07:30:09 +0200 (CEST) Received: (qmail 991 invoked by uid 89); 21 May 2012 06:25:49 -0000 Received: from h-46-59-42-18.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.18) by mail01.melmac.se with ESMTPA; 21 May 2012 06:25:49 -0000 Received: from [172.20.199.248] (janiphone [172.20.199.248]) by coolsville.localdomain (Postfix) with ESMTPSA id 347917FA06C; Mon, 21 May 2012 07:30:09 +0200 (CEST) References: <4FB64B05.6020709@cornell.edu> <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> <4FB973EB.9060705@cornell.edu> In-Reply-To: <4FB973EB.9060705@cornell.edu> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Message-Id: <8494C018-ABAE-4218-BEB5-A4C80FBB3FED@swipnet.se> X-Mailer: iPhone Mail (9B206) From: =?utf-8?Q?Jan_Dj=C3=A4rv?= Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? Date: Mon, 21 May 2012 07:30:06 +0200 To: Ken Brown X-Spam-Score: -1.2 (-) X-Debbugs-Envelope-To: 11508 Cc: "11508@debbugs.gnu.org" <11508@debbugs.gnu.org>, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.2 (-) Hello.=20 Go ahead and make the change. Jan D.=20 21 maj 2012 kl. 00:44 skrev Ken Brown : > On 5/19/2012 5:52 AM, Andreas Schwab wrote: >> Jan Dj=C3=A4rv writes: >>=20 >>> So the question is, is it more effective to give select the exact value >>> (select works fine if nfds has a higher value than strictly neccessary),= >>> or always increment by one in lines 78 and 83? >>=20 >> IMHO it doesn't hurt to be exact, and the patch removes an inconsistency >> which makes it easier to understand the code. >=20 > So can I go ahead and make this change? Jan, do you still object? >=20 > Ken From debbugs-submit-bounces@debbugs.gnu.org Mon May 21 09:40:04 2012 Received: (at 11508-done) by debbugs.gnu.org; 21 May 2012 13:40:04 +0000 Received: from localhost ([127.0.0.1]:36885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWSqB-0006o4-Ai for submit@debbugs.gnu.org; Mon, 21 May 2012 09:40:04 -0400 Received: from limestone5.mail.cornell.edu ([128.253.83.165]:63869) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SWSpp-0006n8-Pq for 11508-done@debbugs.gnu.org; Mon, 21 May 2012 09:40:01 -0400 X-CornellRouted: This message has been Routed already. Received: from alva01.serverfarm.cornell.edu (alva01.serverfarm.cornell.edu [128.84.106.36]) by limestone5.mail.cornell.edu (8.14.4/8.14.4) with ESMTP id q4LDcvgo028926; Mon, 21 May 2012 09:38:57 -0400 (EDT) Received: from localhost.localdomain (pawpaw.mail.cornell.edu [128.253.83.170]) by alva01.serverfarm.cornell.edu (8.14.4/8.14.4) with ESMTP id q4LDcuSM009220; Mon, 21 May 2012 09:38:57 -0400 Received: from pawpaw.mail.cornell.edu by pawpaw.mail.cornell.edu with queue id 207202401-6; Mon, 21 May 2012 13:38:23 GMT Received: from [192.168.1.4] (cpe-67-249-194-47.twcny.res.rr.com [67.249.194.47]) by with SMTP id ; Mon, 21 May 2012 13:38:23 GMT (envelope-from kbrown@cornell.edu) Message-ID: <4FBA4542.1070408@cornell.edu> Date: Mon, 21 May 2012 09:38:10 -0400 From: Ken Brown User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: =?UTF-8?B?SmFuIERqw6Rydg==?= Subject: Re: bug#11508: 24.1.50; Off-by-one error in xg_select? References: <4FB64B05.6020709@cornell.edu> <3B902B7C-C59A-4933-A6AA-E23DB052704C@swipnet.se> <73ED1C31-12C1-4424-9DEC-632A1F0050D4@swipnet.se> <4FB973EB.9060705@cornell.edu> <8494C018-ABAE-4218-BEB5-A4C80FBB3FED@swipnet.se> In-Reply-To: <8494C018-ABAE-4218-BEB5-A4C80FBB3FED@swipnet.se> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-CORNELL-SPAM-CHECKED: Pawpaw X-PMX-Version: 5.5.9.395186, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.5.21.132715 X-Original-Sender: kbrown@cornell.edu - Mon May 21 09:38:23 2012 X-PMX-CORNELL-REASON: CU_White_List_Override X-PMX-CORNELL: Alva01 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 11508-done Cc: 11508-done@debbugs.gnu.org, Andreas Schwab X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.2 (----) Version: 24.2 I've committed a simpler version of the change as bzr revision 108325, and I'm closing the bug. Ken From unknown Thu Sep 11 09:18:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Jun 2012 11:24:02 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator