Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting a Java::JavaLang::StackOverflowError instead of a SystemStackError #1903

Closed
JoshCheek opened this issue Aug 14, 2014 · 4 comments
Closed
Milestone

Comments

@JoshCheek
Copy link

A file with a stack overflow:

def a
  a
end

begin
  a
rescue Exception
  p $!.class
end

MRI and RBX raise a SystemStackError

$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

$ ruby f.rb
SystemStackError

JRuby raises a Java::JavaLang::StackOverflowError

$ ruby -v
jruby 1.7.12 (1.9.3p392) 2014-04-15 643e292 on Java HotSpot(TM) 64-Bit Server VM 1.7.0_51-b13 [darwin-x86_64]

$ ruby f.rb
Java::JavaLang::StackOverflowError

This means I have to jump through hoops to rescue it in JRuby in a way that won't break on other implementations.

@pushrax
Copy link

pushrax commented Mar 25, 2015

Any clean resolution for this? Liquid's test suite expects a SystemStackError in a couple places, and thus CI is broken for jruby with no clean fix.

@perlun
Copy link
Contributor

perlun commented Jun 9, 2016

FWIW, I've seen that this behaves differently in JRuby 1.7 and JRuby 9k now. 1.7 raises a SystemStackError, whereas 9k raises a Java error instead.

@kares kares added this to the JRuby 9.2.0.0 milestone Jun 22, 2017
@kares
Copy link
Member

kares commented Jun 22, 2017

marked as a regression, so that its considered to be fixed for next major 9K release.

@headius
Copy link
Member

headius commented May 16, 2018

Won't fix. Stack errors are fatal and should not be rescued ever.

@headius headius closed this as completed May 16, 2018
@headius headius modified the milestones: JRuby 9.2.0.0, Won't Fix May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants