This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: main() {char data[10000000];} crashes on alpha


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]