NetBSD Problem Report #34849

From www@NetBSD.org  Wed Oct 18 13:54:29 2006
Return-Path: <www@NetBSD.org>
Received: by narn.NetBSD.org (Postfix, from userid 31301)
	id 764B563B8C9; Wed, 18 Oct 2006 13:54:29 +0000 (UTC)
Message-Id: <20061018135429.764B563B8C9@narn.NetBSD.org>
Date: Wed, 18 Oct 2006 13:54:29 +0000 (UTC)
From: sigmfsk@aol.com
Reply-To: sigmfsk@aol.com
To: gnats-bugs@NetBSD.org
Subject: max stack size stays at DFLSSIZ / doesn't increase to MAXSSIZ
X-Send-Pr-Version: www-1.0

>Number:         34849
>Category:       port-sun3
>Synopsis:       max stack size stays at DFLSSIZ / doesn't increase to MAXSSIZ
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-sun3-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 13:55:00 +0000 2006
>Closed-Date:    Wed Aug 27 18:58:16 +0000 2014
>Last-Modified:  Wed Aug 27 18:58:16 +0000 2014
>Originator:     Arthur Townsend
>Release:        3.0
>Organization:
>Environment:
>Description:
On a sun 3/80 (sun3x), the maximum stack size is the default stack size of 2Mb (DFLSSIZ in /usr/src/sys/arch/sun3/include/vmparam3x.h).  The stack does not increase to MAXSSIZ.

I generated a new sun3x generic kernel with DFLSSIZ of 4Mb, and the max stack size increased to 4Mb.

The sun3 kernel has a DFLSSIZ of 0.5Mb (in vmparam3.h).  Running the generic sun3 NetBSD 3.0 kernel inside TME, the stack limit was 0.5Mb.  I generated a new sun3 generic kernel with DFLSSIZ of 2Mb, ran it inside TME, and the max stack size increased to 2Mb.
>How-To-Repeat:
Compile and run the following program, examining the SP at program start and at the point where the stack overflows.  It shows the limits described above.

gcc main.c
gdb a.out
b main
r
info reg (examine the sp)
c (wait until sigsegv)
info reg (examine the sp)
calculate max stack size by subtracting sp's

#include <stdio.h>

int myval(int inval) {
  if (inval == 0) {
    return 0;
  } else {
    return myval(inval-1)+1;
  }
}

int main()
{
  int i = 1000000;

  printf("%d %d\n",i,myval(i));
}


>Fix:

>Release-Note:

>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Wed, 27 Aug 2014 18:58:16 +0000
State-Changed-Why:
This is not a bug - the default stack size sets the soft stack size
limit; you can raise that as far as the hard stack size limit (which
is the maximum stack size) but you have to do it explicitly with
the shell ulimit/limit builtins or with the setrlimit(2) system call.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.