Lack of SystemStackError

D

Daniel Berger

Hi all,

Ruby 1.8.x (2,3,4)
Suse Linux 9.3
gcc 3.3.5
1 gb ram

Linux linux 2.6.11.4-21.9-default #1 Fri Aug 19 11:58:59 UTC 2005 i686
athlon i386 GNU/Linux

I notice that when I try a recursive function in an attempt to
deliberately raise a SystemStackError, it instead just goes into an
infinite loop, freezes my system, and is eventually killed (with no
error), by the OS.

def foo; foo; end # example

I don't see this behavior on my other (Solaris, Windows) machines.
What's up?

Thanks,

Dan
 
A

Ara.T.Howard

Hi all,

Ruby 1.8.x (2,3,4)
Suse Linux 9.3
gcc 3.3.5
1 gb ram

Linux linux 2.6.11.4-21.9-default #1 Fri Aug 19 11:58:59 UTC 2005 i686
athlon i386 GNU/Linux

I notice that when I try a recursive function in an attempt to
deliberately raise a SystemStackError, it instead just goes into an
infinite loop, freezes my system, and is eventually killed (with no
error), by the OS.

is that bad? ;-)

-a
--
===============================================================================
| email :: ara [dot] t [dot] howard [at] noaa [dot] gov
| phone :: 303.497.6469
| anything that contradicts experience and logic should be abandoned.
| -- h.h. the 14th dalai lama
===============================================================================
 
M

MenTaLguY

I notice that when I try a recursive function in an attempt to
deliberately raise a SystemStackError, it instead just goes into an
infinite loop, freezes my system, and is eventually killed (with no
error), by the OS.

I don't see this behavior on my other (Solaris, Windows) machines.
What's up?

Raising SystemStackError if the stack gets too deep is a courtesy, not a
promise. Same goes for NoMemoryError and running out of memory.

It's possible, in either case, that raising the error would require more
of the resource that you just ran out of.

-mental
 
G

Gregory Brown

Raising SystemStackError if the stack gets too deep is a courtesy, not a
promise. Same goes for NoMemoryError and running out of memory.

It's possible, in either case, that raising the error would require more
of the resource that you just ran out of.

Still sounds like a bug. On OS X 10.3 and Gentoo (Linux Kernel 2.6)
I get an immediate SystemStackError after no halt running the code
Daniel posted. Both are running 1.8.2

I googled and saw that a miscalculated stack depth was supposedly
fixed a couple years a go in suse packages (with 1.8.0, i think)
 

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,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top