-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Why did the LocalJumpError cross the road? #2132
Comments
All these work .. so, perhaps IR is broken for that webrick method .. could be ensure-related. Doing a quick test now and going to bed. But, that is where one of us should look whoever gets to its first. [subbu@earth ~/jruby] jruby -e 'Thread.new { return }.join' |
Reproducible on this snippet (jruby 1.7 and jruby 9k both fail on this). The problem is that the ensure executes before the return does (because of ensure-block cloning). However, the return should have ideally executed before the ensure which would have thrown the LJE and would have been caught => control won't get to the ensure before. But, this highlights a flaw in our ensure handling. However, this is an edge case that only affects LJEs from returns that are caught in code regions that are nested inside other regions with ensures. Thread.new {
begin
begin
return
rescue StandardError => e
p "Error #{e}"
end
p 'got out!'
ensure
p 'ensured!'
end
}.join subbu@earth: |
I think this would have worked properly in an earlier version of the IR interpreter from 18 odd months back :) .. unverified statement ... |
Fixed in 9ba99c1 |
We fixed some MRI test failures recently by changing a "return" to a "break" inside the main server method of WEBrick. The details are here: https://bugs.ruby-lang.org/issues/10478
However, there's a remaining outstanding question: why did the LocalJumpError from this exception bubble out in JRuby and not in MRI? This could be important!
The text was updated successfully, but these errors were encountered: