From owner-freebsd-hackers@FreeBSD.ORG Sun May 25 09:32:24 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2A9E37B401; Sun, 25 May 2003 09:32:24 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17D8243F3F; Sun, 25 May 2003 09:32:24 -0700 (PDT) (envelope-from eischen@pcnet1.pcnet.com) Received: from pcnet1.pcnet.com (localhost [127.0.0.1]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h4PGWJwQ001114; Sun, 25 May 2003 12:32:19 -0400 (EDT) Received: from localhost (eischen@localhost)h4PGWIOG001110; Sun, 25 May 2003 12:32:18 -0400 (EDT) Date: Sun, 25 May 2003 12:32:18 -0400 (EDT) From: Daniel Eischen To: Andrew MacIntyre In-Reply-To: <20030525220222.K52253@bullseye.apana.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: alane@freebsd.org Subject: Re: setting stacksize in "initial" thread (pthreads, 4.8R) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 May 2003 16:32:25 -0000 On Sun, 25 May 2003, Andrew MacIntyre wrote: > I have a situation with a Python interpreter built from Python > CVS sources that is hitting the stack limit for the "initial" thread > imposed by libc_r: PTHREAD_STACK_INITIAL in > /usr/src/lib/libc_r/uthread/pthread_private.h is set to 1MB (0x100000). This is not configurable without recompiling the library. > Compiler optimisation settings do affect whether Python's internal stack > check activate before the hard limit bites, and more recent versions of > gcc (than the stock gcc in 4.8R) are more aggressive users of stack. > > I have not been able to find any documented way to control the stacksize > of the "initial" thread either programmatically, via a compile/link > option or by way of a resource limit in login.conf. Is this possible > without rebuilding libc_r? No. > I don't yet have a 5.x install to check the situation - does the new > libthr/libkse setup differ in respect to the above? Libkse uses the same initial stack size; I can't speak for libthr. Is this something that is common to all python scripts, or is it just your own script(s) that is(are) getting caught. It seems 1MB is an awful lot to be on the stack, and perhaps some things are better malloc'd. -- Dan Eischen