Re: stack limit for sun3/sun3x
[email protected] Mon, 16 Oct 2006 22:52:44 EDT
| Newsgroups | gmane.os.netbsd.ports.sun3 |
|---|---|
| Message-ID | <[email protected]> |
In a message dated 10/16/2006 8:48:28 P.M. Eastern Standard Time, [email protected] writes: Arthur, the stack limit on the sun3x is determined from the file sys/arch/sun3/include/vmparam3x.h The relevant part is this snippet: #ifndef MAXSSIZ #define MAXSSIZ (32*1024*1024) /* max stack size */ #endif So the answer to your question is 32 megabytes. ---- Hi Jeremy: That does seem clear, but it seems I can't use nearly that much on a real sun3x. On a real sun3/80, running NetBSD 3.0, I run the following program that is designed to quickly use up stack space: #include <stdio.h> int val(int myval) { if (myval == 0) { return 0; } else { return val(myval-1); } } int main() { unsigned int i; for (i=1000000; i<=1000000; i++) printf("%d\n",i,val(i)); } I did the following steps: gcc main.c gdb a.out b main run info reg (examining the SP - 0xf7ffee20 run (wait a while for it to get a seg fault) info reg (examining the SP - 0xf7dffffc The SP has decreased by 0x1fee24. Inside TME, SP decreases by 0x7edb0 before seg faulting (1/4 of the stack size used as the real sun3x). I was confused by the difference between sun3x and TME's sun3 stack limit differences, but now I'm extra confused that I don't see the real sun3x's SP decreasing by 32Mb before seg faulting. limit -h (in real sun3x and TME) shows the stacksize as 32768 kbytes, just as the MAXSSIZ in both vmparam3.h and vmparam3x.h. thanks, arthur