From owner-freebsd-ia64@FreeBSD.ORG Mon Jan 2 11:02:41 2006 Return-Path: X-Original-To: freebsd-ia64@freebsd.org Delivered-To: freebsd-ia64@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E0D0E16A41F for ; Mon, 2 Jan 2006 11:02:41 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA1A143D77 for ; Mon, 2 Jan 2006 11:02:39 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k02B2bdA037526 for ; Mon, 2 Jan 2006 11:02:37 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k02B2aCF037520 for freebsd-ia64@freebsd.org; Mon, 2 Jan 2006 11:02:36 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 2 Jan 2006 11:02:36 GMT Message-Id: <200601021102.k02B2aCF037520@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-ia64@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 02 Jan 2006 11:02:42 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/09/05] ia64/85772 ia64 [gpt] gpt (geom_) needs to adopt g_ctl 1 problem total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/09/16] ia64/86218 ia64 Mozilla / Firefox: regxpcom or regchrome 1 problem total. From owner-freebsd-ia64@FreeBSD.ORG Fri Jan 6 21:10:03 2006 Return-Path: X-Original-To: freebsd-ia64@hub.freebsd.org Delivered-To: freebsd-ia64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B123116A41F for ; Fri, 6 Jan 2006 21:10:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E772C43D49 for ; Fri, 6 Jan 2006 21:10:02 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k06LA2wI019717 for ; Fri, 6 Jan 2006 21:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k06LA266019714; Fri, 6 Jan 2006 21:10:02 GMT (envelope-from gnats) Resent-Date: Fri, 6 Jan 2006 21:10:02 GMT Resent-Message-Id: <200601062110.k06LA266019714@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ia64@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Tanaka Akira Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 787D316A41F for ; Fri, 6 Jan 2006 21:02:17 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 445D643D45 for ; Fri, 6 Jan 2006 21:02:17 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k06L2Gmv018672 for ; Fri, 6 Jan 2006 21:02:16 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k06L2GgQ018671; Fri, 6 Jan 2006 21:02:16 GMT (envelope-from nobody) Message-Id: <200601062102.k06L2GgQ018671@www.freebsd.org> Date: Fri, 6 Jan 2006 21:02:16 GMT From: Tanaka Akira To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ia64/91421: FD_ISSET returns long, not int. X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 21:10:03 -0000 >Number: 91421 >Category: ia64 >Synopsis: FD_ISSET returns long, not int. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ia64 >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 06 21:10:02 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Tanaka Akira >Release: 6.0-RELEASE >Organization: AIST >Environment: FreeBSD td150.testdrive.hp.com 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Wed Nov 2 10:01:27 UTC 2005 root@pluto2.freebsd.org:/usr/obj/usr/src/sys/GENERIC ia64 >Description: On IA64 (and other LP64 environments), (int)FD_ISSET(32, &fds) is evaluated to 0, even if 32 is set in fds. Since SUSv3 defines FD_ISSET defines as follows, cast to int should be safe. int FD_ISSET(int fd, fd_set *fdset); This problem is caused because FD_ISSET() returns single unsigned long bitmap. (__fds_bits is an array of unsigned long) td150.testdrive.hp.com> grep FD_ISSET /usr/include/sys/select.h #define FD_ISSET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) Since unsigned long is longer than int on LP64, (int)FD_ISSET() discards upper 32bits. >How-To-Repeat: td150.testdrive.hp.com> cat tst.c #include #include int main() { fd_set fds; FD_ZERO(&fds); FD_SET(32, &fds); printf("%d\n", (int)FD_ISSET(32, &fds)); printf("%lx\n", (long)FD_ISSET(32, &fds)); return 0; } td150.testdrive.hp.com> gcc tst.c td150.testdrive.hp.com> ./a.out 0 100000000 >Fix: add "!= 0". #define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0) >Release-Note: >Audit-Trail: >Unformatted: From owner-freebsd-ia64@FreeBSD.ORG Fri Jan 6 22:14:20 2006 Return-Path: X-Original-To: freebsd-ia64@hub.freebsd.org Delivered-To: freebsd-ia64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFB9F16A420; Fri, 6 Jan 2006 22:14:20 +0000 (GMT) (envelope-from marcel@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8FA543D64; Fri, 6 Jan 2006 22:14:19 +0000 (GMT) (envelope-from marcel@FreeBSD.org) Received: from freefall.freebsd.org (marcel@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k06MEJLW022676; Fri, 6 Jan 2006 22:14:19 GMT (envelope-from marcel@freefall.freebsd.org) Received: (from marcel@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k06MEJZW022672; Fri, 6 Jan 2006 22:14:19 GMT (envelope-from marcel) Date: Fri, 6 Jan 2006 22:14:19 GMT From: Marcel Moolenaar Message-Id: <200601062214.k06MEJZW022672@freefall.freebsd.org> To: akr@m17n.org, marcel@FreeBSD.org, freebsd-ia64@FreeBSD.org Cc: Subject: Re: ia64/91421: FD_ISSET returns long, not int. X-BeenThere: freebsd-ia64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the IA-64 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jan 2006 22:14:20 -0000 Synopsis: FD_ISSET returns long, not int. State-Changed-From-To: open->patched State-Changed-By: marcel State-Changed-When: Fri Jan 6 22:13:20 UTC 2006 State-Changed-Why: Fix committed to -CURRENT and will be merged onto the 6.x branch in a week. Thanks! http://www.freebsd.org/cgi/query-pr.cgi?pr=91421