This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: main() {char data[10000000];} crashes on alpha
- To: Matthias Klose <doko at cs dot tu-berlin dot de>
- Subject: Re: main() {char data[10000000];} crashes on alpha
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- Date: Thu, 25 Jan 2001 20:15:09 -0500
- Cc: gcc-bugs at gcc dot gnu dot org, 65364 at bugs dot debian dot org
- References: <14960.46017.923278.219959@gargle.gargle.HOWL>
On Fri, Jan 26, 2001 at 12:16:17AM +0100, Matthias Klose wrote:
>
> falk@borkum:~/src/pq% cat bug.c
> int main() {
> char data[10000000];
>
> return 0;
> }
> falk@borkum:~/src/pq% gcc bug.c -o bug
> falk@borkum:~/src/pq% ./bug
> zsh: segmentation fault (core dumped) ./bug
>
> Slightly less, like 5000000, works ok.
Use whatever command is appropriate for your shell to find out what your
resource limits are set to for stack. For bash, it's "ulimit -s":
% ulimit -s
8192
%
So by default, once I use more than 8 megs of stack space, I crash.
System administrators usually put limits on per-user reasources so that
one person's process can't wedge an entire machine.
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.