[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Unbounded stack growth

From: Marc Feeley
Subject: Re: [Chicken-users] Unbounded stack growth
Date: Wed, 11 Jul 2012 15:47:45 -0400

On 2012-07-11, at 3:44 PM, Jim Ursetto wrote:

> It seems that compiling with clang (llvm 3.0)
> prevents the crash, at least for values up to 20 million, on
> OS X and Linux.  Any higher and I start to hit swap.
> I don't know why this works.
> Plain gcc on linux, and llvm-gcc (llvm 2.7) on OS X 10.7, do crash
> at about 600k here w/ stack ulimit 8M.  Based on your results
> I am guessing your stack ulimit is 4M.
> Tried removing __attribute__((noreturn)) from chicken.h, as is done
> for clang and it made no difference, as you'd expect.  Only
> other difference from gcc is the stack pointer retrieval code but
> that is identical between clang and llvm-gcc.  So I have to
> assume LLVM 3.0 has something to do with the crash avoidance,
> which could very well be luck.
> Tested with Chicken
> Jim

I'm pretty sure LLVM is simply implementing the tail-call itself.  So there is 
no stack growth in the unwinding phase.  Unfortunately, one can't rely on the C 
compiler doing this in general.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]