Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 07:42:06 +1030
From:      Greg Lewis <glewis@eyesbeyond.com>
To:        Charles Anderson <caa@midgard.dhs.org>
Cc:        Greg Lewis <glewis@eyesbeyond.com>, Fuyuhiko Maruyama <fuyuhik8@is.titech.ac.jp>, Michael E Mercer <mmercer@nc.rr.com>, freebsd-java@FreeBSD.ORG
Subject:   Re: LimeWire crash gdb information
Message-ID:  <20021220074206.A50951@misty.eyesbeyond.com>
In-Reply-To: <20021219194250.GC11902@midgard.dhs.org>; from caa@midgard.dhs.org on Thu, Dec 19, 2002 at 02:42:50PM -0500
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>

next in thread | previous in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021220074206.A50951>