Maximum stack depth

G

Gavin Kistner

On FreeBSD 5:
49165
I think I can live with that. Solaris 9 fares somewhat worse:
3921
But not as badly as Linux 2.6.8.1:
2091
Or WinXP:

Man, you are all awesome compared to MacOS X :|

[Slim:~] gavinkis% uname -a
Darwin Slim.local 7.8.0 Darwin Kernel Version 7.8.0: Wed Dec 22
14:26:17 PST 2004; root:xnu/xnu-517.11.1.obj~1/RELEASE_PPC Power
Macintosh powerpc

[Slim:~] gavinkis% ruby --version
ruby 1.8.2 (2004-11-06) [powerpc-darwin7.6.0]

[Slim:~] gavinkis% ruby tmp.rb
tmp.rb:9:in `ack': stack level too deep (SystemStackError)
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
... 600 levels...
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:9:in `ack'
from tmp.rb:14
 
E

Eric Anderson

Tim said:
After a bit of research, I've discovered that Gentoo by default doesn't
have a stack size limit. Watch: (using the bash builtin `ulimit`)

$ ulimit -a
<snip>
stack size (kbytes, -s) unlimited
<snip>

I'm on gentoo and here is the output of my system. I haven't changed any
defaults:

$ ulimit -a
<snip>
stack size (kbytes, -s) 8192
<snip>

Eric
 
L

Luke Graham

I used to run gentoo (and will again), and I always turned
swap off for the reason mentioned... runaway
processes are hard to kill when the machine is
thrashing. It might not be an option if you have less than
say, 0.5 gig of ram, but I never once had trouble with
a legit process because of it.
 
Y

Yukihiro Matsumoto

Hi,

In message "Re: Maximum stack depth"

|I wonder, is it safe to rescue SystemStackError? It seems to work, but
|can the interpreter be trusted after this?

It should be safe, since exception rewinds C stack using longjmp(3).

matz.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top