Lack of SystemStackError

Discussion in 'Ruby' started by Daniel Berger, Nov 4, 2005.

  1. 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
    Daniel Berger, Nov 4, 2005
    #1
    1. Advertising

  2. Daniel Berger

    Ara.T.Howard Guest

    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
    ===============================================================================
    Ara.T.Howard, Nov 4, 2005
    #2
    1. Advertising

  3. Daniel Berger

    MenTaLguY Guest

    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
    MenTaLguY, Nov 4, 2005
    #3
  4. On 11/4/05, MenTaLguY <> 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)
    Gregory Brown, Nov 4, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joel VanderWerf
    Replies:
    2
    Views:
    88
  2. Jesper Olsen
    Replies:
    7
    Views:
    560
    Van Jacques
    Jan 16, 2004
  3. Lee
    Replies:
    2
    Views:
    173
  4. Suraj Kurapati
    Replies:
    0
    Views:
    117
    Suraj Kurapati
    Feb 17, 2006
  5. Suraj Kurapati
    Replies:
    3
    Views:
    104
    Suraj Kurapati
    Feb 19, 2006
Loading...

Share This Page