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.
Sven K. (Guest)
on 2006-04-12 23: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
Nobuyoshi N. (Guest)
on 2006-04-13 12:35
(Received via mailing list)
Hi,

2006/4/13, Sven K. <removed_email_address@domain.invalid>:
> 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.