Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Lack of SystemStackError

Reply
Thread Tools

Lack of SystemStackError

 
 
Daniel Berger
Guest
Posts: n/a
 
      11-04-2005
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

 
Reply With Quote
 
 
 
 
Ara.T.Howard
Guest
Posts: n/a
 
      11-04-2005
On Fri, 4 Nov 2005, Daniel Berger wrote:

> 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
================================================== =============================

 
Reply With Quote
 
 
 
 
MenTaLguY
Guest
Posts: n/a
 
      11-04-2005
On Fri, 2005-11-04 at 14:22 +0900, Daniel Berger wrote:
> 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



 
Reply With Quote
 
Gregory Brown
Guest
Posts: n/a
 
      11-04-2005
On 11/4/05, MenTaLguY <(E-Mail Removed)> wrote:
> On Fri, 2005-11-04 at 14:22 +0900, Daniel Berger wrote:
> > 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.


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)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SystemStackError when rb_define_module_function() * 3 Suraj Kurapati Ruby 3 02-19-2006 07:18 PM
SystemStackError when rb_define_module_function() * 3 Suraj Kurapati Ruby 0 02-17-2006 06:20 AM
ruby-htmltools on cygwin - SystemStackError Lee Ruby 2 10-25-2004 07:07 PM
Stack level too deep (SystemStackError) Jesper Olsen Ruby 7 01-16-2004 12:19 PM
SystemStackError comparing self-referential structures Joel VanderWerf Ruby 2 08-22-2003 01:14 PM



Advertisments