From owner-freebsd-alpha Thu Jul 27 15: 8:51 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from eel.radicalmedia.com (eel.radicalmedia.com [204.254.246.9]) by hub.freebsd.org (Postfix) with ESMTP id B2BE937BB14; Thu, 27 Jul 2000 15:08:43 -0700 (PDT) (envelope-from phiber@eel.radicalmedia.com) Received: (from phiber@localhost) by eel.radicalmedia.com (8.9.3/8.9.3) id SAA20013; Thu, 27 Jul 2000 18:08:40 -0400 (EDT) Date: Thu, 27 Jul 2000 18:08:39 -0400 From: Mark Abene To: Andrew Gallatin Cc: "David O'Brien" , freebsd-alpha@FreeBSD.ORG Subject: Re: select problems ( was Re: weird XFree86 3.3.6 behavior...) Message-ID: <20000727180839.B19445@radicalmedia.com> References: <20000727022930.A9638@radicalmedia.com> <20000727000033.A44502@dragon.nuxi.com> <20000727035128.A9982@radicalmedia.com> <20000727164833.A18644@radicalmedia.com> <14720.41641.666813.600170@grasshopper.cs.duke.edu> <20000727174257.A19445@radicalmedia.com> <14720.44407.464338.134415@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=Kj7319i9nmIyA2yE X-Mailer: Mutt 0.95.1i In-Reply-To: <14720.44407.464338.134415@grasshopper.cs.duke.edu>; from Andrew Gallatin on Thu, Jul 27, 2000 at 05:47:14PM -0400 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii On Thu, Jul 27, 2000 at 05:47:14PM -0400, Andrew Gallatin wrote: > > Mark Abene writes: > > On Thu, Jul 27, 2000 at 05:06:55PM -0400, Andrew Gallatin wrote: > > > > They're using real fd_sets as args to select, however it appears they are > > doing mask arithmetic with ints. This may be the problem, since an fd_set > > on Alpha is 64 bits. I'll try a little experiment... > > That sounds suspicious.. > And it was! I've fixed the problem. I feel silly now, as looking at the same function in XFree86-4, they fixed it the same way I did for 3.3.6. :) Please accept the attached patch, in the hopes that it'll get integrated into the XFree86 port (3.3.6). Anyone using 3.3.6 should definitely patch and rebuild their X server. Cheers, -Mark --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xf86-336.diff" --- XFree86/work/xc/programs/Xserver/os/connection.c.orig Tue Jul 25 17:42:06 2000 +++ XFree86/work/xc/programs/Xserver/os/connection.c Thu Jul 27 17:56:36 2000 @@ -1004,13 +1004,13 @@ while (mask) { curoff = ffs (mask) - 1; - curclient = curoff + (i << 5); + curclient = curoff + (i * (sizeof(fd_mask)*8)); FD_ZERO(&tmask); FD_SET(curclient, &tmask); r = Select (curclient + 1, &tmask, NULL, NULL, ¬ime); if (r < 0) CloseDownClient(clients[ConnectionTranslation[curclient]]); - mask &= ~(1 << curoff); + mask &= ~(1L << curoff); } } #else --Kj7319i9nmIyA2yE-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message