Subject: kern/2807: maximum stack size set too low
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg Lindahl <Greg-Lindahl@deshaw.com>
List: netbsd-bugs
Date: 10/05/1996 19:58:21
>Number:         2807
>Category:       kern
>Synopsis:       maximum stack size set too low
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Oct  5 17:05:00 1996
>Last-Modified:
>Originator:     lindahl@deshaw.com
>Organization:
D. E. Shaw & Co.
>Release:        1.2_BETA
>Environment:
	
System: NetBSD ramoth.nyc.deshaw.com 1.2A NetBSD 1.2A (X25) #0: Wed Sep 18 08:33:46 EDT 1996 christos@ramoth.nyc.deshaw.com:/tmp_mnt/src/NetBSD/cvsroot/src/sys/arch/i386/compile/X25 i386


>Description:

The default maximum stack size (use limit -h to view it) is set to
8 megabytes by default on the i386 kernel. This is fine if you are
imagining that all your programs malloc their data storage and a
big stack means runaway recursion. But many programs, especially
numerical C programs or fortran programs compiled with f2c -a, put
a lot of data on the stack for good reason. For this reason, the
maximum stack size ought to be the same as the maximum data size.

It is true that a user could always raise the limit for their
kernel, but requiring a kernel recompile to run a program which
uses 9 megabytes of core is a bit much...

Christos says that XFree86 and Tcl/Tk also have a problem with thi
being set too low.

Many architectures have this set to be the same as max data size,
but alpha, amiga, arm32, i386, pc532, and vax have it set lower.

>How-To-Repeat:

Compile my hydrocode with static variables, watch it work, compile
with automatic variables, watch it segv, debug for an hour scratching
your head, then realize...

>Fix:

edit /usr/src/sys/arch/*/include/vmparam.h
>Audit-Trail:
>Unformatted: