* Stack trouble with OSF/1's cc
@ 1995-09-14 4:00 Philippe Canal
1995-09-14 4:00 ` Mark Charette
1995-09-14 4:00 ` David Adamec
0 siblings, 2 replies; 3+ messages in thread
From: Philippe Canal @ 1995-09-14 4:00 UTC (permalink / raw)
With the following:
OSF1 V3.2 214 alpha
cc (cc)
The DEC OSF/1 AXP Compiler Driver 3.11
I compile the following program:
#include <stdio.h>
int test()
{
char array[2101250];
fprintf(stderr,"I made it inside test()\n");
return 0;
}
main ()
{
test();
}
When I execute it I get a segmentation fault at the time of the call to
test().
This does happen as soon as the size of my array is more than 2Mo!
I was wondering if it was a bug or a feature of OSF/1, its cc or the alpha,
and is there any patch/promise of solving it in the next version etc ...
Thanks for any help!
Philippe Canal
--
Philippe
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Stack trouble with OSF/1's cc
1995-09-14 4:00 Stack trouble with OSF/1's cc Philippe Canal
@ 1995-09-14 4:00 ` Mark Charette
1995-09-14 4:00 ` David Adamec
1 sibling, 0 replies; 3+ messages in thread
From: Mark Charette @ 1995-09-14 4:00 UTC (permalink / raw)
Philippe Canal (pcanal@fndaub.fnal.gov) wrote:
: With the following:
: OSF1 V3.2 214 alpha
: cc (cc)
: The DEC OSF/1 AXP Compiler Driver 3.11
: I compile the following program:
: char array[2101250];
: I was wondering if it was a bug or a feature of OSF/1, its cc or the alpha,
: and is there any patch/promise of solving it in the next version etc ...
The default stack size for your machine is probably set absymally low.
In a C shell, type
limit
On my machine, it responds with
cputime unlimited
filesize unlimited
datasize 1048576 kbytes
stacksize 32768 kbytes
coredumpsize unlimited
memoryuse 121808 kbytes
descriptors 4096 files
addressspace 1048576 kbytes
giving me 32 Mb stack. You can try
limit stacksize unlimited
to get a bigger stack. If someone has set maxssiz in the sys/conf/<machinename>
file to a real low value & made a new kernel, however, there's nothing you can
do except change the file & recompile the kernel.
I always set the dfldsiz & dflssiz to the maxdsiz & maxssiz (respectively)
on my Alphas. Of course, I never share my machines, either ;^)
--
Mark Charette charette@mika.com
MIKA Systems, Inc
17197 N. Laurel Park Dr Suite 115
Livonia, MI 48152
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Stack trouble with OSF/1's cc
1995-09-14 4:00 Stack trouble with OSF/1's cc Philippe Canal
1995-09-14 4:00 ` Mark Charette
@ 1995-09-14 4:00 ` David Adamec
1 sibling, 0 replies; 3+ messages in thread
From: David Adamec @ 1995-09-14 4:00 UTC (permalink / raw)
pcanal@fndaub.fnal.gov (Philippe Canal) wrote:
>
>With the following:
>OSF1 V3.2 214 alpha
>cc (cc)
> The DEC OSF/1 AXP Compiler Driver 3.11
>I compile the following program:
>
>#include <stdio.h>
>int test()
>{
> char array[2101250];
> fprintf(stderr,"I made it inside test()\n");
> return 0;
>}
>
>main ()
>{
>test();
>}
>
>When I execute it I get a segmentation fault at the time of the call to
>test().
>This does happen as soon as the size of my array is more than 2Mo!
>
>I was wondering if it was a bug or a feature of OSF/1, its cc or the alpha,
>and is there any patch/promise of solving it in the next version etc ...
>
>Thanks for any help!
>
>Philippe Canal
>--
>Philippe
I don't think it's a bug, you've just run out of stack space. You can
either build a new kernel allowing for a bigger stack size or you can
use malloc to put the array into data space instead of the
stack.
David Adamec
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1995-09-14 4:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1995-09-14 4:00 Stack trouble with OSF/1's cc Philippe Canal
1995-09-14 4:00 ` Mark Charette
1995-09-14 4:00 ` David Adamec
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox