Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 May 2006 04:00:46 GMT
From:      Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/97765: lang/ruby18 default make without pthread, but link -lpthread
Message-ID:  <200605290400.k4T40kwl067531@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/97765; it has been noted by GNATS.

From: Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp>
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).



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