From owner-freebsd-stable Sat Jun 8 20:48:58 2002 Delivered-To: freebsd-stable@freebsd.org Received: from sccmmhc01.mchsi.com (sccmmhc01.mchsi.com [204.127.203.183]) by hub.freebsd.org (Postfix) with ESMTP id B086F37B406; Sat, 8 Jun 2002 20:48:51 -0700 (PDT) Received: from math.missouri.edu ([12.216.240.219]) by sccmmhc01.mchsi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020609034851.EATU2006.sccmmhc01.mchsi.com@math.missouri.edu>; Sun, 9 Jun 2002 03:48:51 +0000 Message-ID: <3D02D022.6B225464@math.missouri.edu> Date: Sat, 08 Jun 2002 22:48:50 -0500 From: Stephen Montgomery-Smith X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.2 i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-hackers@freebsd.org, freebsd-stable@freebsd.org Subject: setrlimit and large maxssiz Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I am not sure which is the right mailing list, so sorry about the cross-posting: I want to use a lot of memory in my program, so I set the following in /boot/loader.conf: kern.maxdsiz=2147483648 kern.maxssiz=2147483648 kern.dfldsiz=2147483648 Then I run this simple program: #include #include #include #include int main() { struct rlimit rlp; getrlimit(RLIMIT_STACK,&rlp); fprintf(stderr,"%lld %lld\n",rlp.rlim_cur,rlp.rlim_max); rlp.rlim_cur = 512*1024*1024; fprintf(stderr,"%lld %lld\n",rlp.rlim_cur,rlp.rlim_max); setrlimit(RLIMIT_STACK,&rlp); exit(0); } and it crashes like this: 2147483648 2147483648 536870912 2147483648 Bus error (core dumped) Maybe I am expecting too much from the system. I have a dual Athlon MP system with about 3G of RAM, and I want to be able to use a good portion of this RAM in a single process. But I also want to use linuxthreads so that I can take advantage of the two processors. But linuxthreads uses setrlimit, and crashes in a similar way to my simple program. I looked at the kernel code in /usr/src/sys/kern/kern_resource.c at the function dosetrlimit, which I guess is where the action takes place, but I have no idea what to make of it. -- Stephen Montgomery-Smith stephen@math.missouri.edu http://www.math.missouri.edu/~stephen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message