From owner-freebsd-ports-bugs@FreeBSD.ORG Mon May 29 04:00:46 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E206816A4DC for ; Mon, 29 May 2006 04:00:46 +0000 (UTC) (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 A07A743D46 for ; Mon, 29 May 2006 04:00:46 +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 k4T40kDT067535 for ; Mon, 29 May 2006 04:00:46 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4T40kwl067531; Mon, 29 May 2006 04:00:46 GMT (envelope-from gnats) Date: Mon, 29 May 2006 04:00:46 GMT Message-Id: <200605290400.k4T40kwl067531@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Yoshiaki Kasahara Cc: Subject: Re: ports/97765: lang/ruby18 default make without pthread, but link -lpthread X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Yoshiaki Kasahara List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 May 2006 04:00:47 -0000 The following reply was made to PR ports/97765; it has been noted by GNATS. From: Yoshiaki Kasahara To: bug-followup@FreeBSD.org, mutoh@openedu.org, mezz7@cox.net Cc: Subject: Re: ports/97765: lang/ruby18 default make without pthread, but link -lpthread Date: Mon, 29 May 2006 12:56:23 +0900 (JST) The proposed patch was reverted by 1.8.4_8,1, but '-lpthread' causes ruby scripts to have very limited stack size (again... see PR: port/81464). It was the point of introducing WITH_PTHREADS knob. AFAIK, pthread's stack size is specified in libpthread/thread/thr_private.h. ------------------------ /* * Miscellaneous definitions. */ #define THR_STACK32_DEFAULT (1 * 1024 * 1024) #define THR_STACK64_DEFAULT (2 * 1024 * 1024) /* * Maximum size of initial thread's stack. This perhaps deserves to be larger * than the stacks of other threads, since many applications are likely to run * almost entirely on this stack. */ #define THR_STACK32_INITIAL (2 * 1024 * 1024) #define THR_STACK64_INITIAL (4 * 1024 * 1024) ------------------------ It seems that '-lpthread' causes every programs to have this limited stacksize. getrlimit() doesn't report the reduced stacksize (which Ruby interpreter expects), so Ruby crashes without raising exception when its stack is exhausted. In my opinion, always linking libpthread is overkill for only supporting ruby-gtk2.... Is it a issue of pthread implementation? I don't have a good solution though... Some of my scripts needs much more stack size than pthread allows, and recently I need to use ruby-gtk2, too. Maybe I'll install two binaries (with and without pthread).