From owner-freebsd-java Thu Dec 19 13:16:31 2002 Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0CDCE37B401 for ; Thu, 19 Dec 2002 13:16:29 -0800 (PST) Received: from mgr2.xmission.com (mgr2.xmission.com [198.60.22.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDCE443EC2 for ; Thu, 19 Dec 2002 13:16:27 -0800 (PST) (envelope-from glewis@eyesbeyond.com) Received: from mail by mgr2.xmission.com with spam-scanned (Exim 3.35 #1) id 18P7zS-0005gh-02 for freebsd-java@freebsd.org; Thu, 19 Dec 2002 14:13:58 -0700 Received: from [207.135.128.145] (helo=misty.eyesbeyond.com) by mgr2.xmission.com with esmtp (Exim 3.35 #1) id 18P7xk-0004bX-02; Thu, 19 Dec 2002 14:12:13 -0700 Received: (from glewis@localhost) by misty.eyesbeyond.com (8.11.6/8.11.6) id gBJLC7I50965; Fri, 20 Dec 2002 07:42:07 +1030 (CST) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Fri, 20 Dec 2002 07:42:06 +1030 From: Greg Lewis To: Charles Anderson Cc: Greg Lewis , Fuyuhiko Maruyama , Michael E Mercer , freebsd-java@FreeBSD.ORG Subject: Re: LimeWire crash gdb information Message-ID: <20021220074206.A50951@misty.eyesbeyond.com> References: <3DBAE791.27A93619@nc.rr.com> <20021027083816.B10962@misty.eyesbeyond.com> <3DBB49F8.941D3E09@nc.rr.com> <3DBB4CEA.E0DC7E1C@nc.rr.com> <3DBB5250.8DA88B27@nc.rr.com> <20021030172314.A31631@misty.eyesbeyond.com> <55of97wizj.wl@dittohead.is.titech.ac.jp> <20021112163230.A95899@misty.eyesbeyond.com> <20021219194250.GC11902@midgard.dhs.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20021219194250.GC11902@midgard.dhs.org>; from caa@midgard.dhs.org on Thu, Dec 19, 2002 at 02:42:50PM -0500 X-Spam-Status: No, hits=-4.1 required=8.0 tests=IN_REP_TO,PATCH_UNIFIED_DIFF,QUOTED_EMAIL_TEXT,REFERENCES, SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT,X_AUTH_WARNING version=2.43 X-Spam-Level: Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Dec 19, 2002 at 02:42:50PM -0500, Charles Anderson wrote: > I just had limewire crash while running java_g, so I poked around a bit. > I found this. I think this has already been sorted out. See attached patch. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch-iomgr.c" $FreeBSD$ --- ../src/solaris/hpi/green_threads/src/iomgr.c 13 Oct 2001 04:41:31 -0000 1.7 +++ ../src/solaris/hpi/green_threads/src/iomgr.c 5 Dec 2002 08:36:42 -0000 @@ -193,7 +193,7 @@ errno = saved_errno; \ } else ((void) 0) -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) #define SIMPLE_INITFD(newfd, funcname) \ if (1) { \ if (newfd >= 0) { \ @@ -412,14 +412,18 @@ * As a temporary fix, bump up the number of open * file descriptors to OPEN_MAX. */ - nbr_files.rlim_cur = nbr_files.rlim_max; - setrlimit(RLIMIT_NOFILE, &nbr_files); - #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) - max_files = MIN(FD_SETSIZE, nbr_files.rlim_cur); + /* On *BSDs, `select' syscall possibly be used in native methods. + * Therefore, we should limit the maximum number of files opened + * simultaneously to modest number, that can be treated by our syscall + * wrapper. + */ + nbr_files.rlim_cur = MIN(FD_SETSIZE, nbr_files.rlim_max); #else - max_files = nbr_files.rlim_cur; + nbr_files.rlim_cur = nbr_files.rlim_max; #endif + setrlimit(RLIMIT_NOFILE, &nbr_files); + max_files = nbr_files.rlim_cur; fdmon = (sys_mon_t **) calloc(max_files, sizeof(sys_mon_t *)); if (fdmon == 0) { --Nq2Wo0NMKNjxTN9z-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-java" in the body of the message