ports/97765: lang/ruby18 default make without pthread, but link -lpthread
Yoshiaki Kasahara
kasahara at nc.kyushu-u.ac.jp
Mon May 29 04:00:47 UTC 2006
The following reply was made to PR ports/97765; it has been noted by GNATS.
From: Yoshiaki Kasahara <kasahara at nc.kyushu-u.ac.jp>
To: bug-followup at FreeBSD.org, mutoh at openedu.org, mezz7 at 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).
More information about the freebsd-ports-bugs
mailing list