Forum: Ruby Segmentation fault in recursive function

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
C85a33334dbbf2b23c87e8fa78beb8d2?d=identicon&s=25 Sven Klemm (Guest)
on 2006-04-12 21:49
(Received via mailing list)
Hi,

when executing the attached code I get a segmentation fault.

I know the code does not make that much sense but nervertheless should
ruby never segfault but throw a SystemStackError or something similar.

I am using ruby 1.8.4 under Gentoo (powerpc). On a x86 computer the code
correctly throws a SystemStackError.

Greetings,
Sven
F1d6cc2b735bfd82c8773172da2aeab9?d=identicon&s=25 Nobuyoshi Nakada (Guest)
on 2006-04-13 10:35
(Received via mailing list)
Hi,

2006/4/13, Sven Klemm <sven@c3d2.de>:
> I know the code does not make that much sense but nervertheless should
> ruby never segfault but throw a SystemStackError or something similar.
>
> I am using ruby 1.8.4 under Gentoo (powerpc). On a x86 computer the code
> correctly throws a SystemStackError.

Stack overflow can't be caught always.  There's no way (portable one,
at least) to tell it from other segfaults.
This topic is locked and can not be replied to.