Summary: | lang/ruby18 default make without pthread, but link -lpthread | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Takeshi MUTOH <mutoh> |
Component: | Individual Port(s) | Assignee: | freebsd-ports-bugs (Nobody) <ports-bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | ||
Priority: | Normal | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any |
Description
Takeshi MUTOH
2006-05-24 05:10:20 UTC
State Changed From-To: open->closed Committed, thanks! 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). |