From owner-freebsd-hackers Mon Jan 17 19:58:14 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from pcnet1.pcnet.com (pcnet1.pcnet.com [204.213.232.3]) by hub.freebsd.org (Postfix) with ESMTP id A06BC1509F for ; Mon, 17 Jan 2000 19:58:09 -0800 (PST) (envelope-from eischen@vigrid.com) Received: from vigrid.com (pm3-pt34.pcnet.net [206.105.29.108]) by pcnet1.pcnet.com (8.8.7/PCNet) with ESMTP id WAA08243; Mon, 17 Jan 2000 22:54:39 -0500 (EST) Message-ID: <3883E3E3.9E67C83@vigrid.com> Date: Mon, 17 Jan 2000 22:54:11 -0500 From: "Daniel M. Eischen" X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 4.0-CURRENT i386) X-Accept-Language: en MIME-Version: 1.0 To: Iani Brankov Cc: hackers@FreeBSD.ORG, Matthew Dillon Subject: Re: The stack size for a process? References: <3883AC8A.7A6F7D5F@bulinfo.net> <200001180231.SAA18439@apollo.backplane.com> <3883D4C4.E87573FC@bulinfo.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Iani Brankov wrote: > > Matthew Dillon wrote: > > [snip] > > > At your csh prompt type 'limit'. If you are using bash type 'ulimit -a'. > > > > When I compile and run your program it works fine on my box. I tried > > compiling it -O0, -O1, and -O2. > > > > % cc x.c -o x -O0 > > % ./x > > % > > Here's the > > ~>ulimit -a > core file size (blocks) unlimited > data seg size (kbytes) 524288 > file size (blocks) unlimited > max locked memory (kbytes) unlimited > max memory size (kbytes) unlimited > open files 2088 > pipe size (512 bytes) 1 > stack size (kbytes) 65536 > cpu time (seconds) unlimited > max user processes 1043 > virtual memory (kbytes) 589824 > > The machine has enough RAM & swap space. (256/512MB) > > I feel Daniel is right. The problem can be in the fact that it uses > threads. > I don't know do the threads share share the same stack space and how. > > My main point was that the application worked before `making the > world'. The stack allocation algorithm in the threads library was fixed - it used to leave an extra page of stack unmapped. So you could have been getting one more page of stack than what you are getting now. By default, you should get 64KB of stack per thread, and 1MB of stack for the main thread. Use pthread_attr_setstacksize() to specify a size larger than the default. Dan Eischen eischen@vigrid.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message