Subject: port-sun3/34849: max stack size stays at DFLSSIZ / doesn't increase to MAXSSIZ
To: None <port-sun3-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <sigmfsk@aol.com>
List: netbsd-bugs
Date: 10/18/2006 13:55:00
>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:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 18 13:55:00 +0000 2006
>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: